File indexing completed on 2025-01-18 09:35:29
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SUM_FOR_INDEXABLE_HPP
0016 #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SUM_FOR_INDEXABLE_HPP
0017
0018 #include <boost/geometry/core/static_assert.hpp>
0019
0020 namespace boost { namespace geometry { namespace index { namespace detail {
0021
0022 template <
0023 typename Geometry,
0024 typename Indexable,
0025 typename IndexableTag,
0026 typename AlgoTag,
0027 size_t DimensionIndex>
0028 struct sum_for_indexable_dimension
0029 {
0030 BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
0031 "Not implemented for this Indexable type.",
0032 Geometry, Indexable, IndexableTag, AlgoTag);
0033 };
0034
0035 template <
0036 typename Geometry,
0037 typename Indexable,
0038 typename IndexableTag,
0039 typename AlgoTag,
0040 size_t N>
0041 struct sum_for_indexable
0042 {
0043 typedef typename sum_for_indexable_dimension<
0044 Geometry, Indexable, IndexableTag, AlgoTag, N - 1
0045 >::result_type result_type;
0046
0047 inline static result_type apply(Geometry const& g, Indexable const& i)
0048 {
0049 return
0050 sum_for_indexable<
0051 Geometry, Indexable, IndexableTag, AlgoTag, N - 1
0052 >::apply(g, i) +
0053 sum_for_indexable_dimension<
0054 Geometry, Indexable, IndexableTag, AlgoTag, N - 1
0055 >::apply(g, i);
0056 }
0057 };
0058
0059 template <
0060 typename Geometry,
0061 typename Indexable,
0062 typename IndexableTag,
0063 typename AlgoTag>
0064 struct sum_for_indexable<Geometry, Indexable, IndexableTag, AlgoTag, 1>
0065 {
0066 typedef typename sum_for_indexable_dimension<
0067 Geometry, Indexable, IndexableTag, AlgoTag, 0
0068 >::result_type result_type;
0069
0070 inline static result_type apply(Geometry const& g, Indexable const& i)
0071 {
0072 return
0073 sum_for_indexable_dimension<
0074 Geometry, Indexable, IndexableTag, AlgoTag, 0
0075 >::apply(g, i);
0076 }
0077 };
0078
0079 }}}}
0080
0081 #endif