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_SMALLEST_FOR_INDEXABLE_HPP
0016 #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SMALLEST_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 smallest_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 smallest_for_indexable
0042 {
0043 typedef typename smallest_for_indexable_dimension<
0044 Geometry, Indexable, IndexableTag, AlgoTag, N - 1
0045 >::result_type result_type;
0046
0047 template <typename Data>
0048 inline static result_type apply(Geometry const& g, Indexable const& i, Data const& data)
0049 {
0050 result_type r1 = smallest_for_indexable<
0051 Geometry, Indexable, IndexableTag, AlgoTag, N - 1
0052 >::apply(g, i, data);
0053
0054 result_type r2 = smallest_for_indexable_dimension<
0055 Geometry, Indexable, IndexableTag, AlgoTag, N - 1
0056 >::apply(g, i, data);
0057
0058 return r1 < r2 ? r1 : r2;
0059 }
0060 };
0061
0062 template <
0063 typename Geometry,
0064 typename Indexable,
0065 typename IndexableTag,
0066 typename AlgoTag>
0067 struct smallest_for_indexable<Geometry, Indexable, IndexableTag, AlgoTag, 1>
0068 {
0069 typedef typename smallest_for_indexable_dimension<
0070 Geometry, Indexable, IndexableTag, AlgoTag, 0
0071 >::result_type result_type;
0072
0073 template <typename Data>
0074 inline static result_type apply(Geometry const& g, Indexable const& i, Data const& data)
0075 {
0076 return
0077 smallest_for_indexable_dimension<
0078 Geometry, Indexable, IndexableTag, AlgoTag, 0
0079 >::apply(g, i, data);
0080 }
0081 };
0082
0083 }}}}
0084
0085 #endif