diff options
Diffstat (limited to 'boost/geometry/algorithms/detail/relate/point_point.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/relate/point_point.hpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/boost/geometry/algorithms/detail/relate/point_point.hpp b/boost/geometry/algorithms/detail/relate/point_point.hpp index d2a373f3c1..7103e2dc92 100644 --- a/boost/geometry/algorithms/detail/relate/point_point.hpp +++ b/boost/geometry/algorithms/detail/relate/point_point.hpp @@ -148,6 +148,8 @@ struct multipoint_multipoint Result & result, Strategy const& /*strategy*/) { + typedef typename Strategy::cs_tag cs_tag; + { // TODO: throw on empty input? bool empty1 = boost::empty(multi_point1); @@ -171,17 +173,17 @@ struct multipoint_multipoint // The geometry containing smaller number of points will be analysed first if ( boost::size(multi_point1) < boost::size(multi_point2) ) { - search_both<false>(multi_point1, multi_point2, result); + search_both<false, cs_tag>(multi_point1, multi_point2, result); } else { - search_both<true>(multi_point2, multi_point1, result); + search_both<true, cs_tag>(multi_point2, multi_point1, result); } relate::set<exterior, exterior, result_dimension<MultiPoint1>::value>(result); } - template <bool Transpose, typename MPt1, typename MPt2, typename Result> + template <bool Transpose, typename CSTag, typename MPt1, typename MPt2, typename Result> static inline void search_both(MPt1 const& first_sorted_mpt, MPt2 const& first_iterated_mpt, Result & result) { @@ -190,7 +192,7 @@ struct multipoint_multipoint || relate::may_update<exterior, interior, '0'>(result) ) { // NlogN + MlogN - bool is_disjoint = search<Transpose>(first_sorted_mpt, first_iterated_mpt, result); + bool is_disjoint = search<Transpose, CSTag>(first_sorted_mpt, first_iterated_mpt, result); if ( BOOST_GEOMETRY_CONDITION(is_disjoint || result.interrupt) ) return; @@ -201,11 +203,12 @@ struct multipoint_multipoint || relate::may_update<exterior, interior, '0'>(result) ) { // MlogM + NlogM - search<! Transpose>(first_iterated_mpt, first_sorted_mpt, result); + search<! Transpose, CSTag>(first_iterated_mpt, first_sorted_mpt, result); } } template <bool Transpose, + typename CSTag, typename SortedMultiPoint, typename IteratedMultiPoint, typename Result> @@ -215,9 +218,11 @@ struct multipoint_multipoint { // sort points from the 1 MPt typedef typename geometry::point_type<SortedMultiPoint>::type point_type; + typedef geometry::less<void, -1, CSTag> less_type; + std::vector<point_type> points(boost::begin(sorted_mpt), boost::end(sorted_mpt)); - geometry::less<> const less = geometry::less<>(); + less_type const less = less_type(); std::sort(points.begin(), points.end(), less); bool found_inside = false; |