1 // Boost.Geometry Index
3 // Sum values calculated for indexable's dimensions, used e.g. in R-tree k nearest neighbors query
5 // Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
7 // Use, modification and distribution is subject to the Boost Software License,
8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SUM_FOR_INDEXABLE_HPP
12 #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SUM_FOR_INDEXABLE_HPP
14 namespace boost { namespace geometry { namespace index { namespace detail {
19 typename IndexableTag,
21 size_t DimensionIndex>
22 struct sum_for_indexable_dimension
26 NOT_IMPLEMENTED_FOR_THIS_INDEXABLE_TAG_TYPE,
27 (sum_for_indexable_dimension));
33 typename IndexableTag,
36 struct sum_for_indexable
38 typedef typename sum_for_indexable_dimension<
39 Geometry, Indexable, IndexableTag, AlgoTag, N - 1
40 >::result_type result_type;
42 inline static result_type apply(Geometry const& g, Indexable const& i)
46 Geometry, Indexable, IndexableTag, AlgoTag, N - 1
48 sum_for_indexable_dimension<
49 Geometry, Indexable, IndexableTag, AlgoTag, N - 1
57 typename IndexableTag,
59 struct sum_for_indexable<Geometry, Indexable, IndexableTag, AlgoTag, 1>
61 typedef typename sum_for_indexable_dimension<
62 Geometry, Indexable, IndexableTag, AlgoTag, 0
63 >::result_type result_type;
65 inline static result_type apply(Geometry const& g, Indexable const& i)
68 sum_for_indexable_dimension<
69 Geometry, Indexable, IndexableTag, AlgoTag, 0
74 }}}} // namespace boost::geometry::index::detail
76 #endif // BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SUM_FOR_INDEXABLE_HPP