From adb8dfa0234f12d10c03e0991b8e75917bcc1a45 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Fri, 6 Mar 2015 10:56:42 +0200 Subject: [PATCH 01/32] [algorithms][partition] modify partition to work for forward ranges --- .../geometry/algorithms/detail/partition.hpp | 486 ++++++++++-------- 1 file changed, 277 insertions(+), 209 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/partition.hpp b/include/boost/geometry/algorithms/detail/partition.hpp index 25a34ba2e..8408c38fc 100644 --- a/include/boost/geometry/algorithms/detail/partition.hpp +++ b/include/boost/geometry/algorithms/detail/partition.hpp @@ -1,6 +1,11 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2011-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands. + +// This file was modified by Oracle on 2015. +// Modifications copyright (c) 2015 Oracle and/or its affiliates. + +// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -9,10 +14,13 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_PARTITION_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_PARTITION_HPP +#include #include -#include -#include +#include +#include #include +#include + namespace boost { namespace geometry { @@ -20,8 +28,6 @@ namespace boost { namespace geometry namespace detail { namespace partition { -typedef std::vector index_vector_type; - template inline void divide_box(Box const& box, Box& lower_box, Box& upper_box) { @@ -38,31 +44,33 @@ inline void divide_box(Box const& box, Box& lower_box, Box& upper_box) geometry::set(upper_box, mid); } -// Divide collection into three subsets: lower, upper and oversized +// Divide forward_range into three subsets: lower, upper and oversized // (not-fitting) // (lower == left or bottom, upper == right or top) -template +template +< + typename OverlapsPolicy, + typename ForwardRange, + typename Box, + typename IteratorVector +> inline void divide_into_subsets(Box const& lower_box, Box const& upper_box, - InputCollection const& collection, - index_vector_type const& input, - index_vector_type& lower, - index_vector_type& upper, - index_vector_type& exceeding) + ForwardRange const& /*forward_range*/, + IteratorVector const& input, + IteratorVector& lower, + IteratorVector& upper, + IteratorVector& exceeding) { - typedef boost::range_iterator + typedef typename boost::range_iterator < - index_vector_type const - >::type index_iterator_type; + IteratorVector const + >::type it_type; - for(index_iterator_type it = boost::begin(input); - it != boost::end(input); - ++it) + for(it_type it = boost::begin(input); it != boost::end(input); ++it) { - bool const lower_overlapping = OverlapsPolicy::apply(lower_box, - collection[*it]); - bool const upper_overlapping = OverlapsPolicy::apply(upper_box, - collection[*it]); + bool const lower_overlapping = OverlapsPolicy::apply(lower_box, **it); + bool const upper_overlapping = OverlapsPolicy::apply(upper_box, **it); if (lower_overlapping && upper_overlapping) { @@ -84,23 +92,34 @@ inline void divide_into_subsets(Box const& lower_box, } } -template +template +< + typename ExpandPolicy, + typename Box, + typename ForwardRange, + typename IteratorVector +> inline void expand_with_elements(Box& total, - InputCollection const& collection, - index_vector_type const& input) + ForwardRange const& /*forward_range*/, + IteratorVector const& input) { - typedef boost::range_iterator::type it_type; + typedef typename boost::range_iterator::type it_type; for(it_type it = boost::begin(input); it != boost::end(input); ++it) { - ExpandPolicy::apply(total, collection[*it]); + ExpandPolicy::apply(total, **it); } } -// Match collection with itself -template -inline void handle_one(InputCollection const& collection, - index_vector_type const& input, +// Match forward_range with itself +template +< + typename ForwardRange, + typename Policy, + typename IteratorVector +> +inline void handle_one(ForwardRange const& /*forward_range*/, + IteratorVector const& input, Policy& policy) { if (boost::size(input) == 0) @@ -108,75 +127,87 @@ inline void handle_one(InputCollection const& collection, return; } - typedef boost::range_iterator::type - index_iterator_type; + typedef typename boost::range_iterator::type it_type; // Quadratic behaviour at lowest level (lowest quad, or all exceeding) - for(index_iterator_type it1 = boost::begin(input); - it1 != boost::end(input); - ++it1) + for (it_type it1 = boost::begin(input); it1 != boost::end(input); ++it1) { - index_iterator_type it2 = it1; - for(++it2; it2 != boost::end(input); ++it2) + it_type it2 = it1; + for (++it2; it2 != boost::end(input); ++it2) { - policy.apply(collection[*it1], collection[*it2]); + policy.apply(**it1, **it2); } } } -// Match collection 1 with collection 2 +// Match forward range 1 with forward range 2 template < - typename InputCollection1, - typename InputCollection2, - typename Policy + typename ForwardRange1, + typename ForwardRange2, + typename Policy, + typename IteratorVector1, + typename IteratorVector2 > inline void handle_two( - InputCollection1 const& collection1, index_vector_type const& input1, - InputCollection2 const& collection2, index_vector_type const& input2, + ForwardRange1 const& /*forward_range1*/, IteratorVector1 const& input1, + ForwardRange2 const& /*forward_range2*/, IteratorVector2 const& input2, Policy& policy) { + typedef typename boost::range_iterator + < + IteratorVector1 const + >::type iterator_type1; + + typedef typename boost::range_iterator + < + IteratorVector2 const + >::type iterator_type2; + if (boost::size(input1) == 0 || boost::size(input2) == 0) { return; } - typedef boost::range_iterator - < - index_vector_type const - >::type index_iterator_type; - - for(index_iterator_type it1 = boost::begin(input1); + for(iterator_type1 it1 = boost::begin(input1); it1 != boost::end(input1); ++it1) { - for(index_iterator_type it2 = boost::begin(input2); + for(iterator_type2 it2 = boost::begin(input2); it2 != boost::end(input2); ++it2) { - policy.apply(collection1[*it1], collection2[*it2]); + policy.apply(**it1, **it2); } } } -inline bool recurse_ok(index_vector_type const& input, +template +inline bool recurse_ok(IteratorVector const& input, std::size_t min_elements, std::size_t level) { return boost::size(input) >= min_elements && level < 100; } -inline bool recurse_ok(index_vector_type const& input1, - index_vector_type const& input2, +template +inline bool recurse_ok(IteratorVector1 const& input1, + IteratorVector2 const& input2, std::size_t min_elements, std::size_t level) { return boost::size(input1) >= min_elements && recurse_ok(input2, min_elements, level); } -inline bool recurse_ok(index_vector_type const& input1, - index_vector_type const& input2, - index_vector_type const& input3, +template +< + typename IteratorVector1, + typename IteratorVector2, + typename IteratorVector3 +> +inline bool recurse_ok(IteratorVector1 const& input1, + IteratorVector2 const& input2, + IteratorVector3 const& input3, std::size_t min_elements, std::size_t level) { return boost::size(input1) >= min_elements @@ -193,7 +224,7 @@ template typename ExpandPolicy2, typename VisitBoxPolicy > -class partition_two_collections; +class partition_two_ranges; template @@ -204,79 +235,91 @@ template typename ExpandPolicy, typename VisitBoxPolicy > -class partition_one_collection +class partition_one_range { - typedef std::vector index_vector_type; - - template - static inline Box get_new_box(InputCollection const& collection, - index_vector_type const& input) + template + static inline Box get_new_box(ForwardRange const& forward_range, + IteratorVector const& input) { Box box; geometry::assign_inverse(box); - expand_with_elements(box, collection, input); + expand_with_elements(box, forward_range, input); return box; } - template + template + < + typename ForwardRange, + typename Policy, + typename IteratorVector + > static inline void next_level(Box const& box, - InputCollection const& collection, - index_vector_type const& input, + ForwardRange const& forward_range, + IteratorVector const& input, std::size_t level, std::size_t min_elements, Policy& policy, VisitBoxPolicy& box_policy) { if (recurse_ok(input, min_elements, level)) { - partition_one_collection + partition_one_range < 1 - Dimension, Box, OverlapsPolicy, ExpandPolicy, VisitBoxPolicy - >::apply(box, collection, input, + >::apply(box, forward_range, input, level + 1, min_elements, policy, box_policy); } else { - handle_one(collection, input, policy); + handle_one(forward_range, input, policy); } } - // Function to switch to two collections if there are geometries exceeding - // the separation line - template + // Function to switch to two forward ranges if there are + // geometries exceeding the separation line + template + < + typename ForwardRange, + typename Policy, + typename IteratorVector + > static inline void next_level2(Box const& box, - InputCollection const& collection, - index_vector_type const& input1, - index_vector_type const& input2, + ForwardRange const& forward_range, + IteratorVector const& input1, + IteratorVector const& input2, std::size_t level, std::size_t min_elements, Policy& policy, VisitBoxPolicy& box_policy) { - if (recurse_ok(input1, input2, min_elements, level)) { - partition_two_collections + partition_two_ranges < 1 - Dimension, Box, OverlapsPolicy, OverlapsPolicy, ExpandPolicy, ExpandPolicy, VisitBoxPolicy - >::apply(box, collection, input1, collection, input2, + >::apply(box, forward_range, input1, forward_range, input2, level + 1, min_elements, policy, box_policy); } else { - handle_two(collection, input1, collection, input2, policy); + handle_two(forward_range, input1, forward_range, input2, policy); } } public : - template + template + < + typename ForwardRange, + typename Policy, + typename IteratorVector + > static inline void apply(Box const& box, - InputCollection const& collection, - index_vector_type const& input, + ForwardRange const& forward_range, + IteratorVector const& input, std::size_t level, std::size_t min_elements, Policy& policy, VisitBoxPolicy& box_policy) @@ -286,32 +329,32 @@ public : Box lower_box, upper_box; divide_box(box, lower_box, upper_box); - index_vector_type lower, upper, exceeding; - divide_into_subsets(lower_box, upper_box, collection, + IteratorVector lower, upper, exceeding; + divide_into_subsets(lower_box, upper_box, forward_range, input, lower, upper, exceeding); if (boost::size(exceeding) > 0) { // Get the box of exceeding-only - Box exceeding_box = get_new_box(collection, exceeding); + Box exceeding_box = get_new_box(forward_range, exceeding); // Recursively do exceeding elements only, in next dimension they // will probably be less exceeding within the new box - next_level(exceeding_box, collection, exceeding, level, + next_level(exceeding_box, forward_range, exceeding, level, min_elements, policy, box_policy); - // Switch to two collections, combine exceeding with lower resp upper - // but not lower/lower, upper/upper - next_level2(exceeding_box, collection, exceeding, lower, level, + // Switch to two forward ranges, combine exceeding with + // lower resp upper, but not lower/lower, upper/upper + next_level2(exceeding_box, forward_range, exceeding, lower, level, min_elements, policy, box_policy); - next_level2(exceeding_box, collection, exceeding, upper, level, + next_level2(exceeding_box, forward_range, exceeding, upper, level, min_elements, policy, box_policy); } // Recursively call operation both parts - next_level(lower_box, collection, lower, level, min_elements, + next_level(lower_box, forward_range, lower, level, min_elements, policy, box_policy); - next_level(upper_box, collection, upper, level, min_elements, + next_level(upper_box, forward_range, upper, level, min_elements, policy, box_policy); } }; @@ -326,25 +369,25 @@ template typename ExpandPolicy2, typename VisitBoxPolicy > -class partition_two_collections +class partition_two_ranges { - typedef std::vector index_vector_type; - template < - typename InputCollection1, - typename InputCollection2, - typename Policy + typename ForwardRange1, + typename ForwardRange2, + typename Policy, + typename IteratorVector1, + typename IteratorVector2 > static inline void next_level(Box const& box, - InputCollection1 const& collection1, - index_vector_type const& input1, - InputCollection2 const& collection2, - index_vector_type const& input2, + ForwardRange1 const& forward_range1, + IteratorVector1 const& input1, + ForwardRange2 const& forward_range2, + IteratorVector2 const& input2, std::size_t level, std::size_t min_elements, Policy& policy, VisitBoxPolicy& box_policy) { - partition_two_collections + partition_two_ranges < 1 - Dimension, Box, @@ -353,7 +396,7 @@ class partition_two_collections ExpandPolicy1, ExpandPolicy2, VisitBoxPolicy - >::apply(box, collection1, input1, collection2, input2, + >::apply(box, forward_range1, input1, forward_range2, input2, level + 1, min_elements, policy, box_policy); } @@ -361,42 +404,49 @@ class partition_two_collections template < typename ExpandPolicy, - typename InputCollection + typename ForwardRange, + typename IteratorVector > - static inline Box get_new_box(InputCollection const& collection, - index_vector_type const& input) + static inline Box get_new_box(ForwardRange const& forward_range, + IteratorVector const& input) { Box box; geometry::assign_inverse(box); - expand_with_elements(box, collection, input); + expand_with_elements(box, forward_range, input); return box; } template < - typename InputCollection1, - typename InputCollection2 + typename ForwardRange1, + typename ForwardRange2, + typename IteratorVector1, + typename IteratorVector2 > - static inline Box get_new_box(InputCollection1 const& collection1, - index_vector_type const& input1, - InputCollection2 const& collection2, - index_vector_type const& input2) + static inline Box get_new_box(ForwardRange1 const& forward_range1, + IteratorVector1 const& input1, + ForwardRange2 const& forward_range2, + IteratorVector2 const& input2) { - Box box = get_new_box(collection1, input1); - expand_with_elements(box, collection2, input2); + Box box = get_new_box(forward_range1, input1); + expand_with_elements(box, forward_range2, input2); return box; } public : template < - typename InputCollection1, - typename InputCollection2, - typename Policy + typename ForwardRange1, + typename ForwardRange2, + typename Policy, + typename IteratorVector1, + typename IteratorVector2 > static inline void apply(Box const& box, - InputCollection1 const& collection1, index_vector_type const& input1, - InputCollection2 const& collection2, index_vector_type const& input2, + ForwardRange1 const& forward_range1, + IteratorVector1 const& input1, + ForwardRange2 const& forward_range2, + IteratorVector2 const& input2, std::size_t level, std::size_t min_elements, Policy& policy, VisitBoxPolicy& box_policy) @@ -406,12 +456,12 @@ public : Box lower_box, upper_box; divide_box(box, lower_box, upper_box); - index_vector_type lower1, upper1, exceeding1; - index_vector_type lower2, upper2, exceeding2; - divide_into_subsets(lower_box, upper_box, collection1, - input1, lower1, upper1, exceeding1); - divide_into_subsets(lower_box, upper_box, collection2, - input2, lower2, upper2, exceeding2); + IteratorVector1 lower1, upper1, exceeding1; + IteratorVector2 lower2, upper2, exceeding2; + divide_into_subsets(lower_box, upper_box, + forward_range1, input1, lower1, upper1, exceeding1); + divide_into_subsets(lower_box, upper_box, + forward_range2, input2, lower2, upper2, exceeding2); if (boost::size(exceeding1) > 0) { @@ -419,35 +469,39 @@ public : if (recurse_ok(exceeding1, exceeding2, min_elements, level)) { - Box exceeding_box = get_new_box(collection1, exceeding1, - collection2, exceeding2); - next_level(exceeding_box, collection1, exceeding1, - collection2, exceeding2, level, + Box exceeding_box = get_new_box(forward_range1, exceeding1, + forward_range2, exceeding2); + next_level(exceeding_box, forward_range1, exceeding1, + forward_range2, exceeding2, level, min_elements, policy, box_policy); } else { - handle_two(collection1, exceeding1, collection2, exceeding2, - policy); + handle_two(forward_range1, exceeding1, forward_range2, + exceeding2, policy); } // All exceeding from 1 with lower and upper of 2: - // (Check sizes of all three collections to avoid recurse into + // (Check sizes of all three forward ranges to avoid recurse into // the same combinations again and again) if (recurse_ok(lower2, upper2, exceeding1, min_elements, level)) { Box exceeding_box - = get_new_box(collection1, exceeding1); - next_level(exceeding_box, collection1, exceeding1, - collection2, lower2, level, min_elements, policy, box_policy); - next_level(exceeding_box, collection1, exceeding1, - collection2, upper2, level, min_elements, policy, box_policy); + = get_new_box(forward_range1, exceeding1); + next_level(exceeding_box, forward_range1, exceeding1, + forward_range2, lower2, level, min_elements, + policy, box_policy); + next_level(exceeding_box, forward_range1, exceeding1, + forward_range2, upper2, level, min_elements, + policy, box_policy); } else { - handle_two(collection1, exceeding1, collection2, lower2, policy); - handle_two(collection1, exceeding1, collection2, upper2, policy); + handle_two(forward_range1, exceeding1, forward_range2, lower2, + policy); + handle_two(forward_range1, exceeding1, forward_range2, upper2, + policy); } } @@ -457,36 +511,42 @@ public : if (recurse_ok(lower1, upper1, exceeding2, min_elements, level)) { Box exceeding_box - = get_new_box(collection2, exceeding2); - next_level(exceeding_box, collection1, lower1, - collection2, exceeding2, level, min_elements, policy, box_policy); - next_level(exceeding_box, collection1, upper1, - collection2, exceeding2, level, min_elements, policy, box_policy); + = get_new_box(forward_range2, exceeding2); + next_level(exceeding_box, forward_range1, lower1, + forward_range2, exceeding2, level, min_elements, + policy, box_policy); + next_level(exceeding_box, forward_range1, upper1, + forward_range2, exceeding2, level, min_elements, + policy, box_policy); } else { - handle_two(collection1, lower1, collection2, exceeding2, policy); - handle_two(collection1, upper1, collection2, exceeding2, policy); + handle_two(forward_range1, lower1, forward_range2, exceeding2, + policy); + handle_two(forward_range1, upper1, forward_range2, exceeding2, + policy); } } if (recurse_ok(lower1, lower2, min_elements, level)) { - next_level(lower_box, collection1, lower1, collection2, lower2, level, + next_level(lower_box, forward_range1, lower1, + forward_range2, lower2, level, min_elements, policy, box_policy); } else { - handle_two(collection1, lower1, collection2, lower2, policy); + handle_two(forward_range1, lower1, forward_range2, lower2, policy); } if (recurse_ok(upper1, upper2, min_elements, level)) { - next_level(upper_box, collection1, upper1, collection2, upper2, level, + next_level(upper_box, forward_range1, upper1, + forward_range2, upper2, level, min_elements, policy, box_policy); } else { - handle_two(collection1, upper1, collection2, upper2, policy); + handle_two(forward_range1, upper1, forward_range2, upper2, policy); } } }; @@ -523,63 +583,67 @@ template > class partition { - typedef std::vector index_vector_type; - - template - static inline void expand_to_collection(InputCollection const& collection, - Box& total, index_vector_type& index_vector) + template + < + typename ExpandPolicy, + typename IncludePolicy, + typename ForwardRange, + typename IteratorVector + > + static inline void expand_to_range(ForwardRange const& forward_range, + Box& total, IteratorVector& iterator_vector) { - std::size_t index = 0; - for(typename boost::range_iterator::type it - = boost::begin(collection); - it != boost::end(collection); - ++it, ++index) + for(typename boost::range_iterator::type it + = boost::begin(forward_range); + it != boost::end(forward_range); + ++it) { if (IncludePolicy::apply(*it)) { ExpandPolicy::apply(total, *it); - index_vector.push_back(index); + iterator_vector.push_back(it); } } } public : - template - static inline void apply(InputCollection const& collection, + template + static inline void apply(ForwardRange const& forward_range, VisitPolicy& visitor, std::size_t min_elements = 16, VisitBoxPolicy box_visitor = detail::partition::visit_no_policy() ) { - if (std::size_t(boost::size(collection)) > min_elements) + typedef typename boost::range_iterator + < + ForwardRange const + >::type iterator_type; + + if (std::size_t(boost::size(forward_range)) > min_elements) { - index_vector_type index_vector; + std::vector iterator_vector; Box total; assign_inverse(total); - expand_to_collection(collection, - total, index_vector); + expand_to_range(forward_range, + total, iterator_vector); - detail::partition::partition_one_collection + detail::partition::partition_one_range < 0, Box, OverlapsPolicy1, ExpandPolicy1, VisitBoxPolicy - >::apply(total, collection, index_vector, 0, min_elements, + >::apply(total, forward_range, iterator_vector, 0, min_elements, visitor, box_visitor); } else { - typedef typename boost::range_iterator - < - InputCollection const - >::type iterator_type; - for(iterator_type it1 = boost::begin(collection); - it1 != boost::end(collection); + for(iterator_type it1 = boost::begin(forward_range); + it1 != boost::end(forward_range); ++it1) { iterator_type it2 = it1; - for(++it2; it2 != boost::end(collection); ++it2) + for(++it2; it2 != boost::end(forward_range); ++it2) { visitor.apply(*it1, *it2); } @@ -589,53 +653,57 @@ public : template < - typename InputCollection1, - typename InputCollection2, + typename ForwardRange1, + typename ForwardRange2, typename VisitPolicy > - static inline void apply(InputCollection1 const& collection1, - InputCollection2 const& collection2, + static inline void apply(ForwardRange1 const& forward_range1, + ForwardRange2 const& forward_range2, VisitPolicy& visitor, std::size_t min_elements = 16, - VisitBoxPolicy box_visitor = detail::partition::visit_no_policy() + VisitBoxPolicy box_visitor + = detail::partition::visit_no_policy() ) { - if (std::size_t(boost::size(collection1)) > min_elements - && std::size_t(boost::size(collection2)) > min_elements) + typedef typename boost::range_iterator + < + ForwardRange1 const + >::type iterator_type1; + + typedef typename boost::range_iterator + < + ForwardRange2 const + >::type iterator_type2; + + if (std::size_t(boost::size(forward_range1)) > min_elements + && std::size_t(boost::size(forward_range2)) > min_elements) { - index_vector_type index_vector1, index_vector2; + std::vector iterator_vector1; + std::vector iterator_vector2; Box total; assign_inverse(total); - expand_to_collection(collection1, - total, index_vector1); - expand_to_collection(collection2, - total, index_vector2); + expand_to_range(forward_range1, + total, iterator_vector1); + expand_to_range(forward_range2, + total, iterator_vector2); - detail::partition::partition_two_collections + detail::partition::partition_two_ranges < 0, Box, OverlapsPolicy1, OverlapsPolicy2, ExpandPolicy1, ExpandPolicy2, VisitBoxPolicy >::apply(total, - collection1, index_vector1, - collection2, index_vector2, + forward_range1, iterator_vector1, + forward_range2, iterator_vector2, 0, min_elements, visitor, box_visitor); } else { - typedef typename boost::range_iterator - < - InputCollection1 const - >::type iterator_type1; - typedef typename boost::range_iterator - < - InputCollection2 const - >::type iterator_type2; - for(iterator_type1 it1 = boost::begin(collection1); - it1 != boost::end(collection1); + for(iterator_type1 it1 = boost::begin(forward_range1); + it1 != boost::end(forward_range1); ++it1) { - for(iterator_type2 it2 = boost::begin(collection2); - it2 != boost::end(collection2); + for(iterator_type2 it2 = boost::begin(forward_range2); + it2 != boost::end(forward_range2); ++it2) { visitor.apply(*it1, *it2); From ee1e0e0899e92084aabd20faa413c850d9e9cd52 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Sat, 7 Mar 2015 17:34:17 +0200 Subject: [PATCH 02/32] [algorithms][detail][partition] remove the forward range(s) argument(s) --- .../geometry/algorithms/detail/partition.hpp | 214 ++++++------------ 1 file changed, 66 insertions(+), 148 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/partition.hpp b/include/boost/geometry/algorithms/detail/partition.hpp index 8408c38fc..8b19add47 100644 --- a/include/boost/geometry/algorithms/detail/partition.hpp +++ b/include/boost/geometry/algorithms/detail/partition.hpp @@ -47,16 +47,9 @@ inline void divide_box(Box const& box, Box& lower_box, Box& upper_box) // Divide forward_range into three subsets: lower, upper and oversized // (not-fitting) // (lower == left or bottom, upper == right or top) -template -< - typename OverlapsPolicy, - typename ForwardRange, - typename Box, - typename IteratorVector -> +template inline void divide_into_subsets(Box const& lower_box, Box const& upper_box, - ForwardRange const& /*forward_range*/, IteratorVector const& input, IteratorVector& lower, IteratorVector& upper, @@ -96,12 +89,9 @@ template < typename ExpandPolicy, typename Box, - typename ForwardRange, typename IteratorVector > -inline void expand_with_elements(Box& total, - ForwardRange const& /*forward_range*/, - IteratorVector const& input) +inline void expand_with_elements(Box& total, IteratorVector const& input) { typedef typename boost::range_iterator::type it_type; for(it_type it = boost::begin(input); it != boost::end(input); ++it) @@ -112,15 +102,8 @@ inline void expand_with_elements(Box& total, // Match forward_range with itself -template -< - typename ForwardRange, - typename Policy, - typename IteratorVector -> -inline void handle_one(ForwardRange const& /*forward_range*/, - IteratorVector const& input, - Policy& policy) +template +inline void handle_one(IteratorVector const& input, Policy& policy) { if (boost::size(input) == 0) { @@ -143,15 +126,12 @@ inline void handle_one(ForwardRange const& /*forward_range*/, // Match forward range 1 with forward range 2 template < - typename ForwardRange1, - typename ForwardRange2, typename Policy, typename IteratorVector1, typename IteratorVector2 > -inline void handle_two( - ForwardRange1 const& /*forward_range1*/, IteratorVector1 const& input1, - ForwardRange2 const& /*forward_range2*/, IteratorVector2 const& input2, +inline void handle_two(IteratorVector1 const& input1, + IteratorVector2 const& input2, Policy& policy) { typedef typename boost::range_iterator @@ -237,24 +217,17 @@ template > class partition_one_range { - template - static inline Box get_new_box(ForwardRange const& forward_range, - IteratorVector const& input) + template + static inline Box get_new_box(IteratorVector const& input) { Box box; geometry::assign_inverse(box); - expand_with_elements(box, forward_range, input); + expand_with_elements(box, input); return box; } - template - < - typename ForwardRange, - typename Policy, - typename IteratorVector - > + template static inline void next_level(Box const& box, - ForwardRange const& forward_range, IteratorVector const& input, std::size_t level, std::size_t min_elements, Policy& policy, VisitBoxPolicy& box_policy) @@ -268,25 +241,18 @@ class partition_one_range OverlapsPolicy, ExpandPolicy, VisitBoxPolicy - >::apply(box, forward_range, input, - level + 1, min_elements, policy, box_policy); + >::apply(box, input, level + 1, min_elements, policy, box_policy); } else { - handle_one(forward_range, input, policy); + handle_one(input, policy); } } // Function to switch to two forward ranges if there are // geometries exceeding the separation line - template - < - typename ForwardRange, - typename Policy, - typename IteratorVector - > + template static inline void next_level2(Box const& box, - ForwardRange const& forward_range, IteratorVector const& input1, IteratorVector const& input2, std::size_t level, std::size_t min_elements, @@ -301,24 +267,18 @@ class partition_one_range OverlapsPolicy, OverlapsPolicy, ExpandPolicy, ExpandPolicy, VisitBoxPolicy - >::apply(box, forward_range, input1, forward_range, input2, - level + 1, min_elements, policy, box_policy); + >::apply(box, input1, input2, level + 1, min_elements, + policy, box_policy); } else { - handle_two(forward_range, input1, forward_range, input2, policy); + handle_two(input1, input2, policy); } } public : - template - < - typename ForwardRange, - typename Policy, - typename IteratorVector - > + template static inline void apply(Box const& box, - ForwardRange const& forward_range, IteratorVector const& input, std::size_t level, std::size_t min_elements, @@ -330,32 +290,30 @@ public : divide_box(box, lower_box, upper_box); IteratorVector lower, upper, exceeding; - divide_into_subsets(lower_box, upper_box, forward_range, + divide_into_subsets(lower_box, upper_box, input, lower, upper, exceeding); if (boost::size(exceeding) > 0) { // Get the box of exceeding-only - Box exceeding_box = get_new_box(forward_range, exceeding); + Box exceeding_box = get_new_box(exceeding); // Recursively do exceeding elements only, in next dimension they // will probably be less exceeding within the new box - next_level(exceeding_box, forward_range, exceeding, level, - min_elements, policy, box_policy); + next_level(exceeding_box, exceeding, level, min_elements, + policy, box_policy); // Switch to two forward ranges, combine exceeding with // lower resp upper, but not lower/lower, upper/upper - next_level2(exceeding_box, forward_range, exceeding, lower, level, - min_elements, policy, box_policy); - next_level2(exceeding_box, forward_range, exceeding, upper, level, - min_elements, policy, box_policy); + next_level2(exceeding_box, exceeding, lower, level, min_elements, + policy, box_policy); + next_level2(exceeding_box, exceeding, upper, level, min_elements, + policy, box_policy); } // Recursively call operation both parts - next_level(lower_box, forward_range, lower, level, min_elements, - policy, box_policy); - next_level(upper_box, forward_range, upper, level, min_elements, - policy, box_policy); + next_level(lower_box, lower, level, min_elements, policy, box_policy); + next_level(upper_box, upper, level, min_elements, policy, box_policy); } }; @@ -373,16 +331,12 @@ class partition_two_ranges { template < - typename ForwardRange1, - typename ForwardRange2, typename Policy, typename IteratorVector1, typename IteratorVector2 > static inline void next_level(Box const& box, - ForwardRange1 const& forward_range1, IteratorVector1 const& input1, - ForwardRange2 const& forward_range2, IteratorVector2 const& input2, std::size_t level, std::size_t min_elements, Policy& policy, VisitBoxPolicy& box_policy) @@ -396,56 +350,37 @@ class partition_two_ranges ExpandPolicy1, ExpandPolicy2, VisitBoxPolicy - >::apply(box, forward_range1, input1, forward_range2, input2, - level + 1, min_elements, - policy, box_policy); + >::apply(box, input1, input2, level + 1, min_elements, + policy, box_policy); } - template - < - typename ExpandPolicy, - typename ForwardRange, - typename IteratorVector - > - static inline Box get_new_box(ForwardRange const& forward_range, - IteratorVector const& input) + template + static inline Box get_new_box(IteratorVector const& input) { Box box; geometry::assign_inverse(box); - expand_with_elements(box, forward_range, input); + expand_with_elements(box, input); return box; } - template - < - typename ForwardRange1, - typename ForwardRange2, - typename IteratorVector1, - typename IteratorVector2 - > - static inline Box get_new_box(ForwardRange1 const& forward_range1, - IteratorVector1 const& input1, - ForwardRange2 const& forward_range2, + template + static inline Box get_new_box(IteratorVector1 const& input1, IteratorVector2 const& input2) { - Box box = get_new_box(forward_range1, input1); - expand_with_elements(box, forward_range2, input2); + Box box = get_new_box(input1); + expand_with_elements(box, input2); return box; } public : template < - typename ForwardRange1, - typename ForwardRange2, typename Policy, typename IteratorVector1, typename IteratorVector2 > static inline void apply(Box const& box, - ForwardRange1 const& forward_range1, IteratorVector1 const& input1, - ForwardRange2 const& forward_range2, IteratorVector2 const& input2, std::size_t level, std::size_t min_elements, @@ -459,9 +394,9 @@ public : IteratorVector1 lower1, upper1, exceeding1; IteratorVector2 lower2, upper2, exceeding2; divide_into_subsets(lower_box, upper_box, - forward_range1, input1, lower1, upper1, exceeding1); + input1, lower1, upper1, exceeding1); divide_into_subsets(lower_box, upper_box, - forward_range2, input2, lower2, upper2, exceeding2); + input2, lower2, upper2, exceeding2); if (boost::size(exceeding1) > 0) { @@ -469,16 +404,13 @@ public : if (recurse_ok(exceeding1, exceeding2, min_elements, level)) { - Box exceeding_box = get_new_box(forward_range1, exceeding1, - forward_range2, exceeding2); - next_level(exceeding_box, forward_range1, exceeding1, - forward_range2, exceeding2, level, - min_elements, policy, box_policy); + Box exceeding_box = get_new_box(exceeding1, exceeding2); + next_level(exceeding_box, exceeding1, exceeding2, level, + min_elements, policy, box_policy); } else { - handle_two(forward_range1, exceeding1, forward_range2, - exceeding2, policy); + handle_two(exceeding1, exceeding2, policy); } // All exceeding from 1 with lower and upper of 2: @@ -487,21 +419,16 @@ public : // the same combinations again and again) if (recurse_ok(lower2, upper2, exceeding1, min_elements, level)) { - Box exceeding_box - = get_new_box(forward_range1, exceeding1); - next_level(exceeding_box, forward_range1, exceeding1, - forward_range2, lower2, level, min_elements, - policy, box_policy); - next_level(exceeding_box, forward_range1, exceeding1, - forward_range2, upper2, level, min_elements, - policy, box_policy); + Box exceeding_box = get_new_box(exceeding1); + next_level(exceeding_box, exceeding1, lower2, level, + min_elements, policy, box_policy); + next_level(exceeding_box, exceeding1, upper2, level, + min_elements, policy, box_policy); } else { - handle_two(forward_range1, exceeding1, forward_range2, lower2, - policy); - handle_two(forward_range1, exceeding1, forward_range2, upper2, - policy); + handle_two(exceeding1, lower2, policy); + handle_two(exceeding1, upper2, policy); } } @@ -510,43 +437,36 @@ public : // All exceeding from 2 with lower and upper of 1: if (recurse_ok(lower1, upper1, exceeding2, min_elements, level)) { - Box exceeding_box - = get_new_box(forward_range2, exceeding2); - next_level(exceeding_box, forward_range1, lower1, - forward_range2, exceeding2, level, min_elements, - policy, box_policy); - next_level(exceeding_box, forward_range1, upper1, - forward_range2, exceeding2, level, min_elements, - policy, box_policy); + Box exceeding_box = get_new_box(exceeding2); + next_level(exceeding_box, lower1, exceeding2, level, + min_elements, policy, box_policy); + next_level(exceeding_box, upper1, exceeding2, level, + min_elements, policy, box_policy); } else { - handle_two(forward_range1, lower1, forward_range2, exceeding2, - policy); - handle_two(forward_range1, upper1, forward_range2, exceeding2, - policy); + handle_two(lower1, exceeding2, policy); + handle_two(upper1, exceeding2, policy); } } if (recurse_ok(lower1, lower2, min_elements, level)) { - next_level(lower_box, forward_range1, lower1, - forward_range2, lower2, level, - min_elements, policy, box_policy); + next_level(lower_box, lower1, lower2, level, + min_elements, policy, box_policy); } else { - handle_two(forward_range1, lower1, forward_range2, lower2, policy); + handle_two(lower1, lower2, policy); } if (recurse_ok(upper1, upper2, min_elements, level)) { - next_level(upper_box, forward_range1, upper1, - forward_range2, upper2, level, - min_elements, policy, box_policy); + next_level(upper_box, upper1, upper2, level, + min_elements, policy, box_policy); } else { - handle_two(forward_range1, upper1, forward_range2, upper2, policy); + handle_two(upper1, upper2, policy); } } }; @@ -633,8 +553,8 @@ public : OverlapsPolicy1, ExpandPolicy1, VisitBoxPolicy - >::apply(total, forward_range, iterator_vector, 0, min_elements, - visitor, box_visitor); + >::apply(total, iterator_vector, 0, min_elements, + visitor, box_visitor); } else { @@ -691,10 +611,8 @@ public : < 0, Box, OverlapsPolicy1, OverlapsPolicy2, ExpandPolicy1, ExpandPolicy2, VisitBoxPolicy - >::apply(total, - forward_range1, iterator_vector1, - forward_range2, iterator_vector2, - 0, min_elements, visitor, box_visitor); + >::apply(total, iterator_vector1, iterator_vector2, + 0, min_elements, visitor, box_visitor); } else { From ec5efe3799899d7931e4ec8d5f52394c1ba245b9 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Tue, 10 Mar 2015 16:04:31 +0200 Subject: [PATCH 03/32] [test][algorithms][set operations][pointlike] polish tests of set operations for pointlike/pointlike geometries (make the case ID the first argument of the tester); modify the common set operations test code so that it can be applied to set operations of pointlike/linear geometries as well; --- .../difference/difference_pl_pl.cpp | 128 ++++++++------- .../intersection/intersection_pl_pl.cpp | 124 ++++++++------- ...s_pl_pl.hpp => test_set_ops_pointlike.hpp} | 149 +++++++++++++----- .../set_operations/union/union_pl_pl.cpp | 139 ++++++++-------- 4 files changed, 330 insertions(+), 210 deletions(-) rename test/algorithms/set_operations/{test_set_ops_pl_pl.hpp => test_set_ops_pointlike.hpp} (58%) diff --git a/test/algorithms/set_operations/difference/difference_pl_pl.cpp b/test/algorithms/set_operations/difference/difference_pl_pl.cpp index 14a80f485..1712d94c5 100644 --- a/test/algorithms/set_operations/difference/difference_pl_pl.cpp +++ b/test/algorithms/set_operations/difference/difference_pl_pl.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014-2015, Oracle and/or its affiliates. // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -20,7 +20,7 @@ #include -#include "../test_set_ops_pl_pl.hpp" +#include "../test_set_ops_pointlike.hpp" #include @@ -51,17 +51,19 @@ BOOST_AUTO_TEST_CASE( test_difference_point_point ) > tester; tester::apply - (from_wkt

("POINT(0 0)"), + ("ppdf01", + from_wkt

("POINT(0 0)"), from_wkt

("POINT(1 1)"), from_wkt("MULTIPOINT(0 0)"), - from_wkt("MULTIPOINT(1 1)"), - "ppdf01"); + from_wkt("MULTIPOINT(1 1)") + ); tester::apply - (from_wkt

("POINT(0 0)"), + ("ppdf02", from_wkt

("POINT(0 0)"), - from_wkt("MULTIPOINT()"), - "ppdf02"); + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT()") + ); } @@ -82,58 +84,66 @@ BOOST_AUTO_TEST_CASE( test_difference_multipoint_point ) > tester; tester::apply - (from_wkt("MULTIPOINT(0 0)"), + ("mppdf01", + from_wkt("MULTIPOINT(0 0)"), from_wkt

("POINT(1 1)"), from_wkt("MULTIPOINT(0 0)"), - from_wkt("MULTIPOINT(1 1)"), - "mppdf01"); + from_wkt("MULTIPOINT(1 1)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0)"), + ("mppdf02", + from_wkt("MULTIPOINT(0 0)"), from_wkt

("POINT(0 0)"), - from_wkt("MULTIPOINT()"), - "mppdf02"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0)"), + ("mppdf03", + from_wkt("MULTIPOINT(0 0,0 0)"), from_wkt

("POINT(1 1)"), from_wkt("MULTIPOINT(0 0,0 0)"), - from_wkt("MULTIPOINT(1 1)"), - "mppdf03"); + from_wkt("MULTIPOINT(1 1)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0)"), + ("mppdf04", + from_wkt("MULTIPOINT(0 0,0 0)"), from_wkt

("POINT(0 0)"), - from_wkt("MULTIPOINT()"), - "mppdf04"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + ("mppdf05", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), from_wkt

("POINT(1 1)"), from_wkt("MULTIPOINT(0 0,0 0,1 0)"), - from_wkt("MULTIPOINT(1 1)"), - "mppdf05"); + from_wkt("MULTIPOINT(1 1)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + ("mppdf06", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), from_wkt

("POINT(1 0)"), from_wkt("MULTIPOINT(0 0,0 0)"), - from_wkt("MULTIPOINT()"), - "mppdf06"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + ("mppdf07", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), from_wkt

("POINT(0 0)"), from_wkt("MULTIPOINT(1 0)"), - from_wkt("MULTIPOINT()"), - "mppdf07"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT()"), + ("mppdf08", + from_wkt("MULTIPOINT()"), from_wkt

("POINT(0 0)"), from_wkt("MULTIPOINT()"), - from_wkt("MULTIPOINT(0 0)"), - "mppdf08"); + from_wkt("MULTIPOINT(0 0)") + ); } @@ -154,25 +164,28 @@ BOOST_AUTO_TEST_CASE( test_difference_point_multipoint ) > tester; tester::apply - (from_wkt

("POINT(0 0)"), + ("pmpdf01", + from_wkt

("POINT(0 0)"), from_wkt("MULTIPOINT(1 0,1 1,1 1)"), from_wkt("MULTIPOINT(0 0)"), - from_wkt("MULTIPOINT(1 0,1 1,1 1)"), - "pmpdf01"); + from_wkt("MULTIPOINT(1 0,1 1,1 1)") + ); tester::apply - (from_wkt

("POINT(0 0)"), + ("pmpdf02", + from_wkt

("POINT(0 0)"), from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), from_wkt("MULTIPOINT()"), - from_wkt("MULTIPOINT(1 0,1 1)"), - "pmpdf02"); + from_wkt("MULTIPOINT(1 0,1 1)") + ); tester::apply - (from_wkt

("POINT(0 0)"), + ("pmpdf03", + from_wkt

("POINT(0 0)"), from_wkt("MULTIPOINT()"), from_wkt("MULTIPOINT(0 0)"), - from_wkt("MULTIPOINT()"), - "pmpdf03"); + from_wkt("MULTIPOINT()") + ); } @@ -192,35 +205,40 @@ BOOST_AUTO_TEST_CASE( test_difference_multipoint_multipoint ) > tester; tester::apply - (from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), + ("mpmpdf01", + from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), from_wkt("MULTIPOINT(1 0,1 1,1 1,4 4)"), from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2)"), - from_wkt("MULTIPOINT(4 4)"), - "mpmpdf01"); + from_wkt("MULTIPOINT(4 4)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + ("mpmpdf02", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), - from_wkt("MULTIPOINT()"), - "mpmpdf02"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT()"), - from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + ("mpmpdf03", from_wkt("MULTIPOINT()"), from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), - "mpmpdf03"); + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), - from_wkt("MULTIPOINT()"), + ("mpmpdf04", from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), from_wkt("MULTIPOINT()"), - "mpmpdf04"); + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT()"), + ("mpmpdf05", from_wkt("MULTIPOINT()"), from_wkt("MULTIPOINT()"), - "mpmpdf05"); + from_wkt("MULTIPOINT()") + ); } diff --git a/test/algorithms/set_operations/intersection/intersection_pl_pl.cpp b/test/algorithms/set_operations/intersection/intersection_pl_pl.cpp index 27b592e7a..ced2245d7 100644 --- a/test/algorithms/set_operations/intersection/intersection_pl_pl.cpp +++ b/test/algorithms/set_operations/intersection/intersection_pl_pl.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014-2015, Oracle and/or its affiliates. // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -20,7 +20,7 @@ #include -#include "../test_set_ops_pl_pl.hpp" +#include "../test_set_ops_pointlike.hpp" #include @@ -51,16 +51,18 @@ BOOST_AUTO_TEST_CASE( test_intersection_point_point ) > tester; tester::apply - (from_wkt

("POINT(0 0)"), + ("ppi01", + from_wkt

("POINT(0 0)"), from_wkt

("POINT(1 1)"), - from_wkt("MULTIPOINT()"), - "ppi01"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt

("POINT(0 0)"), + ("ppi02", from_wkt

("POINT(0 0)"), - from_wkt("MULTIPOINT(0 0)"), - "ppi02"); + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); } @@ -81,52 +83,60 @@ BOOST_AUTO_TEST_CASE( test_intersection_multipoint_point ) > tester; tester::apply - (from_wkt("MULTIPOINT(0 0)"), - from_wkt

("POINT(1 1)"), - from_wkt("MULTIPOINT()"), - "mppi01"); - - tester::apply - (from_wkt("MULTIPOINT(0 0)"), - from_wkt

("POINT(0 0)"), + ("mppi01", from_wkt("MULTIPOINT(0 0)"), - "mppi02"); - - tester::apply - (from_wkt("MULTIPOINT(0 0,0 0)"), from_wkt

("POINT(1 1)"), - from_wkt("MULTIPOINT()"), - "mppi03"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0)"), - from_wkt

("POINT(0 0)"), + ("mppi02", from_wkt("MULTIPOINT(0 0)"), - "mppi04"); + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + ("mppi03", + from_wkt("MULTIPOINT(0 0,0 0)"), from_wkt

("POINT(1 1)"), - from_wkt("MULTIPOINT()"), - "mppi05"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + ("mppi04", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mppi05", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mppi06", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), from_wkt

("POINT(1 0)"), - from_wkt("MULTIPOINT(1 0)"), - "mppi06"); + from_wkt("MULTIPOINT(1 0)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + ("mppi07", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), from_wkt

("POINT(0 0)"), - from_wkt("MULTIPOINT(0 0)"), - "mppi07"); + from_wkt("MULTIPOINT(0 0)") + ); tester::apply - (from_wkt("MULTIPOINT()"), - from_wkt

("POINT(0 0)"), + ("mppi08", from_wkt("MULTIPOINT()"), - "mppi08"); + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT()") + ); } @@ -146,40 +156,46 @@ BOOST_AUTO_TEST_CASE( test_intersection_multipoint_multipoint ) > tester; tester::apply - (from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), + ("mpmpi01", + from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), from_wkt("MULTIPOINT(1 0,1 1,1 1,1 1)"), - from_wkt("MULTIPOINT(1 0,1 1,1 1,1 1)"), - "mpmpi01"); + from_wkt("MULTIPOINT(1 0,1 1,1 1,1 1)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), - from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + ("mpmp02", from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), - "mpmpi02"); + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)") + ); tester::apply - (from_wkt("MULTIPOINT()"), + ("mpmpi03", + from_wkt("MULTIPOINT()"), from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), - from_wkt("MULTIPOINT()"), - "mpmpi03"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + ("mpmpi04", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), from_wkt("MULTIPOINT()"), - from_wkt("MULTIPOINT()"), - "mpmpi04"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT()"), + ("mpmpi05", from_wkt("MULTIPOINT()"), from_wkt("MULTIPOINT()"), - "mpmpi05"); + from_wkt("MULTIPOINT()") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"), + ("mpmpi06", + from_wkt("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"), from_wkt("MULTIPOINT(0 1,0 2,1 0,0 0,2 0)"), - from_wkt("MULTIPOINT(1 0,0 0,2 0)"), - "mpmpi06"); + from_wkt("MULTIPOINT(1 0,0 0,2 0)") + ); } diff --git a/test/algorithms/set_operations/test_set_ops_pl_pl.hpp b/test/algorithms/set_operations/test_set_ops_pointlike.hpp similarity index 58% rename from test/algorithms/set_operations/test_set_ops_pl_pl.hpp rename to test/algorithms/set_operations/test_set_ops_pointlike.hpp index fd825d003..cb14ebe45 100644 --- a/test/algorithms/set_operations/test_set_ops_pl_pl.hpp +++ b/test/algorithms/set_operations/test_set_ops_pointlike.hpp @@ -1,14 +1,14 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014-2015, Oracle and/or its affiliates. // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle -#ifndef BOOST_GEOMETRY_TEST_SET_OPS_PL_PL_HPP -#define BOOST_GEOMETRY_TEST_SET_OPS_PL_PL_HPP +#ifndef BOOST_GEOMETRY_TEST_SET_OPS_POINTLIKE_HPP +#define BOOST_GEOMETRY_TEST_SET_OPS_POINTLIKE_HPP #include @@ -170,6 +170,54 @@ struct set_op }; +template +< + typename Geometry, + typename Tag = typename bg::tag::type +> struct geometry_info +{}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 0; + + static inline char const* name() { return "P"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 0; + + static inline char const* name() { return "MP"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 1; + + static inline char const* name() { return "L"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 1; + + static inline char const* name() { return "ML"; } +}; + +template +struct geometry_info +{ + static std::size_t const topological_dimension = 1; + + static inline char const* name() { return "S"; } +}; + + //================================================================== //================================================================== @@ -188,54 +236,78 @@ template class test_set_op_of_pointlike_geometries { private: - template - static inline void base_test(G1 const& geometry1, - G2 const& geometry2, - MP const& mp_expected, - std::string const& case_id) + template + struct base_test { - MultiPoint mp_output; + template + static inline void apply(std::string const& case_id, + G1 const& geometry1, + G2 const& geometry2, + MP const& mp_expected) + { + MultiPoint mp_output; - set_op::apply(geometry1, geometry2, mp_output); + set_op::apply(geometry1, geometry2, mp_output); - std::string op_name = set_op::name(); + std::string op_name = set_op::name(); - BOOST_CHECK_MESSAGE( equals::apply(mp_expected, mp_output), - op_name << " P/P: " << bg::wkt(geometry1) - << " " << bg::wkt(geometry2) - << " -> Expected: " << bg::wkt(mp_expected) - << " computed: " << bg::wkt(mp_output) ); + BOOST_CHECK_MESSAGE(equals::apply(mp_expected, mp_output), + "case ID: " << case_id << ", " + << op_name << " " + << geometry_info::name() << "/" + << geometry_info::name() << ": " + << bg::wkt(geometry1) + << " " << bg::wkt(geometry2) + << " -> Expected: " << bg::wkt(mp_expected) + << " computed: " << bg::wkt(mp_output) ); - set_operation_output(op_name, case_id, - geometry1, geometry2, mp_output); + set_operation_output(op_name, case_id, + geometry1, geometry2, mp_output); #ifdef BOOST_GEOMETRY_TEST_DEBUG - std::cout << "Geometry #1: " << bg::wkt(geometry1) << std::endl; - std::cout << "Geometry #2: " << bg::wkt(geometry2) << std::endl; - std::cout << "expected " << op_name << " : " - << bg::wkt(mp_expected) << std::endl; - std::cout << op_name << " : " << bg::wkt(mp_output) << std::endl; - std::cout << std::endl; - std::cout << "************************************" << std::endl; - std::cout << std::endl; - std::cout << std::endl; + std::cout << "Geometry #1: " << bg::wkt(geometry1) << std::endl; + std::cout << "Geometry #2: " << bg::wkt(geometry2) << std::endl; + std::cout << "expected " << op_name << " : " + << bg::wkt(mp_expected) << std::endl; + std::cout << op_name << " : " << bg::wkt(mp_output) << std::endl; + std::cout << std::endl; + std::cout << "************************************" << std::endl; + std::cout << std::endl; + std::cout << std::endl; #endif - } + } + }; + template + struct base_test + { + template + static inline void apply(std::string const&, G1 const&, G2 const&, + MP const&) + { + } + }; public: - static inline void apply(Geometry1 const& geometry1, + static inline void apply(std::string const& case_id, + Geometry1 const& geometry1, Geometry2 const& geometry2, MultiPoint const& mp_expected12, - MultiPoint const& mp_expected21, - std::string const& case_id) + MultiPoint const& mp_expected21) { #ifdef BOOST_GEOMETRY_TEST_DEBUG std::cout << "test case: " << case_id << std::endl; #endif - base_test(geometry1, geometry2, mp_expected12, case_id); - base_test(geometry2, geometry1, mp_expected21, case_id); + base_test::apply(case_id, geometry1, geometry2, mp_expected12); + // try the same set operation with the arguments' order + // reversed only if the two geometries are of the same + // topological dimension + base_test + < + (geometry_info::topological_dimension + == geometry_info::topological_dimension) + >::apply(case_id, geometry2, geometry1, mp_expected21); #ifdef BOOST_GEOMETRY_TEST_DEBUG std::cout << std::endl; @@ -243,15 +315,14 @@ public: #endif } - - static inline void apply(Geometry1 const& geometry1, + static inline void apply(std::string const& case_id, + Geometry1 const& geometry1, Geometry2 const& geometry2, - MultiPoint const& mp_expected, - std::string const& case_id) + MultiPoint const& mp_expected) { - apply(geometry1, geometry2, mp_expected, mp_expected, case_id); + apply(case_id, geometry1, geometry2, mp_expected, mp_expected); } }; -#endif // BOOST_GEOMETRY_TEST_SET_OPS_PL_PL_HPP +#endif // BOOST_GEOMETRY_TEST_SET_OPS_POINTLIKE_HPP diff --git a/test/algorithms/set_operations/union/union_pl_pl.cpp b/test/algorithms/set_operations/union/union_pl_pl.cpp index 05be9f1f6..f1eb2d976 100644 --- a/test/algorithms/set_operations/union/union_pl_pl.cpp +++ b/test/algorithms/set_operations/union/union_pl_pl.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014-2015, Oracle and/or its affiliates. // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -20,7 +20,7 @@ #include -#include "../test_set_ops_pl_pl.hpp" +#include "../test_set_ops_pointlike.hpp" #include @@ -51,16 +51,18 @@ BOOST_AUTO_TEST_CASE( test_union_point_point ) > tester; tester::apply - (from_wkt

("POINT(0 0)"), + ("ppu01", + from_wkt

("POINT(0 0)"), from_wkt

("POINT(1 1)"), - from_wkt("MULTIPOINT(0 0,1 1)"), - "ppu01"); + from_wkt("MULTIPOINT(0 0,1 1)") + ); tester::apply - (from_wkt

("POINT(0 0)"), + ("ppu02", from_wkt

("POINT(0 0)"), - from_wkt("MULTIPOINT(0 0)"), - "ppu02"); + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); } @@ -81,52 +83,60 @@ BOOST_AUTO_TEST_CASE( test_union_multipoint_point ) > tester; tester::apply - (from_wkt("MULTIPOINT(0 0)"), - from_wkt

("POINT(1 1)"), - from_wkt("MULTIPOINT(0 0,1 1)"), - "mppu01"); - - tester::apply - (from_wkt("MULTIPOINT(0 0)"), - from_wkt

("POINT(0 0)"), + ("mppu01", from_wkt("MULTIPOINT(0 0)"), - "mppu02"); - - tester::apply - (from_wkt("MULTIPOINT(0 0,0 0)"), from_wkt

("POINT(1 1)"), - from_wkt("MULTIPOINT(0 0,0 0,1 1)"), - "mppu03"); + from_wkt("MULTIPOINT(0 0,1 1)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0)"), - from_wkt

("POINT(0 0)"), + ("mppu02", from_wkt("MULTIPOINT(0 0)"), - "mppu04"); + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + ("mppu03", + from_wkt("MULTIPOINT(0 0,0 0)"), from_wkt

("POINT(1 1)"), - from_wkt("MULTIPOINT(0 0,0 0,1 0,1 1)"), - "mppu05"); + from_wkt("MULTIPOINT(0 0,0 0,1 1)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0,1 0)"), - from_wkt

("POINT(1 0)"), + ("mppu04", + from_wkt("MULTIPOINT(0 0,0 0)"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); + + tester::apply + ("mppu05", from_wkt("MULTIPOINT(0 0,0 0,1 0)"), - "mppu06"); + from_wkt

("POINT(1 1)"), + from_wkt("MULTIPOINT(0 0,0 0,1 0,1 1)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,0 0,1 0)"), - from_wkt

("POINT(0 0)"), - from_wkt("MULTIPOINT(0 0,1 0)"), - "mppu07"); + ("mppu06", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), + from_wkt

("POINT(1 0)"), + from_wkt("MULTIPOINT(0 0,0 0,1 0)") + ); tester::apply - (from_wkt("MULTIPOINT()"), + ("mppu07", + from_wkt("MULTIPOINT(0 0,0 0,1 0)"), from_wkt

("POINT(0 0)"), - from_wkt("MULTIPOINT(0 0)"), - "mppu08"); + from_wkt("MULTIPOINT(0 0,1 0)") + ); + + tester::apply + ("mppu08", + from_wkt("MULTIPOINT()"), + from_wkt

("POINT(0 0)"), + from_wkt("MULTIPOINT(0 0)") + ); } @@ -146,42 +156,47 @@ BOOST_AUTO_TEST_CASE( test_union_multipoint_multipoint ) > tester; tester::apply - (from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), + ("mpmpu01", + from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), from_wkt("MULTIPOINT(1 0,1 1,1 1,1 1)"), from_wkt("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"), - from_wkt("MULTIPOINT(1 0,1 1,1 1,1 1,2 2,3 3,0 0,0 0,2 2)"), - "mpmpu01"); + from_wkt("MULTIPOINT(1 0,1 1,1 1,1 1,2 2,3 3,0 0,0 0,2 2)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), - from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + ("mpmpu02", from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), - "mpmpu02"); - - tester::apply - (from_wkt("MULTIPOINT()"), - from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), - from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), - "mpmpu03"); - - tester::apply - (from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), - from_wkt("MULTIPOINT()"), from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), - "mpmpu04"); + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)") + ); tester::apply - (from_wkt("MULTIPOINT()"), + ("mpmpu03", from_wkt("MULTIPOINT()"), - from_wkt("MULTIPOINT()"), - "mpmpu05"); + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)"), + from_wkt("MULTIPOINT(1 0,0 0,1 1,0 0)") + ); tester::apply - (from_wkt("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"), + ("mpmpu04", + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT(0 0,1 1,1 0,1 1)") + ); + + tester::apply + ("mpmpu05", + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT()"), + from_wkt("MULTIPOINT()") + ); + + tester::apply + ("mpmpu06", + from_wkt("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0)"), from_wkt("MULTIPOINT(0 1,0 2,1 0,0 0,2 0)"), from_wkt("MULTIPOINT(0 0,1 0,2 0,3 0,0 0,1 0,2 0,0 1,0 2)"), - from_wkt("MULTIPOINT(0 1,0 2,1 0,0 0,2 0,3 0)"), - "mpmpu06"); + from_wkt("MULTIPOINT(0 1,0 2,1 0,0 0,2 0,3 0)") + ); } - From 8e36f8f8733841a2ac1fdf7cf48603011b6315c2 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 00:20:51 +0200 Subject: [PATCH 04/32] [algorithms] remove deprecated includes referring to the include/boost/geometry/multi/ directory --- include/boost/geometry/algorithms/centroid.hpp | 9 ++++----- .../geometry/algorithms/detail/buffer/buffered_ring.hpp | 6 +++--- .../geometry/algorithms/detail/intersection/multi.hpp | 6 ++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/include/boost/geometry/algorithms/centroid.hpp b/include/boost/geometry/algorithms/centroid.hpp index 67ed68ac0..c4d995d78 100644 --- a/include/boost/geometry/algorithms/centroid.hpp +++ b/include/boost/geometry/algorithms/centroid.hpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. -// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2014-2015 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2014, 2015. // Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. @@ -56,7 +56,6 @@ #include #include -#include #include diff --git a/include/boost/geometry/algorithms/detail/buffer/buffered_ring.hpp b/include/boost/geometry/algorithms/detail/buffer/buffered_ring.hpp index 9ea8bc1e8..0889663a2 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_ring.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_ring.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -19,6 +19,8 @@ #include +#include + #include #include #include @@ -26,8 +28,6 @@ #include #include -#include - namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/intersection/multi.hpp b/include/boost/geometry/algorithms/detail/intersection/multi.hpp index b1f13862f..88b49b016 100644 --- a/include/boost/geometry/algorithms/detail/intersection/multi.hpp +++ b/include/boost/geometry/algorithms/detail/intersection/multi.hpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014, Oracle and/or its affiliates. +// Modifications copyright (c) 2014-2015, Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -36,8 +36,6 @@ #include #include -// TODO: remove this after moving num_point from multi directory -#include namespace boost { namespace geometry { From cdb25bc74184ccd9716fc61aebcd1984ba8b999e Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 00:22:27 +0200 Subject: [PATCH 05/32] [io][svg_mapper] remove deprecated includes referring to the include/boost/geometry/multi/ directory --- include/boost/geometry/io/svg/svg_mapper.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/boost/geometry/io/svg/svg_mapper.hpp b/include/boost/geometry/io/svg/svg_mapper.hpp index b53fef2ce..9982d0f7e 100644 --- a/include/boost/geometry/io/svg/svg_mapper.hpp +++ b/include/boost/geometry/io/svg/svg_mapper.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2009-2015 Barend Gehrels, Amsterdam, the Netherlands. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -37,9 +37,6 @@ #include #include -#include -#include - #include // Helper geometries (all points are transformed to integer-points) From 35a85e671be926485356aed864474bf0ae104d86 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 00:23:07 +0200 Subject: [PATCH 06/32] [geometry] remove deprecated include referring to the include/boost/geometry/multi/ directory --- include/boost/geometry/geometry.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/boost/geometry/geometry.hpp b/include/boost/geometry/geometry.hpp index 8d34a0e4e..7d3a99519 100644 --- a/include/boost/geometry/geometry.hpp +++ b/include/boost/geometry/geometry.hpp @@ -90,10 +90,6 @@ #include #include -// Include multi a.o. because it can give weird effects -// if you don't (e.g. area=0 of a multipolygon) -#include - // check includes all concepts #include From 29c460b5468b1bf2ea23cc6a12303857eb571288 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 02:10:14 +0200 Subject: [PATCH 07/32] [test][algorithms] remove deprecated includes referring to the include/boost/geometry/multi/ directory; polish and simplify some includes; --- test/algorithms/append.cpp | 21 +++++------- test/algorithms/buffer/country_buffer.cpp | 4 +-- .../buffer/multi_linestring_buffer.cpp | 4 +-- test/algorithms/buffer/multi_point_buffer.cpp | 2 -- .../buffer/multi_polygon_buffer.cpp | 4 +-- test/algorithms/detail/partition.cpp | 5 ++- test/algorithms/distance/distance.cpp | 12 ++----- .../distance/test_distance_se_common.hpp | 11 +++---- test/algorithms/multi_area.cpp | 7 ++-- test/algorithms/multi_centroid.cpp | 16 +++------- test/algorithms/multi_clear.cpp | 8 +---- test/algorithms/multi_convert.cpp | 12 +------ test/algorithms/multi_convex_hull.cpp | 30 +++++++---------- test/algorithms/multi_correct.cpp | 7 ++-- test/algorithms/multi_envelope.cpp | 14 ++------ test/algorithms/multi_for_each.cpp | 10 +++--- test/algorithms/multi_length.cpp | 9 +----- test/algorithms/multi_num_geometries.cpp | 7 +--- test/algorithms/multi_num_interior_rings.cpp | 7 +--- test/algorithms/multi_num_points.cpp | 10 +++--- test/algorithms/multi_perimeter.cpp | 6 ++-- test/algorithms/multi_reverse.cpp | 8 +---- test/algorithms/multi_simplify.cpp | 13 +++----- test/algorithms/multi_transform.cpp | 13 ++------ test/algorithms/multi_unique.cpp | 10 +----- test/algorithms/num_points.cpp | 11 +++---- test/algorithms/overlay/dissolver.cpp | 7 ++-- .../overlay/multi_overlay_common.hpp | 12 +++---- test/algorithms/overlay/multi_traverse.cpp | 32 +++++++------------ test/algorithms/overlay/traverse.cpp | 5 ++- test/algorithms/point_on_surface.cpp | 18 ++++------- .../disjoint/disjoint_coverage.cpp | 18 ++--------- .../disjoint/multi_disjoint.cpp | 13 +------- .../disjoint/test_disjoint.hpp | 9 +++--- .../multi_covered_by.cpp | 9 ++---- .../relational_operations/multi_equals.cpp | 9 ++---- .../multi_intersects.cpp | 3 +- .../relational_operations/multi_touches.cpp | 23 +++---------- .../relational_operations/test_covered_by.hpp | 9 ++---- .../relational_operations/test_intersects.hpp | 23 +++++-------- test/algorithms/remove_spikes.cpp | 17 +++------- .../set_operations/difference/difference.cpp | 10 +++--- .../difference/difference_linear_linear.cpp | 2 +- .../difference/multi_difference.cpp | 16 +++++----- .../difference/multi_difference_spike.cpp | 3 +- .../difference/test_difference.hpp | 8 ++--- .../intersection_linear_linear.cpp | 2 +- .../intersection/multi_intersection.cpp | 16 +++++----- .../intersection/test_intersection.hpp | 2 +- .../test_intersection_linear_linear.hpp | 1 - .../sym_difference_linear_linear.cpp | 2 +- .../test_set_ops_linear_linear.hpp | 1 - .../set_operations/union/multi_union.cpp | 14 ++++---- .../union/union_linear_linear.cpp | 4 +-- test/algorithms/test_convex_hull.hpp | 5 ++- test/algorithms/test_length.hpp | 2 +- 56 files changed, 177 insertions(+), 379 deletions(-) diff --git a/test/algorithms/append.cpp b/test/algorithms/append.cpp index 2a3d01a86..0eda9669c 100644 --- a/test/algorithms/append.cpp +++ b/test/algorithms/append.cpp @@ -1,12 +1,12 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014, Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015, Oracle and/or its affiliates. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle @@ -24,25 +24,20 @@ #include #include +#include +#include #include #include #include #include #include +#include #include #include #include #include -// includes for multi-geometries -#include -#include -#include -#include -#include -#include -#include BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::vector) BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(std::deque) diff --git a/test/algorithms/buffer/country_buffer.cpp b/test/algorithms/buffer/country_buffer.cpp index 66e985728..6cde8171b 100644 --- a/test/algorithms/buffer/country_buffer.cpp +++ b/test/algorithms/buffer/country_buffer.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2014-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -9,8 +9,6 @@ #include -#include - template std::string read_from_file(std::string const& filename) diff --git a/test/algorithms/buffer/multi_linestring_buffer.cpp b/test/algorithms/buffer/multi_linestring_buffer.cpp index 24aca1a67..0f125f064 100644 --- a/test/algorithms/buffer/multi_linestring_buffer.cpp +++ b/test/algorithms/buffer/multi_linestring_buffer.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -9,8 +9,6 @@ #include -#include - static std::string const simplex = "MULTILINESTRING((0 0,4 5),(5 4,10 0))"; static std::string const two_bends = "MULTILINESTRING((0 0,4 5,7 4,10 6),(1 5,5 9,8 6))"; static std::string const turn_inside = "MULTILINESTRING((0 0,4 5,7 4,10 6),(1 5,5 9,8 6),(0 4,-2 6))"; diff --git a/test/algorithms/buffer/multi_point_buffer.cpp b/test/algorithms/buffer/multi_point_buffer.cpp index 5c4cbd6a7..d5fcf0583 100644 --- a/test/algorithms/buffer/multi_point_buffer.cpp +++ b/test/algorithms/buffer/multi_point_buffer.cpp @@ -9,8 +9,6 @@ #include -#include - static std::string const simplex = "MULTIPOINT((5 5),(7 7))"; static std::string const three = "MULTIPOINT((5 8),(9 8),(7 11))"; diff --git a/test/algorithms/buffer/multi_polygon_buffer.cpp b/test/algorithms/buffer/multi_polygon_buffer.cpp index 4b526a8e6..eef6d5155 100644 --- a/test/algorithms/buffer/multi_polygon_buffer.cpp +++ b/test/algorithms/buffer/multi_polygon_buffer.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -9,8 +9,6 @@ #include -#include - static std::string const simplex = "MULTIPOLYGON(((0 1,2 5,5 3,0 1)),((1 1,5 2,5 0,1 1)))"; diff --git a/test/algorithms/detail/partition.cpp b/test/algorithms/detail/partition.cpp index e55c87307..bf50b880f 100644 --- a/test/algorithms/detail/partition.cpp +++ b/test/algorithms/detail/partition.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -11,14 +11,13 @@ #include -#include +#include #include #include #include #include -#include #if defined(TEST_WITH_SVG) # include diff --git a/test/algorithms/distance/distance.cpp b/test/algorithms/distance/distance.cpp index 84e066808..2f9c74c39 100644 --- a/test/algorithms/distance/distance.cpp +++ b/test/algorithms/distance/distance.cpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -30,12 +30,6 @@ #include #include -// includes for multi-geometries -#include -#include -#include -#include - #include BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(cs::cartesian) diff --git a/test/algorithms/distance/test_distance_se_common.hpp b/test/algorithms/distance/test_distance_se_common.hpp index 5e846346d..5d514c826 100644 --- a/test/algorithms/distance/test_distance_se_common.hpp +++ b/test/algorithms/distance/test_distance_se_common.hpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014-2015, Oracle and/or its affiliates. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle @@ -25,15 +25,12 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include -#include - #include -#include #include #include diff --git a/test/algorithms/multi_area.cpp b/test/algorithms/multi_area.cpp index 3dbc658e1..fdb9ea6d7 100644 --- a/test/algorithms/multi_area.cpp +++ b/test/algorithms/multi_area.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,14 +8,11 @@ #include -#include - #include #include -#include +#include #include -#include diff --git a/test/algorithms/multi_centroid.cpp b/test/algorithms/multi_centroid.cpp index 03cb8ecde..c98b3f164 100644 --- a/test/algorithms/multi_centroid.cpp +++ b/test/algorithms/multi_centroid.cpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -17,18 +17,12 @@ #include -#include -#include -#include +#include +#include #include #include -#include -#include -#include -#include - // #define REPORT_RESULTS diff --git a/test/algorithms/multi_clear.cpp b/test/algorithms/multi_clear.cpp index 39d777930..44f4716e0 100644 --- a/test/algorithms/multi_clear.cpp +++ b/test/algorithms/multi_clear.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -9,17 +9,11 @@ #include #include -#include -#include #include -#include #include #include -#include -#include -#include #include diff --git a/test/algorithms/multi_convert.cpp b/test/algorithms/multi_convert.cpp index 0bfdf6ea6..ad24d3d7a 100644 --- a/test/algorithms/multi_convert.cpp +++ b/test/algorithms/multi_convert.cpp @@ -1,22 +1,12 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include - -#include -#include -#include - -#include -#include - template void test_mixed_point_types() diff --git a/test/algorithms/multi_convex_hull.cpp b/test/algorithms/multi_convex_hull.cpp index ef493e8f5..eaf0ddc8d 100644 --- a/test/algorithms/multi_convex_hull.cpp +++ b/test/algorithms/multi_convex_hull.cpp @@ -1,12 +1,12 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -26,22 +26,16 @@ #include #include -#include +#include +#include -#include -#include +#include -#include +#include -#include -#include - -#include -#include - -#include -#include -#include +#include +#include +#include diff --git a/test/algorithms/multi_correct.cpp b/test/algorithms/multi_correct.cpp index 7359d3f76..be61640cd 100644 --- a/test/algorithms/multi_correct.cpp +++ b/test/algorithms/multi_correct.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -11,10 +11,7 @@ #include -#include - #include -#include #include #include @@ -22,7 +19,7 @@ #include #include #include -#include +#include template diff --git a/test/algorithms/multi_envelope.cpp b/test/algorithms/multi_envelope.cpp index bafa5dc25..5ebbc6eee 100644 --- a/test/algorithms/multi_envelope.cpp +++ b/test/algorithms/multi_envelope.cpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -15,14 +15,6 @@ #include - -#include -#include -#include -#include - -#include - #include #include #include diff --git a/test/algorithms/multi_for_each.cpp b/test/algorithms/multi_for_each.cpp index 70165a44f..e9c02b685 100644 --- a/test/algorithms/multi_for_each.cpp +++ b/test/algorithms/multi_for_each.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,10 +8,8 @@ #include #include -#include #include -#include #include #include @@ -20,9 +18,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/test/algorithms/multi_length.cpp b/test/algorithms/multi_length.cpp index 5d94be158..3738665f1 100644 --- a/test/algorithms/multi_length.cpp +++ b/test/algorithms/multi_length.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,15 +8,8 @@ #include -#include - #include #include -#include - -#include -#include - template diff --git a/test/algorithms/multi_num_geometries.cpp b/test/algorithms/multi_num_geometries.cpp index bf7a3cee4..292e06ea9 100644 --- a/test/algorithms/multi_num_geometries.cpp +++ b/test/algorithms/multi_num_geometries.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,16 +8,11 @@ #include #include -#include #include -#include #include #include -#include -#include -#include template void test_geometry(std::string const& wkt, int expected) diff --git a/test/algorithms/multi_num_interior_rings.cpp b/test/algorithms/multi_num_interior_rings.cpp index 73fcdc114..2f9991fe9 100644 --- a/test/algorithms/multi_num_interior_rings.cpp +++ b/test/algorithms/multi_num_interior_rings.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,16 +8,11 @@ #include #include -#include #include -#include #include #include -#include -#include -#include template void test_geometry(std::string const& wkt, int expected) diff --git a/test/algorithms/multi_num_points.cpp b/test/algorithms/multi_num_points.cpp index d43b71d47..68b814e32 100644 --- a/test/algorithms/multi_num_points.cpp +++ b/test/algorithms/multi_num_points.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2011-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,16 +8,14 @@ #include #include -#include #include -#include #include #include -#include -#include -#include +#include +#include +#include #include diff --git a/test/algorithms/multi_perimeter.cpp b/test/algorithms/multi_perimeter.cpp index 8268fed62..3ddd8395c 100644 --- a/test/algorithms/multi_perimeter.cpp +++ b/test/algorithms/multi_perimeter.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,14 +8,12 @@ #include #include -#include #include -#include #include #include -#include +#include #include diff --git a/test/algorithms/multi_reverse.cpp b/test/algorithms/multi_reverse.cpp index 78334928d..f3a7f574d 100644 --- a/test/algorithms/multi_reverse.cpp +++ b/test/algorithms/multi_reverse.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,18 +8,12 @@ #include #include -#include #include -#include #include #include -#include -#include -#include - #include diff --git a/test/algorithms/multi_simplify.cpp b/test/algorithms/multi_simplify.cpp index 8b9d92265..f142f91d8 100644 --- a/test/algorithms/multi_simplify.cpp +++ b/test/algorithms/multi_simplify.cpp @@ -1,17 +1,12 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include -#include - -#include -#include - #include #include #include @@ -20,9 +15,9 @@ #include -#include -#include -#include +#include +#include +#include #include diff --git a/test/algorithms/multi_transform.cpp b/test/algorithms/multi_transform.cpp index 9c0002583..66cb8ba6e 100644 --- a/test/algorithms/multi_transform.cpp +++ b/test/algorithms/multi_transform.cpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -22,14 +22,7 @@ #include #include -#include - -#include -#include -#include - #include -#include // This test is a little different from transform.cpp test. diff --git a/test/algorithms/multi_unique.cpp b/test/algorithms/multi_unique.cpp index 397e46265..9061d7ef3 100644 --- a/test/algorithms/multi_unique.cpp +++ b/test/algorithms/multi_unique.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,18 +8,10 @@ #include #include -#include - -#include -#include #include #include -#include -#include -#include - #include diff --git a/test/algorithms/num_points.cpp b/test/algorithms/num_points.cpp index 1c266d8af..6d24f43f0 100644 --- a/test/algorithms/num_points.cpp +++ b/test/algorithms/num_points.cpp @@ -1,10 +1,10 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. -// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -15,12 +15,9 @@ #include #include -#include #include -#include #include -#include template struct box_dD diff --git a/test/algorithms/overlay/dissolver.cpp b/test/algorithms/overlay/dissolver.cpp index 28bd3e560..c928fa7b3 100644 --- a/test/algorithms/overlay/dissolver.cpp +++ b/test/algorithms/overlay/dissolver.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -17,9 +17,8 @@ #include #include -#include -#include -#include +#include +#include #include diff --git a/test/algorithms/overlay/multi_overlay_common.hpp b/test/algorithms/overlay/multi_overlay_common.hpp index 6a49c300d..4b98944da 100644 --- a/test/algorithms/overlay/multi_overlay_common.hpp +++ b/test/algorithms/overlay/multi_overlay_common.hpp @@ -1,8 +1,8 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -12,11 +12,11 @@ #define GEOMETRY_TEST_MULTI_OVERLAY_COMMON_HPP -#include -#include +#include +#include -#include -//#include +#include +//#include diff --git a/test/algorithms/overlay/multi_traverse.cpp b/test/algorithms/overlay/multi_traverse.cpp index 7cab06c96..d600ce9cb 100644 --- a/test/algorithms/overlay/multi_traverse.cpp +++ b/test/algorithms/overlay/multi_traverse.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -15,27 +15,19 @@ #define BOOST_GEOMETRY_TEST_MULTI #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -#include +#include #include "multi_overlay_cases.hpp" diff --git a/test/algorithms/overlay/traverse.cpp b/test/algorithms/overlay/traverse.cpp index 0ae6bfd0a..4589fdc2e 100644 --- a/test/algorithms/overlay/traverse.cpp +++ b/test/algorithms/overlay/traverse.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -57,8 +57,7 @@ #include -#include -#include +#include #if defined(TEST_WITH_SVG) diff --git a/test/algorithms/point_on_surface.cpp b/test/algorithms/point_on_surface.cpp index 00b6f1236..0a89d960d 100644 --- a/test/algorithms/point_on_surface.cpp +++ b/test/algorithms/point_on_surface.cpp @@ -1,13 +1,13 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2013 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2013 Mateusz Loskot, London, UK. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -43,11 +43,7 @@ #include #if defined(BOOST_GEOMETRY_UNIT_TEST_MULTI) -# include -# include -# include -# include -# include +# include #endif diff --git a/test/algorithms/relational_operations/disjoint/disjoint_coverage.cpp b/test/algorithms/relational_operations/disjoint/disjoint_coverage.cpp index 4708fd6db..f2d6d3ee0 100644 --- a/test/algorithms/relational_operations/disjoint/disjoint_coverage.cpp +++ b/test/algorithms/relational_operations/disjoint/disjoint_coverage.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014-2015, Oracle and/or its affiliates. // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -19,25 +19,13 @@ #include #include -#include #include -#include -#include -#include -#include +#include #include -#include -#include -#include -#include -#include - -#include -#include -#include +#include #include diff --git a/test/algorithms/relational_operations/disjoint/multi_disjoint.cpp b/test/algorithms/relational_operations/disjoint/multi_disjoint.cpp index 330a66e52..8bc8a6b55 100644 --- a/test/algorithms/relational_operations/disjoint/multi_disjoint.cpp +++ b/test/algorithms/relational_operations/disjoint/multi_disjoint.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -12,17 +12,6 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - #include #include diff --git a/test/algorithms/relational_operations/disjoint/test_disjoint.hpp b/test/algorithms/relational_operations/disjoint/test_disjoint.hpp index 55a22e9bd..9e4902421 100644 --- a/test/algorithms/relational_operations/disjoint/test_disjoint.hpp +++ b/test/algorithms/relational_operations/disjoint/test_disjoint.hpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -22,8 +22,7 @@ #include #include -#include -#include +#include template diff --git a/test/algorithms/relational_operations/multi_covered_by.cpp b/test/algorithms/relational_operations/multi_covered_by.cpp index 7489435b4..720e72716 100644 --- a/test/algorithms/relational_operations/multi_covered_by.cpp +++ b/test/algorithms/relational_operations/multi_covered_by.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -11,16 +11,13 @@ #include #include -#include -#include -#include +#include #include -#include +#include #include -#include #include "test_covered_by.hpp" diff --git a/test/algorithms/relational_operations/multi_equals.cpp b/test/algorithms/relational_operations/multi_equals.cpp index d1239d38f..6984f29e5 100644 --- a/test/algorithms/relational_operations/multi_equals.cpp +++ b/test/algorithms/relational_operations/multi_equals.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,15 +8,10 @@ #include "test_equals.hpp" -#include -#include +#include #include #include -#include - -#include - template diff --git a/test/algorithms/relational_operations/multi_intersects.cpp b/test/algorithms/relational_operations/multi_intersects.cpp index 1880064f8..6ed8b358f 100644 --- a/test/algorithms/relational_operations/multi_intersects.cpp +++ b/test/algorithms/relational_operations/multi_intersects.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -19,7 +19,6 @@ #include #include -#include template void test_all() diff --git a/test/algorithms/relational_operations/multi_touches.cpp b/test/algorithms/relational_operations/multi_touches.cpp index 86456b04a..65de6b52c 100644 --- a/test/algorithms/relational_operations/multi_touches.cpp +++ b/test/algorithms/relational_operations/multi_touches.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,24 +8,9 @@ #include "test_touches.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - +#include +#include +#include template diff --git a/test/algorithms/relational_operations/test_covered_by.hpp b/test/algorithms/relational_operations/test_covered_by.hpp index b9d8f5853..5403e8edb 100644 --- a/test/algorithms/relational_operations/test_covered_by.hpp +++ b/test/algorithms/relational_operations/test_covered_by.hpp @@ -1,8 +1,8 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -22,13 +22,10 @@ #include #include #include +#include #include -#include -#include -#include - template void check_geometry(Geometry1 const& geometry1, Geometry2 const& geometry2, diff --git a/test/algorithms/relational_operations/test_intersects.hpp b/test/algorithms/relational_operations/test_intersects.hpp index 7a8af7161..9c4c7914b 100644 --- a/test/algorithms/relational_operations/test_intersects.hpp +++ b/test/algorithms/relational_operations/test_intersects.hpp @@ -1,8 +1,8 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -14,27 +14,20 @@ #include + +#include +#include #include +#include #include #include #include #include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - template void test_geometry(std::string const& wkt1, std::string const& wkt2, bool expected) diff --git a/test/algorithms/remove_spikes.cpp b/test/algorithms/remove_spikes.cpp index 8f7fd75bb..f4e252103 100644 --- a/test/algorithms/remove_spikes.cpp +++ b/test/algorithms/remove_spikes.cpp @@ -1,10 +1,10 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2013 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2013 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2013 Mateusz Loskot, London, UK. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -36,14 +36,7 @@ #include #if defined(BOOST_GEOMETRY_UNIT_TEST_MULTI) - -# include - -# include -# include -# include -# include -# include +# include #endif diff --git a/test/algorithms/set_operations/difference/difference.cpp b/test/algorithms/set_operations/difference/difference.cpp index c1da88ad8..2f1f8355b 100644 --- a/test/algorithms/set_operations/difference/difference.cpp +++ b/test/algorithms/set_operations/difference/difference.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -16,12 +16,11 @@ // #define BOOST_GEOMETRY_NO_ROBUSTNESS #include +#include #include +#include -#include -#include -#include -#include +#include #include @@ -29,7 +28,6 @@ #include #include #include -#include #ifdef HAVE_TTMATH diff --git a/test/algorithms/set_operations/difference/difference_linear_linear.cpp b/test/algorithms/set_operations/difference/difference_linear_linear.cpp index b1ae1a21b..cd4be8c00 100644 --- a/test/algorithms/set_operations/difference/difference_linear_linear.cpp +++ b/test/algorithms/set_operations/difference/difference_linear_linear.cpp @@ -23,7 +23,7 @@ #include "test_difference_linear_linear.hpp" #include -#include +#include #include typedef bg::model::point point_type; diff --git a/test/algorithms/set_operations/difference/multi_difference.cpp b/test/algorithms/set_operations/difference/multi_difference.cpp index f9e0c3d4d..3d088aae6 100644 --- a/test/algorithms/set_operations/difference/multi_difference.cpp +++ b/test/algorithms/set_operations/difference/multi_difference.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -27,16 +27,16 @@ #include #include -#include -#include -#include // only for testing #77 +#include +#include +#include // only for testing #77 #include -#include -#include -#include +#include +#include +#include -#include +#include template void test_areal() diff --git a/test/algorithms/set_operations/difference/multi_difference_spike.cpp b/test/algorithms/set_operations/difference/multi_difference_spike.cpp index 56a909262..f1141ca6c 100644 --- a/test/algorithms/set_operations/difference/multi_difference_spike.cpp +++ b/test/algorithms/set_operations/difference/multi_difference_spike.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -11,7 +11,6 @@ #include #include #include -#include #include "test_difference.hpp" diff --git a/test/algorithms/set_operations/difference/test_difference.hpp b/test/algorithms/set_operations/difference/test_difference.hpp index e3cda5d95..65b97dea0 100644 --- a/test/algorithms/set_operations/difference/test_difference.hpp +++ b/test/algorithms/set_operations/difference/test_difference.hpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -30,9 +30,9 @@ #include -#include -#include -#include +#include +#include +#include #include diff --git a/test/algorithms/set_operations/intersection/intersection_linear_linear.cpp b/test/algorithms/set_operations/intersection/intersection_linear_linear.cpp index 0102edc5c..5224f10f4 100644 --- a/test/algorithms/set_operations/intersection/intersection_linear_linear.cpp +++ b/test/algorithms/set_operations/intersection/intersection_linear_linear.cpp @@ -23,7 +23,7 @@ #include "test_intersection_linear_linear.hpp" #include -#include +#include #include typedef bg::model::point point_type; diff --git a/test/algorithms/set_operations/intersection/multi_intersection.cpp b/test/algorithms/set_operations/intersection/multi_intersection.cpp index 46106022d..2399935cb 100644 --- a/test/algorithms/set_operations/intersection/multi_intersection.cpp +++ b/test/algorithms/set_operations/intersection/multi_intersection.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -20,16 +20,16 @@ #include #include -#include -#include -#include // only for testing #77 +#include +#include +#include // only for testing #77 #include -#include -#include -#include +#include +#include +#include -#include +#include template void test_areal() diff --git a/test/algorithms/set_operations/intersection/test_intersection.hpp b/test/algorithms/set_operations/intersection/test_intersection.hpp index 4a7cc645c..140250e13 100644 --- a/test/algorithms/set_operations/intersection/test_intersection.hpp +++ b/test/algorithms/set_operations/intersection/test_intersection.hpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) diff --git a/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp b/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp index 8e9254040..07105aa8b 100644 --- a/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp +++ b/test/algorithms/set_operations/intersection/test_intersection_linear_linear.hpp @@ -12,7 +12,6 @@ #include -#include #include #include "../test_set_ops_linear_linear.hpp" #include diff --git a/test/algorithms/set_operations/sym_difference/sym_difference_linear_linear.cpp b/test/algorithms/set_operations/sym_difference/sym_difference_linear_linear.cpp index bcd0398ad..5741b1303 100644 --- a/test/algorithms/set_operations/sym_difference/sym_difference_linear_linear.cpp +++ b/test/algorithms/set_operations/sym_difference/sym_difference_linear_linear.cpp @@ -23,7 +23,7 @@ #include "test_sym_difference_linear_linear.hpp" #include -#include +#include #include typedef bg::model::point point_type; diff --git a/test/algorithms/set_operations/test_set_ops_linear_linear.hpp b/test/algorithms/set_operations/test_set_ops_linear_linear.hpp index 884b5028a..b69e78b67 100644 --- a/test/algorithms/set_operations/test_set_ops_linear_linear.hpp +++ b/test/algorithms/set_operations/test_set_ops_linear_linear.hpp @@ -21,7 +21,6 @@ #include #include #include -#include #include "test_get_turns_ll_invariance.hpp" diff --git a/test/algorithms/set_operations/union/multi_union.cpp b/test/algorithms/set_operations/union/multi_union.cpp index 74c9d060d..ac542220d 100644 --- a/test/algorithms/set_operations/union/multi_union.cpp +++ b/test/algorithms/set_operations/union/multi_union.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2010-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -18,15 +18,15 @@ #include #include -#include -#include -#include +#include +#include +#include #include -#include -#include +#include +#include -#include +#include template diff --git a/test/algorithms/set_operations/union/union_linear_linear.cpp b/test/algorithms/set_operations/union/union_linear_linear.cpp index 925c8363b..4ef79e6cc 100644 --- a/test/algorithms/set_operations/union/union_linear_linear.cpp +++ b/test/algorithms/set_operations/union/union_linear_linear.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014-2015, Oracle and/or its affiliates. // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html @@ -23,7 +23,7 @@ #include "test_union_linear_linear.hpp" #include -#include +#include #include typedef bg::model::point point_type; diff --git a/test/algorithms/test_convex_hull.hpp b/test/algorithms/test_convex_hull.hpp index 1570dec2a..5e48d1e60 100644 --- a/test/algorithms/test_convex_hull.hpp +++ b/test/algorithms/test_convex_hull.hpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // This file was modified by Oracle on 2014, 2015. // Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. @@ -26,8 +26,7 @@ #include -#include -#include +#include #include diff --git a/test/algorithms/test_length.hpp b/test/algorithms/test_length.hpp index 9543a3035..107bdae21 100644 --- a/test/algorithms/test_length.hpp +++ b/test/algorithms/test_length.hpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include From 6f0b6a19e21a9d970662b9aca3543d34cfc8c925 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 02:11:28 +0200 Subject: [PATCH 08/32] [test][geometries] remove deprecated includes referring to the include/boost/geometry/multi/ directory --- test/geometries/adapted.cpp | 7 +++---- test/geometries/geometries.cpp | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/geometries/adapted.cpp b/test/geometries/adapted.cpp index fd3bb6419..4dd8c8923 100644 --- a/test/geometries/adapted.cpp +++ b/test/geometries/adapted.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -14,7 +14,6 @@ #include #include -#include #include #include @@ -35,8 +34,8 @@ #elif defined(BOOST_GEOMETRY_TEST_MULTI_POINT) - #include - #include + #include + #include BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(std::vector) BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(std::deque) diff --git a/test/geometries/geometries.cpp b/test/geometries/geometries.cpp index 8510df1da..23dd11f52 100644 --- a/test/geometries/geometries.cpp +++ b/test/geometries/geometries.cpp @@ -1,7 +1,7 @@ // Boost.Geometry // Unit Test -// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2014-2015 Adam Wulkiewicz, Lodz, Poland. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -18,7 +18,6 @@ #include #include -#include #include typedef std::pair pt_pair_t; From 4e8abc3f8033f46e9f8953b62e9d2f5b09079457 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 02:15:11 +0200 Subject: [PATCH 09/32] [test][robustness] remove deprecated includes referring to the include/boost/geometry/multi/ directory --- test/robustness/convex_hull/random_multi_points.cpp | 3 +-- test/robustness/overlay/areal_areal/test_overlay_p_q.hpp | 3 +-- test/robustness/overlay/areal_areal/ticket_9081.cpp | 4 ++-- test/robustness/overlay/buffer/many_ring_buffer.cpp | 4 ++-- test/robustness/overlay/buffer/multi_point_growth.cpp | 2 +- test/robustness/overlay/buffer/recursive_polygons_buffer.cpp | 3 +-- .../overlay/linear_areal/recursive_polygons_linear_areal.cpp | 3 +-- 7 files changed, 9 insertions(+), 13 deletions(-) diff --git a/test/robustness/convex_hull/random_multi_points.cpp b/test/robustness/convex_hull/random_multi_points.cpp index c7b146681..93662ca9d 100644 --- a/test/robustness/convex_hull/random_multi_points.cpp +++ b/test/robustness/convex_hull/random_multi_points.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Robustness Test - convex_hull -// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -23,7 +23,6 @@ #include #include #include -#include #include struct settings_type diff --git a/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp b/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp index fa5544a77..6fbd38b3e 100644 --- a/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp +++ b/test/robustness/overlay/areal_areal/test_overlay_p_q.hpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // -// Copyright (c) 2009-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2009-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff --git a/test/robustness/overlay/areal_areal/ticket_9081.cpp b/test/robustness/overlay/areal_areal/ticket_9081.cpp index 9c2f81597..91f336c6f 100644 --- a/test/robustness/overlay/areal_areal/ticket_9081.cpp +++ b/test/robustness/overlay/areal_areal/ticket_9081.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Robustness Test -// Copyright (c) 2013 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -20,7 +20,7 @@ #include #include #include - #include + #include #include #include diff --git a/test/robustness/overlay/buffer/many_ring_buffer.cpp b/test/robustness/overlay/buffer/many_ring_buffer.cpp index 82226a087..1fd54c23f 100644 --- a/test/robustness/overlay/buffer/many_ring_buffer.cpp +++ b/test/robustness/overlay/buffer/many_ring_buffer.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2012-2014 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include diff --git a/test/robustness/overlay/buffer/multi_point_growth.cpp b/test/robustness/overlay/buffer/multi_point_growth.cpp index d74a6c5f6..4aed939cf 100644 --- a/test/robustness/overlay/buffer/multi_point_growth.cpp +++ b/test/robustness/overlay/buffer/multi_point_growth.cpp @@ -8,7 +8,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include #include diff --git a/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp b/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp index 737f22c2e..2000de657 100644 --- a/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp +++ b/test/robustness/overlay/buffer/recursive_polygons_buffer.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Robustness Test -// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -26,7 +26,6 @@ #include #include #include -#include #include diff --git a/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp b/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp index 8e057471d..c29a0df12 100644 --- a/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp +++ b/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Robustness Test -// Copyright (c) 2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2012-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -26,7 +26,6 @@ #include #include #include -#include #include #include From 63e87041da5c75721d1c8e142a9c4c6b580bccef Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 02:19:42 +0200 Subject: [PATCH 10/32] [test][io] remove deprecated includes referring to the include/boost/geometry/multi/ directory; also cleanup includes a bit; --- test/io/dsv/multi_dsv.cpp | 11 +++++------ test/io/wkt/multi_wkt.cpp | 23 ++++++----------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/test/io/dsv/multi_dsv.cpp b/test/io/dsv/multi_dsv.cpp index 0af8f10e9..0b4bd8f28 100644 --- a/test/io/dsv/multi_dsv.cpp +++ b/test/io/dsv/multi_dsv.cpp @@ -1,9 +1,9 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -15,9 +15,8 @@ #include #include -#include -#include -#include +#include +#include template void test_dsv(std::string const& wkt, std::string const& expected, bool json = false) diff --git a/test/io/wkt/multi_wkt.cpp b/test/io/wkt/multi_wkt.cpp index 35265feee..809f69fad 100644 --- a/test/io/wkt/multi_wkt.cpp +++ b/test/io/wkt/multi_wkt.cpp @@ -1,12 +1,12 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -29,18 +29,7 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include template void test_all(); From 63ff5bde6a23659ed7e9d38d886943e9add78c0f Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 02:20:47 +0200 Subject: [PATCH 11/32] [test][iterators] remove deprecated includes referring to the include/boost/geometry/multi/ directory --- test/iterators/point_iterator.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/iterators/point_iterator.cpp b/test/iterators/point_iterator.cpp index b07d64ea2..59d2266cb 100644 --- a/test/iterators/point_iterator.cpp +++ b/test/iterators/point_iterator.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2014, Oracle and/or its affiliates. +// Copyright (c) 2014-2015, Oracle and/or its affiliates. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle @@ -29,16 +29,13 @@ #include #include -#include #include #include -#include -#include +#include #include #include -#include #include From 3f2c06c9dd9682e8582b9415f1e9763b691517d4 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 02:21:54 +0200 Subject: [PATCH 12/32] [test] remove deprecated include referring to the include/boost/geometry/multi/ directory --- test/from_wkt.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/from_wkt.hpp b/test/from_wkt.hpp index a12dc051d..2d5f7bac6 100644 --- a/test/from_wkt.hpp +++ b/test/from_wkt.hpp @@ -1,10 +1,10 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Tests -// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. -// Copyright (c) 2013-2014 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -16,7 +16,6 @@ #include #include -#include template inline Geometry from_wkt(std::string const& wkt) From 821c9ef17225fbe3e2467d313b68d981fa4a4eb8 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 10:01:24 +0200 Subject: [PATCH 13/32] [doc][Doxyfile] remove deprecated multi/ directories from input path --- doc/doxy/Doxyfile | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index 633625f46..92098767d 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -200,13 +200,6 @@ INPUT = . .. ../../../../boost/geometry/core \ ../../../../boost/geometry/iterators \ ../../../../boost/geometry/io/wkt \ ../../../../boost/geometry/io/svg \ - ../../../../boost/geometry/multi/algorithms \ - ../../../../boost/geometry/multi/algorithms/detail \ - ../../../../boost/geometry/multi/core \ - ../../../../boost/geometry/multi/geometries \ - ../../../../boost/geometry/multi/geometries/register \ - ../../../../boost/geometry/multi/geometries/concepts \ - ../../../../boost/geometry/multi/strategies/cartesian \ ../../../../boost/geometry/policies \ ../../../../boost/geometry/policies/relate \ ../../../../boost/geometry/strategies \ From 5b09619b4ca772fa83e25b1dcc66520a186008dd Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 10:03:04 +0200 Subject: [PATCH 14/32] [doc][doxygen_input] remove deprecated includes referring to the include/boost/geometry/multi/ directory --- doc/doxy/doxygen_input/pages/doxygen_pages.hpp | 3 --- doc/doxy/doxygen_input/sourcecode/doxygen_4.cpp | 2 -- 2 files changed, 5 deletions(-) diff --git a/doc/doxy/doxygen_input/pages/doxygen_pages.hpp b/doc/doxy/doxygen_input/pages/doxygen_pages.hpp index 7ec99f557..7369d3eb6 100644 --- a/doc/doxy/doxygen_input/pages/doxygen_pages.hpp +++ b/doc/doxy/doxygen_input/pages/doxygen_pages.hpp @@ -118,9 +118,6 @@ For users using only Cartesian points, with floating point coordinates (double), etc. Using this headerfile the library seems to be a non-template library, so it is convenient for users that are not so into the template world. -For users using multi-geometries: -- \#include - \section advanced_includes Advanced includes This section is for users who have their own geometries and want to use algorithms from the Boost.Geometry. diff --git a/doc/doxy/doxygen_input/sourcecode/doxygen_4.cpp b/doc/doxy/doxygen_input/sourcecode/doxygen_4.cpp index b6fdecb73..e7960271c 100644 --- a/doc/doxy/doxygen_input/sourcecode/doxygen_4.cpp +++ b/doc/doxy/doxygen_input/sourcecode/doxygen_4.cpp @@ -15,8 +15,6 @@ OBSOLETE #include #include -#include - #include #include From 4e3a07df4fa037e032fd2047f428e76c5da503bd Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 10:04:44 +0200 Subject: [PATCH 15/32] [doc][doxygen_xml2qbk] remove multi/multi.hpp from convenience headers --- doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini b/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini index 7849e8f66..6dbaa7006 100644 --- a/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini +++ b/doc/src/docutils/tools/doxygen_xml2qbk/for_debugger.ini @@ -8,6 +8,6 @@ xml=../../../../doxy/doxygen_output/xml/structboost_1_1geometry_1_1closeable__vi start_include=boost/geometry/ convenience_header_path=../../../../../../../boost/geometry/ -convenience_headers=geometry.hpp,geometries/geometries.hpp,multi/multi.hpp +convenience_headers=geometry.hpp,geometries/geometries.hpp skip_namespace=boost::geometry:: From 38c2869fd30606a7d45541e10837c89ed0e6cf97 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 10:19:14 +0200 Subject: [PATCH 16/32] [test][algorithms][within] remove deprecated includes referring to the include/boost/geometry/multi/ directory --- .../relational_operations/within/multi_within.cpp | 9 ++------- .../relational_operations/within/test_within.hpp | 13 +++++-------- .../relational_operations/within/within.cpp | 15 +++++++-------- .../within/within_areal_areal.cpp | 7 +++---- .../within/within_linear_areal.cpp | 13 ++++++------- .../within/within_linear_linear.cpp | 11 +++++------ .../within/within_pointlike_xxx.cpp | 15 +++++++-------- 7 files changed, 35 insertions(+), 48 deletions(-) diff --git a/test/algorithms/relational_operations/within/multi_within.cpp b/test/algorithms/relational_operations/within/multi_within.cpp index cf5573aa6..b41529cc0 100644 --- a/test/algorithms/relational_operations/within/multi_within.cpp +++ b/test/algorithms/relational_operations/within/multi_within.cpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -8,19 +8,14 @@ #include #include -#include #include #include #include #include - -#include -#include - #include -#include +#include #include "test_within.hpp" diff --git a/test/algorithms/relational_operations/within/test_within.hpp b/test/algorithms/relational_operations/within/test_within.hpp index c82bdaf7e..b92b029dd 100644 --- a/test/algorithms/relational_operations/within/test_within.hpp +++ b/test/algorithms/relational_operations/within/test_within.hpp @@ -1,11 +1,11 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -26,6 +26,7 @@ #include #include #include +#include #include @@ -38,10 +39,6 @@ #include -#include -#include -#include - template void check_geometry(Geometry1 const& geometry1, Geometry2 const& geometry2, diff --git a/test/algorithms/relational_operations/within/within.cpp b/test/algorithms/relational_operations/within/within.cpp index 2300a4ec5..c8999e4db 100644 --- a/test/algorithms/relational_operations/within/within.cpp +++ b/test/algorithms/relational_operations/within/within.cpp @@ -1,10 +1,10 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -17,10 +17,9 @@ #include #include -#include -#include -#include -#include +#include +#include +#include template void test_all() diff --git a/test/algorithms/relational_operations/within/within_areal_areal.cpp b/test/algorithms/relational_operations/within/within_areal_areal.cpp index a2901ba4b..559543945 100644 --- a/test/algorithms/relational_operations/within/within_areal_areal.cpp +++ b/test/algorithms/relational_operations/within/within_areal_areal.cpp @@ -1,7 +1,7 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. // This file was modified by Oracle on 2014, 2015. // Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. @@ -18,8 +18,7 @@ #include #include -#include -#include +#include template void test_a_a() diff --git a/test/algorithms/relational_operations/within/within_linear_areal.cpp b/test/algorithms/relational_operations/within/within_linear_areal.cpp index 889ff3692..14e541d36 100644 --- a/test/algorithms/relational_operations/within/within_linear_areal.cpp +++ b/test/algorithms/relational_operations/within/within_linear_areal.cpp @@ -1,10 +1,10 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -17,9 +17,8 @@ #include #include -#include -#include -#include +#include +#include template void test_l_a() diff --git a/test/algorithms/relational_operations/within/within_linear_linear.cpp b/test/algorithms/relational_operations/within/within_linear_linear.cpp index 6467e0110..f2e2876bf 100644 --- a/test/algorithms/relational_operations/within/within_linear_linear.cpp +++ b/test/algorithms/relational_operations/within/within_linear_linear.cpp @@ -1,10 +1,10 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -17,8 +17,7 @@ #include #include -#include -#include +#include template void test_l_l() diff --git a/test/algorithms/relational_operations/within/within_pointlike_xxx.cpp b/test/algorithms/relational_operations/within/within_pointlike_xxx.cpp index 5ea4f09f2..ff9e67f12 100644 --- a/test/algorithms/relational_operations/within/within_pointlike_xxx.cpp +++ b/test/algorithms/relational_operations/within/within_pointlike_xxx.cpp @@ -1,10 +1,10 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2013-2015 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014 Oracle and/or its affiliates. +// This file was modified by Oracle on 2014, 2015. +// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -17,10 +17,9 @@ #include #include -#include -#include -#include -#include +#include +#include +#include template void test_p_p() From bfcd9594d051d94154ffede1a90f1a80a83791a3 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 12 Mar 2015 10:32:50 +0200 Subject: [PATCH 17/32] [geometry][multi] make boost/geometry/multi/multi.hpp include boost/geometry/geometry.hpp; file kept for now for backward compatibility; --- include/boost/geometry/multi/multi.hpp | 73 +++----------------------- 1 file changed, 8 insertions(+), 65 deletions(-) diff --git a/include/boost/geometry/multi/multi.hpp b/include/boost/geometry/multi/multi.hpp index 4b3063e52..85d763ee6 100644 --- a/include/boost/geometry/multi/multi.hpp +++ b/include/boost/geometry/multi/multi.hpp @@ -1,11 +1,11 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2008-2012 Bruno Lalande, Paris, France. -// Copyright (c) 2009-2012 Mateusz Loskot, London, UK. +// Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. +// Copyright (c) 2008-2015 Bruno Lalande, Paris, France. +// Copyright (c) 2009-2015 Mateusz Loskot, London, UK. -// This file was modified by Oracle on 2013. -// Modifications copyright (c) 2013, Oracle and/or its affiliates. +// This file was modified by Oracle on 2013, 2015. +// Modifications copyright (c) 2013-2015, Oracle and/or its affiliates. // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. @@ -17,65 +17,8 @@ #ifndef BOOST_GEOMETRY_MULTI_HPP #define BOOST_GEOMETRY_MULTI_HPP - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include - +// keep this file for now, for backward compatibility +// functionality-wise, make it equivalent to boost/geometry/geometry.hpp +#include #endif // BOOST_GEOMETRY_MULTI_HPP From 5de5e93780788d04101115ba21169e5c6368cd9a Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Fri, 13 Mar 2015 12:31:07 +0200 Subject: [PATCH 18/32] [util][math][fmod] add support for calls to fmod: for fundamental floating-point numbers it calls std::fmod; for fundamental integral numbers it calls operator%; for user defined number types the free function fmod is called (lookup is activated in the global namespace, the std namespace and the type's namespace); --- include/boost/geometry/util/math.hpp | 78 ++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/include/boost/geometry/util/math.hpp b/include/boost/geometry/util/math.hpp index fb9b976ac..69b747020 100644 --- a/include/boost/geometry/util/math.hpp +++ b/include/boost/geometry/util/math.hpp @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -191,6 +192,66 @@ struct square_root }; + +template +< + typename T, + bool IsFundemantal = boost::is_fundamental::value /* false */ +> +struct modulo +{ + typedef T return_type; + + static inline T apply(T const& value1, T const& value2) + { + // for non-fundamental number types assume that sqrt is + // defined either: + // 1) at T's scope, or + // 2) at global scope, or + // 3) in namespace std + using ::fmod; + using std::fmod; + + return fmod(value1, value2); + } +}; + +template +struct modulo_for_fundamental +{ + typedef Fundamental return_type; + + static inline Fundamental apply(Fundamental const& value1, + Fundamental const& value2) + { + return value1 % value2; + } +}; + +// specialization for floating-point numbers +template +struct modulo_for_fundamental +{ + typedef Fundamental return_type; + + static inline Fundamental apply(Fundamental const& value1, + Fundamental const& value2) + { + return std::fmod(value1, value2); + } +}; + +// specialization for fundamental number type +template +struct modulo + : modulo_for_fundamental + < + Fundamental, boost::is_integral::value + > +{}; + + + /*! \brief Short construct to enable partial specialization for PI, currently not possible in Math. */ @@ -358,6 +419,23 @@ sqrt(T const& value) >::apply(value); } +/*! +\brief Short utility to return the result of fmod of two values +\ingroup utility +\param value1 First value +\param value2 Second value +\return The result of the fmod operation on the (ordered) pair (value1, value2) +*/ +template +inline typename detail::modulo::return_type +fmod(T const& value1, T const& value2) +{ + return detail::modulo + < + T, boost::is_fundamental::value + >::apply(value1, value2); +} + /*! \brief Short utility to workaround gcc/clang problem that abs is converting to integer and that older versions of MSVC does not support abs of long long... From bf96857a46d4b71d64f8ae076c64a2814f70f51d Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Mon, 16 Mar 2015 12:09:36 +0200 Subject: [PATCH 19/32] [util][math][mod] rename math::fmod() to math::mod() (more generic and descriptive name); fix/update inline doc and comments; add default value to IsIntegral template parameter of modulo_for_fundamental struct; --- include/boost/geometry/util/math.hpp | 30 +++++++++++++--------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/include/boost/geometry/util/math.hpp b/include/boost/geometry/util/math.hpp index 69b747020..e3b2c388f 100644 --- a/include/boost/geometry/util/math.hpp +++ b/include/boost/geometry/util/math.hpp @@ -204,19 +204,19 @@ struct modulo static inline T apply(T const& value1, T const& value2) { - // for non-fundamental number types assume that sqrt is - // defined either: + // for non-fundamental number types assume that a free + // function mod() is defined either: // 1) at T's scope, or - // 2) at global scope, or - // 3) in namespace std - using ::fmod; - using std::fmod; - - return fmod(value1, value2); + // 2) at global scope + return mod(value1, value2); } }; -template +template +< + typename Fundamental, + bool IsIntegral = boost::is_integral::value +> struct modulo_for_fundamental { typedef Fundamental return_type; @@ -244,10 +244,7 @@ struct modulo_for_fundamental // specialization for fundamental number type template struct modulo - : modulo_for_fundamental - < - Fundamental, boost::is_integral::value - > + : modulo_for_fundamental {}; @@ -420,15 +417,16 @@ sqrt(T const& value) } /*! -\brief Short utility to return the result of fmod of two values +\brief Short utility to return the modulo of two values \ingroup utility \param value1 First value \param value2 Second value -\return The result of the fmod operation on the (ordered) pair (value1, value2) +\return The result of the modulo operation on the (ordered) pair +(value1, value2) */ template inline typename detail::modulo::return_type -fmod(T const& value1, T const& value2) +mod(T const& value1, T const& value2) { return detail::modulo < From 2808beed3d5e902ec902b74454ccef2315304682 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Wed, 1 Apr 2015 23:52:01 +0200 Subject: [PATCH 20/32] [algorithm][iterator] Avoid preincrementation of temporaries. --- .../algorithms/detail/distance/geometry_to_segment_or_box.hpp | 3 ++- .../geometry/algorithms/detail/is_valid/has_duplicates.hpp | 3 ++- include/boost/geometry/iterators/flatten_iterator.hpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp b/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp index 57257dbdc..ec5296c35 100644 --- a/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp @@ -220,7 +220,8 @@ public: comparable_return_type cd_min1(0); point_iterator_type pit_min; seg_or_box_iterator_type it_min1 = seg_or_box_points.begin(); - seg_or_box_iterator_type it_min2 = ++seg_or_box_points.begin(); + seg_or_box_iterator_type it_min2 = it_min1; + ++it_min2; bool first = true; for (point_iterator_type pit = points_begin(geometry); diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp index 5878841e7..7527aa521 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp @@ -48,7 +48,8 @@ struct has_duplicates geometry::equal_to::type> equal; iterator it = boost::begin(view); - iterator next = ++boost::begin(view); + iterator next = it; + ++next; for (; next != boost::end(view); ++it, ++next) { if ( equal(*it, *next) ) diff --git a/include/boost/geometry/iterators/flatten_iterator.hpp b/include/boost/geometry/iterators/flatten_iterator.hpp index 07450afbe..3243f6f0e 100644 --- a/include/boost/geometry/iterators/flatten_iterator.hpp +++ b/include/boost/geometry/iterators/flatten_iterator.hpp @@ -215,7 +215,8 @@ private: --m_outer_it; } while ( empty(m_outer_it) ); - m_inner_it = --AccessInnerEnd::apply(*m_outer_it); + m_inner_it = AccessInnerEnd::apply(*m_outer_it); + --m_inner_it; } else { From 1113955b88909834b47089b813fd93d242f07f76 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Wed, 1 Apr 2015 23:54:28 +0200 Subject: [PATCH 21/32] [algorithms][buffer] Explicitly get const random iterators. Use Range consistently. --- .../detail/buffer/buffered_piece_collection.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp index a501e3f19..c13e12449 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -548,9 +548,8 @@ struct buffered_piece_collection // reliable integer-based ring. All turns can be compared (inside) to this // rings to see if they are inside. - for (typename piece_vector_type::iterator it = boost::begin(m_pieces); - it != boost::end(m_pieces); - ++it) + for (typename boost::range_iterator::type + it = boost::begin(m_pieces); it != boost::end(m_pieces); ++it) { piece& pc = *it; int piece_segment_index = pc.first_seg_id.segment_index; @@ -562,9 +561,9 @@ struct buffered_piece_collection } // Walk through them, in reverse to insert at right index int index_offset = pc.robust_turns.size() - 1; - for (typename std::vector::const_reverse_iterator - rit = pc.robust_turns.rbegin(); - rit != pc.robust_turns.rend(); + for (typename boost::range_reverse_iterator >::type + rit = boost::const_rbegin(pc.robust_turns); + rit != boost::const_rend(pc.robust_turns); ++rit, --index_offset) { int const index_in_vector = 1 + rit->seg_id.segment_index - piece_segment_index; From b8034d1ab2c3c538f17d6ecd319fa3713b90d3a0 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Thu, 2 Apr 2015 03:21:10 +0200 Subject: [PATCH 22/32] [extensions][test] Pass /bigobj flag for msvc and intel compilers on windows for all tests. --- extensions/test/Jamfile.v2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/test/Jamfile.v2 b/extensions/test/Jamfile.v2 index c7e33b210..f7bf7de92 100644 --- a/extensions/test/Jamfile.v2 +++ b/extensions/test/Jamfile.v2 @@ -16,6 +16,8 @@ project boost-geometry-extensions-test ../../test ../../../boost/geometry/extensions/contrib/ttmath msvc:on + msvc:/bigobj + windows,intel:/bigobj /boost/timer//boost_timer ; From 9c7659c9557efceb17a67e09a0aff90c66fab106 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Thu, 2 Apr 2015 03:23:11 +0200 Subject: [PATCH 23/32] [extensions][gis][strategies] Rename CS template parameter to CoordinateSystem. --- .../extensions/gis/geographic/strategies/dms_parser.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/geometry/extensions/gis/geographic/strategies/dms_parser.hpp b/include/boost/geometry/extensions/gis/geographic/strategies/dms_parser.hpp index af746e821..884b4b072 100644 --- a/include/boost/geometry/extensions/gis/geographic/strategies/dms_parser.hpp +++ b/include/boost/geometry/extensions/gis/geographic/strategies/dms_parser.hpp @@ -254,15 +254,15 @@ namespace strategy #ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS -template class CS> -struct strategy_parse > +template class CoordinateSystem> +struct strategy_parse > { typedef strategy::dms_parser type; }; -template class CS> -struct strategy_parse > +template class CoordinateSystem> +struct strategy_parse > { typedef strategy::dms_parser type; }; From 5a3b023fc8a7d3b13a470bafdcaf8fcee1c5e161 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Thu, 2 Apr 2015 03:24:00 +0200 Subject: [PATCH 24/32] [extensions][projections] Rename CS constants to CS_ (and CN to CN_ for consistency). --- .../geometry/extensions/gis/projections/proj/hatano.hpp | 6 +++--- .../geometry/extensions/gis/projections/proj/mbtfpp.hpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/boost/geometry/extensions/gis/projections/proj/hatano.hpp b/include/boost/geometry/extensions/gis/projections/proj/hatano.hpp index 1c34ecec0..b415503c8 100644 --- a/include/boost/geometry/extensions/gis/projections/proj/hatano.hpp +++ b/include/boost/geometry/extensions/gis/projections/proj/hatano.hpp @@ -49,8 +49,8 @@ namespace boost { namespace geometry { namespace projections static const int NITER = 20; static const double EPS = 1e-7; static const double ONETOL = 1.000001; - static const double CN = 2.67595; - static const double CS = 2.43763; + static const double CN_ = 2.67595; + static const double CS_ = 2.43763; static const double RCN = 0.37369906014686373063; static const double RCS = 0.41023453108141924738; static const double FYCN = 1.75859; @@ -80,7 +80,7 @@ namespace boost { namespace geometry { namespace projections double th1, c; int i; - c = sin(lp_lat) * (lp_lat < 0. ? CS : CN); + c = sin(lp_lat) * (lp_lat < 0. ? CS_ : CN_); for (i = NITER; i; --i) { lp_lat -= th1 = (lp_lat + sin(lp_lat) - c) / (1. + cos(lp_lat)); if (fabs(th1) < EPS) break; diff --git a/include/boost/geometry/extensions/gis/projections/proj/mbtfpp.hpp b/include/boost/geometry/extensions/gis/projections/proj/mbtfpp.hpp index 3c7af1f48..c25c56376 100644 --- a/include/boost/geometry/extensions/gis/projections/proj/mbtfpp.hpp +++ b/include/boost/geometry/extensions/gis/projections/proj/mbtfpp.hpp @@ -46,7 +46,7 @@ namespace boost { namespace geometry { namespace projections { #ifndef DOXYGEN_NO_DETAIL namespace detail { namespace mbtfpp{ - static const double CS = .95257934441568037152; + static const double CS_ = .95257934441568037152; static const double FXC = .92582009977255146156; static const double FYC = 3.40168025708304504493; static const double C23 = .66666666666666666666; @@ -70,7 +70,7 @@ namespace boost { namespace geometry { namespace projections inline void fwd(geographic_type& lp_lon, geographic_type& lp_lat, cartesian_type& xy_x, cartesian_type& xy_y) const { - lp_lat = asin(CS * sin(lp_lat)); + lp_lat = asin(CS_ * sin(lp_lat)); xy_x = FXC * lp_lon * (2. * cos(C23 * lp_lat) - 1.); xy_y = FYC * sin(C13 * lp_lat); } @@ -84,7 +84,7 @@ namespace boost { namespace geometry { namespace projections } else lp_lat = asin(lp_lat); lp_lon = xy_x / ( FXC * (2. * cos(C23 * (lp_lat *= 3.)) - 1.) ); - if (fabs(lp_lat = sin(lp_lat) / CS) >= 1.) { + if (fabs(lp_lat = sin(lp_lat) / CS_) >= 1.) { if (fabs(lp_lat) > ONEEPS) throw proj_exception(); else lp_lat = (lp_lat < 0.) ? -HALFPI : HALFPI; } else From 7277f1f38b684d328f493e225fdf9ffbb14d6e55 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sat, 4 Apr 2015 18:21:12 +0200 Subject: [PATCH 25/32] [index] Upgrade the category of query iterators to ForwardIterator. --- .../geometry/index/detail/predicates.hpp | 10 +++++++ .../index/detail/rtree/query_iterators.hpp | 27 +++++++++++-------- .../detail/rtree/visitors/distance_query.hpp | 8 ++++++ .../detail/rtree/visitors/spatial_query.hpp | 10 ++++++- 4 files changed, 43 insertions(+), 12 deletions(-) diff --git a/include/boost/geometry/index/detail/predicates.hpp b/include/boost/geometry/index/detail/predicates.hpp index 60f80207d..01afd16ba 100644 --- a/include/boost/geometry/index/detail/predicates.hpp +++ b/include/boost/geometry/index/detail/predicates.hpp @@ -25,6 +25,7 @@ namespace predicates { template struct satisfies_impl { + satisfies_impl() : fun(NULL) {} satisfies_impl(Fun f) : fun(f) {} Fun * fun; }; @@ -32,6 +33,7 @@ struct satisfies_impl template struct satisfies_impl { + satisfies_impl() {} satisfies_impl(Fun const& f) : fun(f) {} Fun fun; }; @@ -42,6 +44,7 @@ struct satisfies { typedef satisfies_impl::value> base; + satisfies() {} satisfies(Fun const& f) : base(f) {} satisfies(base const& b) : base(b) {} }; @@ -60,6 +63,7 @@ struct within_tag {}; template struct spatial_predicate { + spatial_predicate() {} spatial_predicate(Geometry const& g) : geometry(g) {} Geometry geometry; }; @@ -75,6 +79,9 @@ struct spatial_predicate template struct nearest { + nearest() +// : count(0) + {} nearest(PointOrRelation const& por, unsigned k) : point_or_relation(por) , count(k) @@ -86,6 +93,9 @@ struct nearest template struct path { + path() +// : count(0) + {} path(SegmentOrLinestring const& g, unsigned k) : geometry(g) , count(k) diff --git a/include/boost/geometry/index/detail/rtree/query_iterators.hpp b/include/boost/geometry/index/detail/rtree/query_iterators.hpp index 74000d03e..83be106b8 100644 --- a/include/boost/geometry/index/detail/rtree/query_iterators.hpp +++ b/include/boost/geometry/index/detail/rtree/query_iterators.hpp @@ -20,7 +20,7 @@ namespace boost { namespace geometry { namespace index { namespace detail { name template struct end_query_iterator { - typedef std::input_iterator_tag iterator_category; + typedef std::forward_iterator_tag iterator_category; typedef Value value_type; typedef typename Allocators::const_reference reference; typedef typename Allocators::difference_type difference_type; @@ -65,12 +65,15 @@ class spatial_query_iterator typedef typename visitor_type::node_pointer node_pointer; public: - typedef std::input_iterator_tag iterator_category; + typedef std::forward_iterator_tag iterator_category; typedef Value value_type; typedef typename Allocators::const_reference reference; typedef typename Allocators::difference_type difference_type; typedef typename Allocators::const_pointer pointer; + inline spatial_query_iterator() + {} + inline spatial_query_iterator(Translator const& t, Predicates const& p) : m_visitor(t, p) {} @@ -130,12 +133,15 @@ class distance_query_iterator typedef typename visitor_type::node_pointer node_pointer; public: - typedef std::input_iterator_tag iterator_category; + typedef std::forward_iterator_tag iterator_category; typedef Value value_type; typedef typename Allocators::const_reference reference; typedef typename Allocators::difference_type difference_type; typedef typename Allocators::const_pointer pointer; + inline distance_query_iterator() + {} + inline distance_query_iterator(Translator const& t, Predicates const& p) : m_visitor(t, p) {} @@ -188,22 +194,19 @@ private: visitor_type m_visitor; }; + template inline bool operator!=(L const& l, R const& r) { return !(l == r); } -}}}}}} // namespace boost::geometry::index::detail::rtree::iterators - - -namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace iterators { template class query_iterator_base { public: - typedef std::input_iterator_tag iterator_category; + typedef std::forward_iterator_tag iterator_category; typedef Value value_type; typedef typename Allocators::const_reference reference; typedef typename Allocators::difference_type difference_type; @@ -226,12 +229,13 @@ class query_iterator_wrapper typedef query_iterator_base base_t; public: - typedef std::input_iterator_tag iterator_category; + typedef std::forward_iterator_tag iterator_category; typedef Value value_type; typedef typename Allocators::const_reference reference; typedef typename Allocators::difference_type difference_type; typedef typename Allocators::const_pointer pointer; + query_iterator_wrapper() : m_iterator() {} explicit query_iterator_wrapper(Iterator const& it) : m_iterator(it) {} virtual base_t * clone() const { return new query_iterator_wrapper(m_iterator); } @@ -258,13 +262,14 @@ class query_iterator typedef boost::scoped_ptr iterator_ptr; public: - typedef std::input_iterator_tag iterator_category; + typedef std::forward_iterator_tag iterator_category; typedef Value value_type; typedef typename Allocators::const_reference reference; typedef typename Allocators::difference_type difference_type; typedef typename Allocators::const_pointer pointer; - query_iterator() {} + query_iterator() + {} template query_iterator(It const& it) diff --git a/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp b/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp index fc0929e9e..b93071443 100644 --- a/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp +++ b/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp @@ -337,6 +337,13 @@ public: }; typedef std::vector internal_stack_type; + inline distance_query_incremental() + : m_translator(NULL) +// , m_pred() + , current_neighbor((std::numeric_limits::max)()) +// , next_closest_node_distance((std::numeric_limits::max)()) + {} + inline distance_query_incremental(Translator const& translator, Predicates const& pred) : m_translator(::boost::addressof(translator)) , m_pred(pred) @@ -428,6 +435,7 @@ public: { BOOST_GEOMETRY_INDEX_ASSERT(l.current_neighbor != r.current_neighbor || (std::numeric_limits::max)() == l.current_neighbor || + (std::numeric_limits::max)() == r.current_neighbor || l.neighbors[l.current_neighbor].second == r.neighbors[r.current_neighbor].second, "not corresponding iterators"); return l.current_neighbor == r.current_neighbor; diff --git a/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp b/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp index f00189fe7..b9cd0ae2c 100644 --- a/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp +++ b/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp @@ -94,10 +94,18 @@ public: static const unsigned predicates_len = index::detail::predicates_length::value; + inline spatial_query_incremental() + : m_translator(NULL) +// , m_pred() + , m_values(NULL) + , m_current() + {} + inline spatial_query_incremental(Translator const& t, Predicates const& p) : m_translator(::boost::addressof(t)) , m_pred(p) - , m_values(0) + , m_values(NULL) + , m_current() {} inline void operator()(internal_node const& n) From 34066a479677f4696ccf25de7f920478d0d1afb7 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sat, 4 Apr 2015 18:21:52 +0200 Subject: [PATCH 26/32] [index] Add begin() and end() functions returning const_iterator to the rtree. Adapt the rtree to the Boost.Range concept. Tweek the description of functions. --- .../geometry/index/detail/rtree/iterators.hpp | 122 +++++++++++++ .../index/detail/rtree/visitors/iterator.hpp | 134 ++++++++++++++ include/boost/geometry/index/rtree.hpp | 167 ++++++++++++++++-- 3 files changed, 406 insertions(+), 17 deletions(-) create mode 100644 include/boost/geometry/index/detail/rtree/iterators.hpp create mode 100644 include/boost/geometry/index/detail/rtree/visitors/iterator.hpp diff --git a/include/boost/geometry/index/detail/rtree/iterators.hpp b/include/boost/geometry/index/detail/rtree/iterators.hpp new file mode 100644 index 000000000..a47dd7ea4 --- /dev/null +++ b/include/boost/geometry/index/detail/rtree/iterators.hpp @@ -0,0 +1,122 @@ +// Boost.Geometry Index +// +// R-tree iterators +// +// Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland. +// +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ITERATORS_HPP +#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ITERATORS_HPP + +namespace boost { namespace geometry { namespace index { namespace detail { namespace rtree { namespace iterators { + +template +struct end_iterator +{ + typedef std::forward_iterator_tag iterator_category; + typedef Value value_type; + typedef typename Allocators::const_reference reference; + typedef typename Allocators::difference_type difference_type; + typedef typename Allocators::const_pointer pointer; + + reference operator*() const + { + BOOST_GEOMETRY_INDEX_ASSERT(false, "iterator not dereferencable"); + pointer p(0); + return *p; + } + + const value_type * operator->() const + { + BOOST_GEOMETRY_INDEX_ASSERT(false, "iterator not dereferencable"); + const value_type * p = 0; + return p; + } + + end_iterator & operator++() + { + BOOST_GEOMETRY_INDEX_ASSERT(false, "iterator not incrementable"); + return *this; + } + + end_iterator operator++(int) + { + BOOST_GEOMETRY_INDEX_ASSERT(false, "iterator not incrementable"); + return *this; + } + + friend bool operator==(end_iterator const& /*l*/, end_iterator const& /*r*/) + { + return true; + } +}; + +template +class iterator +{ + typedef visitors::iterator visitor_type; + typedef typename visitor_type::node_pointer node_pointer; + +public: + typedef std::forward_iterator_tag iterator_category; + typedef Value value_type; + typedef typename Allocators::const_reference reference; + typedef typename Allocators::difference_type difference_type; + typedef typename Allocators::const_pointer pointer; + + inline iterator() + {} + + inline iterator(node_pointer root) + { + m_visitor.initialize(root); + } + + reference operator*() const + { + return m_visitor.dereference(); + } + + const value_type * operator->() const + { + return boost::addressof(m_visitor.dereference()); + } + + iterator & operator++() + { + m_visitor.increment(); + return *this; + } + + iterator operator++(int) + { + iterator temp = *this; + this->operator++(); + return temp; + } + + friend bool operator==(iterator const& l, iterator const& r) + { + return l.m_visitor == r.m_visitor; + } + + friend bool operator==(iterator const& l, end_iterator const& /*r*/) + { + return l.m_visitor.is_end(); + } + + friend bool operator==(end_iterator const& /*l*/, iterator const& r) + { + return r.m_visitor.is_end(); + } + +private: + visitor_type m_visitor; +}; + +}}}}}} // namespace boost::geometry::index::detail::rtree::iterators + +#endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ITERATORS_HPP diff --git a/include/boost/geometry/index/detail/rtree/visitors/iterator.hpp b/include/boost/geometry/index/detail/rtree/visitors/iterator.hpp new file mode 100644 index 000000000..621231ae9 --- /dev/null +++ b/include/boost/geometry/index/detail/rtree/visitors/iterator.hpp @@ -0,0 +1,134 @@ +// Boost.Geometry Index +// +// R-tree iterator visitor implementation +// +// Copyright (c) 2011-2015 Adam Wulkiewicz, Lodz, Poland. +// +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_ITERATOR_HPP +#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_ITERATOR_HPP + +namespace boost { namespace geometry { namespace index { + +namespace detail { namespace rtree { namespace visitors { + +template +class iterator + : public rtree::visitor::type +{ +public: + typedef typename rtree::node::type node; + typedef typename rtree::internal_node::type internal_node; + typedef typename rtree::leaf::type leaf; + + typedef typename Allocators::size_type size_type; + typedef typename Allocators::const_reference const_reference; + typedef typename Allocators::node_pointer node_pointer; + + typedef typename rtree::elements_type::type::const_iterator internal_iterator; + typedef typename rtree::elements_type::type leaf_elements; + typedef typename rtree::elements_type::type::const_iterator leaf_iterator; + + inline iterator() + : m_values(NULL) + , m_current() + {} + + inline void operator()(internal_node const& n) + { + typedef typename rtree::elements_type::type elements_type; + elements_type const& elements = rtree::elements(n); + + m_internal_stack.push_back(std::make_pair(elements.begin(), elements.end())); + } + + inline void operator()(leaf const& n) + { + m_values = ::boost::addressof(rtree::elements(n)); + m_current = rtree::elements(n).begin(); + } + + const_reference dereference() const + { + BOOST_GEOMETRY_INDEX_ASSERT(m_values, "not dereferencable"); + return *m_current; + } + + void initialize(node_pointer root) + { + rtree::apply_visitor(*this, *root); + search_value(); + } + + void increment() + { + ++m_current; + search_value(); + } + + void search_value() + { + for (;;) + { + // if leaf is choosen, move to the next value in leaf + if ( m_values ) + { + // there are more values in the current leaf + if ( m_current != m_values->end() ) + { + return; + } + // no more values, clear current leaf + else + { + m_values = 0; + } + } + // if leaf isn't choosen, move to the next leaf + else + { + // return if there is no more nodes to traverse + if ( m_internal_stack.empty() ) + return; + + // no more children in current node, remove it from stack + if ( m_internal_stack.back().first == m_internal_stack.back().second ) + { + m_internal_stack.pop_back(); + continue; + } + + internal_iterator it = m_internal_stack.back().first; + ++m_internal_stack.back().first; + + // push the next node to the stack + rtree::apply_visitor(*this, *(it->second)); + } + } + } + + bool is_end() const + { + return 0 == m_values; + } + + friend bool operator==(iterator const& l, iterator const& r) + { + return (l.m_values == r.m_values) && (0 == l.m_values || l.m_current == r.m_current ); + } + +private: + + std::vector< std::pair > m_internal_stack; + const leaf_elements * m_values; + leaf_iterator m_current; +}; + +}}} // namespace detail::rtree::visitors + +}}} // namespace boost::geometry::index + +#endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_ITERATOR_HPP diff --git a/include/boost/geometry/index/rtree.hpp b/include/boost/geometry/index/rtree.hpp index 9d5d57d05..b9dbd5704 100644 --- a/include/boost/geometry/index/rtree.hpp +++ b/include/boost/geometry/index/rtree.hpp @@ -59,6 +59,7 @@ #include #include +#include #include #include #include @@ -78,6 +79,7 @@ #include +#include #include #ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL @@ -220,8 +222,17 @@ public: /*! \brief Unsigned integral type used by the container. */ typedef typename allocators_type::size_type size_type; + /*! \brief Type of const iterator. */ + typedef index::detail::rtree::iterators::iterator + < + value_type, options_type, translator_type, box_type, allocators_type + > const_iterator; + /*! \brief Type of const query iterator. */ - typedef index::detail::rtree::iterators::query_iterator const_query_iterator; + typedef index::detail::rtree::iterators::query_iterator + < + value_type, allocators_type + > const_query_iterator; public: @@ -814,6 +825,9 @@ public: If predicates copy throws. If allocation throws. + \warning + The modification of the rtree may invalidate the iterators. + \param predicates Predicates. \return The iterator pointing at the begin of the query range. @@ -842,6 +856,9 @@ public: \par Throws Nothing + + \warning + The modification of the rtree may invalidate the iterators. \return The iterator pointing at the end of the query range. */ @@ -1016,6 +1033,63 @@ private: public: + /*! + \brief Returns the iterator pointing at the begin of the rtree values range. + + This method returns the iterator which may be used to iterate over all values + stored in the rtree. + + \par Example + \verbatim + for ( Rtree::const_iterator it = tree.begin() ; it != tree.end() ; ++it ) + { + // do something with value + } + \endverbatim + + \par Throws + If allocation throws. + + \warning + The modification of the rtree may invalidate the iterators. + + \return The iterator pointing at the begin of the range. + */ + const_iterator begin() const + { + if ( !m_members.root ) + return const_iterator(); + + return const_iterator(m_members.root); + } + + /*! + \brief Returns the iterator pointing at the end of the rtree values range. + + This method returns the iterator which may be compared with the iterator returned by begin() + in order to check if the iteration has ended. + + \par Example + \verbatim + for ( Rtree::const_iterator it = tree.begin() ; it != tree.end() ; ++it ) + { + // do something with value + } + \endverbatim + + \par Throws + Nothing. + + \warning + The modification of the rtree may invalidate the iterators. + + \return The iterator pointing at the end of the range. + */ + const_iterator end() const + { + return const_iterator(); + } + /*! \brief Returns the number of stored values. @@ -1797,14 +1871,7 @@ about the predicates which may be passed to this method see query(). \par Example \verbatim - -for ( Rtree::const_query_iterator it = qbegin(tree, bgi::nearest(pt, 10000)) ; - it != qend(tree) ; ++it ) -{ - // do something with value - if ( has_enough_nearest_values() ) - break; -} +std::for_each(bgi::qbegin(tree, bgi::nearest(pt, 3)), bgi::qend(tree), do_something()); \endverbatim \par Throws @@ -1834,14 +1901,7 @@ This method returns the iterator which may be used to check if the query has end \par Example \verbatim - -for ( Rtree::const_query_iterator it = qbegin(tree, bgi::nearest(pt, 10000)) ; - it != qend(tree) ; ++it ) -{ - // do something with value - if ( has_enough_nearest_values() ) - break; -} +std::for_each(bgi::qbegin(tree, bgi::nearest(pt, 3)), bgi::qend(tree), do_something()); \endverbatim \par Throws @@ -1858,6 +1918,62 @@ qend(rtree const& tree) return tree.qend(); } +/*! +\brief Returns the iterator pointing at the begin of the rtree values range. + +This method returns the iterator which may be used to iterate over all values +stored in the rtree. + +\par Example +\verbatim +std::for_each(bgi::begin(tree), bgi::end(tree), do_something()); +// the same as +std::for_each(boost::begin(tree), boost::end(tree), do_something()); +\endverbatim + +\par Throws +If allocation throws. + +\warning +The modification of the rtree may invalidate the iterators. + +\return The iterator pointing at the begin of the range. +*/ +template inline +typename rtree::const_iterator +begin(rtree const& tree) +{ + return tree.begin(); +} + +/*! +\brief Returns the iterator pointing at the end of the rtree values range. + +This method returns the iterator which may be compared with the iterator returned by begin() +in order to check if the iteration has ended. + +\par Example +\verbatim +std::for_each(bgi::begin(tree), bgi::end(tree), do_something()); +// the same as +std::for_each(boost::begin(tree), boost::end(tree), do_something()); +\endverbatim + +\par Throws +Nothing. + +\warning +The modification of the rtree may invalidate the iterators. + +\return The iterator pointing at the end of the range. +*/ +template inline +typename rtree::const_iterator +end(rtree const& tree) +{ + return tree.end(); +} + /*! \brief Remove all values from the index. @@ -1944,6 +2060,23 @@ inline void swap(rtree & }}} // namespace boost::geometry::index +// Boost.Range adaptation +namespace boost { + +template +struct range_mutable_iterator + < + boost::geometry::index::rtree + > +{ + typedef typename boost::geometry::index::rtree + < + Value, Parameters, IndexableGetter, EqualTo, Allocator + >::const_iterator type; +}; + +} // namespace boost + // TODO: don't include the implementation at the end of the file #include From 2e1690c247e81f1a331813eb3488e40aa80bd145 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sat, 4 Apr 2015 18:32:14 +0200 Subject: [PATCH 27/32] [test][index] Add tests for rtree iterators. Query iterator ForwardIterator category conformance. Iterator usage with STL algorithms, Boost.Range and Boost.Foreach. --- index/test/rtree/test_rtree.hpp | 91 +++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/index/test/rtree/test_rtree.hpp b/index/test/rtree/test_rtree.hpp index 12f5e61a5..75f787947 100644 --- a/index/test/rtree/test_rtree.hpp +++ b/index/test/rtree/test_rtree.hpp @@ -733,6 +733,38 @@ void copy_alt(First first, Last last, Out out) *out = *first; } +// test query iterators +template +void check_fwd_iterators(QItF first, QItL last) +{ + QItF vinit = QItF(); + BOOST_CHECK(vinit == last); + +#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL + QItL vinit2 = QItL(); + BOOST_CHECK(vinit2 == last); +#endif + + QItF def; + BOOST_CHECK(def == last); + +#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL + QItL def2; + BOOST_CHECK(def2 == last); +#endif + + QItF it = first; + for ( ; it != last && first != last ; ++it, ++first) + { + BOOST_CHECK(it == first); + + bg::index::equal_to::value_type> eq; + BOOST_CHECK(eq(*it, *first)); + } + BOOST_CHECK(it == last); + BOOST_CHECK(first == last); +} + // spatial query template @@ -766,6 +798,8 @@ void spatial_query(Rtree & rtree, Predicates const& pred, std::vector con exactly_the_same_outputs(rtree, output3, output4); + check_fwd_iterators(rtree.qbegin(pred), rtree.qend()); + #ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL { std::vector output4; @@ -774,6 +808,9 @@ void spatial_query(Rtree & rtree, Predicates const& pred, std::vector con output4.clear(); copy_alt(rtree.qbegin_(pred), rtree.qend_(), std::back_inserter(output4)); compare_outputs(rtree, output4, expected_output); + + check_fwd_iterators(rtree.qbegin_(pred), rtree.qend_(pred)); + check_fwd_iterators(rtree.qbegin_(pred), rtree.qend_()); } #endif } @@ -1217,6 +1254,8 @@ inline void nearest_query_k(Rtree const& rtree, std::vector const& input, compare_nearest_outputs(rtree, output3, expected_output, pt, greatest_distance); check_sorted_by_distance(rtree, output3, pt); + check_fwd_iterators(rtree.qbegin(bgi::nearest(pt, k)), rtree.qend()); + #ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL { std::vector output4; @@ -1225,6 +1264,9 @@ inline void nearest_query_k(Rtree const& rtree, std::vector const& input, output4.clear(); copy_alt(rtree.qbegin_(bgi::nearest(pt, k)), rtree.qend_(), std::back_inserter(output4)); exactly_the_same_outputs(rtree, output4, output3); + + check_fwd_iterators(rtree.qbegin_(bgi::nearest(pt, k)), rtree.qend_(bgi::nearest(pt, k))); + check_fwd_iterators(rtree.qbegin_(bgi::nearest(pt, k)), rtree.qend_()); } #endif } @@ -1580,6 +1622,31 @@ void clear(Rtree const& tree, std::vector const& input, Box const& qbox) } } +template +void range(Rtree & tree, std::vector const& input) +{ + check_fwd_iterators(tree.begin(), tree.end()); + + size_t count = std::distance(tree.begin(), tree.end()); + BOOST_CHECK(count == tree.size()); + BOOST_CHECK(count == input.size()); + + count = std::distance(boost::begin(tree), boost::end(tree)); + BOOST_CHECK(count == tree.size()); + + count = boost::size(tree); + BOOST_CHECK(count == tree.size()); + + count = 0; + BOOST_FOREACH(Value const& v, tree) + { + boost::ignore_unused(v); + ++count; + } + BOOST_CHECK(count == tree.size()); + +} + // rtree queries template @@ -1806,12 +1873,36 @@ void test_rtree_bounds(Parameters const& parameters, Allocator const& allocator) BOOST_CHECK(bg::equals(t.bounds(), b)); } +// test rtree iterator + +template +void test_rtree_range(Parameters const& parameters, Allocator const& allocator) +{ + typedef std::pair Value; + + typedef bgi::indexable I; + typedef bgi::equal_to E; + typedef typename Allocator::template rebind::other A; + typedef bgi::rtree Tree; + typedef typename Tree::bounds_type B; + + Tree t(parameters, I(), E(), allocator); + std::vector input; + B qbox; + + generate::rtree(t, input, qbox); + + basictest::range(t, input); + basictest::range((Tree const&)t, input); +} + template void test_rtree_additional(Parameters const& parameters, Allocator const& allocator) { test_count_rtree_values(parameters, allocator); test_rtree_count(parameters, allocator); test_rtree_bounds(parameters, allocator); + test_rtree_range(parameters, allocator); } // run all tests for one Algorithm for some number of rtrees From 5d714f94e222ade6856e1fb45d6a07babce0bffa Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sat, 4 Apr 2015 19:53:34 +0200 Subject: [PATCH 28/32] [index][doc] Improve the description of iterator and query related functions. Add info about the iterator category. Add more examples. Add missing doxygen groups for free functions. --- include/boost/geometry/index/rtree.hpp | 176 ++++++++++++++++++++++--- 1 file changed, 155 insertions(+), 21 deletions(-) diff --git a/include/boost/geometry/index/rtree.hpp b/include/boost/geometry/index/rtree.hpp index b9dbd5704..84c4da8a2 100644 --- a/include/boost/geometry/index/rtree.hpp +++ b/include/boost/geometry/index/rtree.hpp @@ -222,13 +222,13 @@ public: /*! \brief Unsigned integral type used by the container. */ typedef typename allocators_type::size_type size_type; - /*! \brief Type of const iterator. */ + /*! \brief Type of const iterator, category ForwardIterator. */ typedef index::detail::rtree::iterators::iterator < value_type, options_type, translator_type, box_type, allocators_type > const_iterator; - /*! \brief Type of const query iterator. */ + /*! \brief Type of const query iterator, category ForwardIterator. */ typedef index::detail::rtree::iterators::query_iterator < value_type, allocators_type @@ -777,6 +777,27 @@ public: tree.query(bgi::overlaps(box) && bgi::satisfies(my_fun), std::back_inserter(result)); // return 5 elements nearest to pt and elements are intersecting box tree.query(bgi::nearest(pt, 5) && bgi::intersects(box), std::back_inserter(result)); + + // For each found value do_something (it is a type of function object) + tree.query(bgi::intersects(box), + boost::make_function_output_iterator(do_something())); + + // For each value stored in the rtree do_something + // always_true is a type of function object always returning true + tree.query(bgi::satisfies(always_true()), + boost::make_function_output_iterator(do_something())); + + // C++11 (lambda expression) + tree.query(bgi::intersects(box), + boost::make_function_output_iterator([](value_type const& val){ + // do something + })); + + // C++14 (generic lambda expression) + tree.query(bgi::intersects(box), + boost::make_function_output_iterator([](auto const& val){ + // do something + })); \endverbatim \par Throws @@ -785,7 +806,7 @@ public: \warning Only one \c nearest() perdicate may be passed to the query. Passing more of them results in compile-time error. - + \param predicates Predicates. \param out_it The output iterator, e.g. generated by std::back_inserter(). @@ -805,11 +826,11 @@ public: } /*! - \brief Returns the query iterator pointing at the begin of the query range. + \brief Returns a query iterator pointing at the begin of the query range. + + This method returns an iterator which may be used to perform iterative queries. + For the information about predicates which may be passed to this method see query(). - This method returns the iterator which may be used to perform iterative queries. For the information - about the predicates which may be passed to this method see query(). - \par Example \verbatim for ( Rtree::const_query_iterator it = tree.qbegin(bgi::nearest(pt, 10000)) ; @@ -819,8 +840,22 @@ public: if ( has_enough_nearest_values() ) break; } + + // C++11 (auto) + for ( auto it = tree.qbegin(bgi::nearest(pt, 3)) ; it != tree.qend() ; ++it ) + { + // do something with value + } + + // C++14 (generic lambda expression) + std::for_each(tree.qbegin(bgi::nearest(pt, 3)), tree.qend(), [](auto const& val){ + // do something with value + }); \endverbatim + \par Iterator category + ForwardIterator + \par Throws If predicates copy throws. If allocation throws. @@ -839,10 +874,10 @@ public: } /*! - \brief Returns the query iterator pointing at the end of the query range. + \brief Returns a query iterator pointing at the end of the query range. + + This method returns an iterator which may be used to check if the query has ended. - This method returns the iterator which may be used to check if the query has ended. - \par Example \verbatim for ( Rtree::const_query_iterator it = tree.qbegin(bgi::nearest(pt, 10000)) ; @@ -852,8 +887,22 @@ public: if ( has_enough_nearest_values() ) break; } + + // C++11 (auto) + for ( auto it = tree.qbegin(bgi::nearest(pt, 3)) ; it != tree.qend() ; ++it ) + { + // do something with value + } + + // C++14 (generic lambda expression) + std::for_each(tree.qbegin(bgi::nearest(pt, 3)), tree.qend(), [](auto const& val){ + // do something with value + }); \endverbatim + \par Iterator category + ForwardIterator + \par Throws Nothing @@ -871,10 +920,10 @@ public: private: #endif /*! - \brief Returns the query iterator pointing at the begin of the query range. + \brief Returns a query iterator pointing at the begin of the query range. - This method returns the iterator which may be used to perform iterative queries. For the information - about the predicates which may be passed to this method see query(). + This method returns an iterator which may be used to perform iterative queries. + For the information about predicates which may be passed to this method see query(). The type of the returned iterator depends on the type of passed Predicates but the iterator of this type may be assigned to the variable of const_query_iterator type. If you'd like to use the type of the iterator @@ -884,16 +933,24 @@ private: \par Example \verbatim // Store the result in the container using std::copy() - it requires both iterators of the same type - std::copy(tree.qbegin(bgi::intersects(box)), tree.qend(bgi::intersects(box)), std::back_inserter(result)); + std::copy(tree.qbegin_(bgi::intersects(box)), tree.qend_(bgi::intersects(box)), std::back_inserter(result)); // Store the result in the container using std::copy() and type-erased iterators - Rtree::const_query_iterator first = tree.qbegin(bgi::intersects(box)); - Rtree::const_query_iterator last = tree.qend(); + Rtree::const_query_iterator first = tree.qbegin_(bgi::intersects(box)); + Rtree::const_query_iterator last = tree.qend_(); std::copy(first, last, std::back_inserter(result)); // Boost.Typeof typedef BOOST_TYPEOF(tree.qbegin(bgi::nearest(pt, 10000))) Iter; - for ( Iter it = tree.qbegin(bgi::nearest(pt, 10000)) ; it != tree.qend() ; ++it ) + for ( Iter it = tree.qbegin_(bgi::nearest(pt, 10000)) ; it != tree.qend_() ; ++it ) + { + // do something with value + if ( has_enough_nearest_values() ) + break; + } + + // C++11 (auto) + for ( auto it = tree.qbegin_(bgi::nearest(pt, 10000)) ; it != tree.qend_() ; ++it ) { // do something with value if ( has_enough_nearest_values() ) @@ -901,10 +958,16 @@ private: } \endverbatim + \par Iterator category + ForwardIterator + \par Throws If predicates copy throws. If allocation throws. + \warning + The modification of the rtree may invalidate the iterators. + \param predicates Predicates. \return The iterator pointing at the begin of the query range. @@ -954,12 +1017,18 @@ private: \par Example \verbatim // Store the result in the container using std::copy() - it requires both iterators of the same type - std::copy(tree.qbegin(bgi::intersects(box)), tree.qend(bgi::intersects(box)), std::back_inserter(result)); + std::copy(tree.qbegin_(bgi::intersects(box)), tree.qend_(bgi::intersects(box)), std::back_inserter(result)); \endverbatim + \par Iterator category + ForwardIterator + \par Throws If predicates copy throws. + \warning + The modification of the rtree may invalidate the iterators. + \param predicates Predicates. \return The iterator pointing at the end of the query range. @@ -1006,13 +1075,21 @@ private: \par Example \verbatim // Store the result in the container using std::copy() and type-erased iterators - Rtree::const_query_iterator first = tree.qbegin(bgi::intersects(box)); - Rtree::const_query_iterator last = tree.qend(); + Rtree::const_query_iterator first = tree.qbegin_(bgi::intersects(box)); + Rtree::const_query_iterator last = tree.qend_(); std::copy(first, last, std::back_inserter(result)); // Boost.Typeof typedef BOOST_TYPEOF(tree.qbegin(bgi::nearest(pt, 10000))) Iter; - for ( Iter it = tree.qbegin(bgi::nearest(pt, 10000)) ; it != tree.qend() ; ++it ) + for ( Iter it = tree.qbegin_(bgi::nearest(pt, 10000)) ; it != tree.qend_() ; ++it ) + { + // do something with value + if ( has_enough_nearest_values() ) + break; + } + + // C++11 (auto) + for ( auto it = tree.qbegin_(bgi::nearest(pt, 10000)) ; it != tree.qend_() ; ++it ) { // do something with value if ( has_enough_nearest_values() ) @@ -1020,8 +1097,14 @@ private: } \endverbatim + \par Iterator category + ForwardIterator + \par Throws Nothing + + \warning + The modification of the rtree may invalidate the iterators. \return The iterator pointing at the end of the query range. */ @@ -1041,12 +1124,29 @@ public: \par Example \verbatim + // Copy all values into the vector + std::copy(tree.begin(), tree.end(), std::back_inserter(vec)); + for ( Rtree::const_iterator it = tree.begin() ; it != tree.end() ; ++it ) { // do something with value } + + // C++11 (auto) + for ( auto it = tree.begin() ; it != tree.end() ; ++it ) + { + // do something with value + } + + // C++14 (generic lambda expression) + std::for_each(tree.begin(), tree.end(), [](auto const& val){ + // do something with value + }) \endverbatim + \par Iterator category + ForwardIterator + \par Throws If allocation throws. @@ -1075,8 +1175,16 @@ public: { // do something with value } + + // C++11 (lambda expression) + std::for_each(tree.begin(), tree.end(), [](value_type const& val){ + // do something with value + }) \endverbatim + \par Iterator category + ForwardIterator + \par Throws Nothing. @@ -1837,6 +1945,10 @@ bgi::query(tree, bgi::intersects(poly) && !bgi::within(box), std::back_inserter( bgi::query(tree, bgi::overlaps(box) && bgi::satisfies(my_fun), std::back_inserter(result)); // return 5 elements nearest to pt and elements are intersecting box bgi::query(tree, bgi::nearest(pt, 5) && bgi::intersects(box), std::back_inserter(result)); + +// For each found value do_something (it is a type of function object) +tree.query(bgi::intersects(box), + boost::make_function_output_iterator(do_something())); \endverbatim \par Throws @@ -1874,10 +1986,16 @@ about the predicates which may be passed to this method see query(). std::for_each(bgi::qbegin(tree, bgi::nearest(pt, 3)), bgi::qend(tree), do_something()); \endverbatim +\par Iterator category +ForwardIterator + \par Throws If predicates copy throws. If allocation throws. +\warning +The modification of the rtree may invalidate the iterators. + \ingroup rtree_functions \param tree The rtree. @@ -1904,9 +2022,15 @@ This method returns the iterator which may be used to check if the query has end std::for_each(bgi::qbegin(tree, bgi::nearest(pt, 3)), bgi::qend(tree), do_something()); \endverbatim +\par Iterator category +ForwardIterator + \par Throws Nothing +\warning +The modification of the rtree may invalidate the iterators. + \ingroup rtree_functions \return The iterator pointing at the end of the query range. @@ -1931,12 +2055,17 @@ std::for_each(bgi::begin(tree), bgi::end(tree), do_something()); std::for_each(boost::begin(tree), boost::end(tree), do_something()); \endverbatim +\par Iterator category +ForwardIterator + \par Throws If allocation throws. \warning The modification of the rtree may invalidate the iterators. +\ingroup rtree_functions + \return The iterator pointing at the begin of the range. */ template inline @@ -1959,12 +2088,17 @@ std::for_each(bgi::begin(tree), bgi::end(tree), do_something()); std::for_each(boost::begin(tree), boost::end(tree), do_something()); \endverbatim +\par Iterator category +ForwardIterator + \par Throws Nothing. \warning The modification of the rtree may invalidate the iterators. +\ingroup rtree_functions + \return The iterator pointing at the end of the range. */ template inline From 91549ce707b8c91838a1396dfe5f24a1f0a9c1ae Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sat, 4 Apr 2015 19:56:23 +0200 Subject: [PATCH 29/32] [doc] Add 1.59 release notes (rtree iterators). --- doc/release_notes.qbk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/release_notes.qbk b/doc/release_notes.qbk index fdbc82768..8c28368f2 100644 --- a/doc/release_notes.qbk +++ b/doc/release_notes.qbk @@ -18,6 +18,22 @@ [section:release_notes Release Notes] +[/=================] +[heading Boost 1.59] +[/=================] + +[*Additional functionality] + +* Added rtree const_iterator, begin(), end() and the support for Boost.Range. + +[*Improvements] + +* Upgraded rtree const_query_iterator category to ForwardIterator. + +[*Solved tickets] + +* [@https://svn.boost.org/trac/boost/ticket/11113 11113] Support easy enumeration of all elements with BOOST_FOREACH + [/=================] [heading Boost 1.58] [/=================] From 65fa7653babe995cd6d0e6fdde37a87022ed4902 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Wed, 8 Apr 2015 14:18:40 +0200 Subject: [PATCH 30/32] [algorithms][distance][is_valid] Explicitly get const iterators. --- .../distance/geometry_to_segment_or_box.hpp | 23 +++++++++---------- .../detail/is_valid/has_duplicates.hpp | 11 +++++---- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp b/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp index ec5296c35..d6de7cac9 100644 --- a/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp @@ -185,10 +185,10 @@ public: Geometry const > segment_iterator_type; - typedef typename std::vector + typedef typename boost::range_const_iterator < - segment_or_box_point - >::const_iterator seg_or_box_iterator_type; + std::vector + >::type seg_or_box_const_iterator; typedef assign_new_min_iterator assign_new_value; @@ -219,8 +219,8 @@ public: // segment or box comparable_return_type cd_min1(0); point_iterator_type pit_min; - seg_or_box_iterator_type it_min1 = seg_or_box_points.begin(); - seg_or_box_iterator_type it_min2 = it_min1; + seg_or_box_const_iterator it_min1 = boost::const_begin(seg_or_box_points); + seg_or_box_const_iterator it_min2 = it_min1; ++it_min2; bool first = true; @@ -230,11 +230,11 @@ public: comparable_return_type cd; std::pair < - seg_or_box_iterator_type, seg_or_box_iterator_type + seg_or_box_const_iterator, seg_or_box_const_iterator > it_pair = point_to_point_range::apply(*pit, - seg_or_box_points.begin(), - seg_or_box_points.end(), + boost::const_begin(seg_or_box_points), + boost::const_end(seg_or_box_points), cstrategy, cd); @@ -251,12 +251,11 @@ public: // segments of the geometry comparable_return_type cd_min2(0); segment_iterator_type sit_min; - typename std::vector::const_iterator it_min; + seg_or_box_const_iterator it_min; first = true; - for (typename std::vector::const_iterator it - = seg_or_box_points.begin(); - it != seg_or_box_points.end(); ++it, first = false) + for (seg_or_box_const_iterator it = boost::const_begin(seg_or_box_points); + it != boost::const_end(seg_or_box_points); ++it, first = false) { comparable_return_type cd; segment_iterator_type sit diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp index 7527aa521..6aa8c98c9 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp @@ -36,7 +36,10 @@ struct has_duplicates static inline bool apply(Range const& range, VisitPolicy& visitor) { typedef typename closeable_view::type view_type; - typedef typename boost::range_iterator::type iterator; + typedef typename boost::range_const_iterator + < + view_type const + >::type const_iterator; view_type view(range); @@ -47,10 +50,10 @@ struct has_duplicates geometry::equal_to::type> equal; - iterator it = boost::begin(view); - iterator next = it; + const_iterator it = boost::const_begin(view); + const_iterator next = it; ++next; - for (; next != boost::end(view); ++it, ++next) + for (; next != boost::const_end(view); ++it, ++next) { if ( equal(*it, *next) ) { From fccb4543a39527362452140e672998f717eabbff Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Wed, 8 Apr 2015 14:20:20 +0200 Subject: [PATCH 31/32] [iterators] Remove unneeded else branch in flatten_iterator. --- include/boost/geometry/iterators/flatten_iterator.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/boost/geometry/iterators/flatten_iterator.hpp b/include/boost/geometry/iterators/flatten_iterator.hpp index 3243f6f0e..da564f116 100644 --- a/include/boost/geometry/iterators/flatten_iterator.hpp +++ b/include/boost/geometry/iterators/flatten_iterator.hpp @@ -216,12 +216,8 @@ private: } while ( empty(m_outer_it) ); m_inner_it = AccessInnerEnd::apply(*m_outer_it); - --m_inner_it; - } - else - { - --m_inner_it; - } + } + --m_inner_it; } }; From f6a95d92296051338c6119be891f3a28f609dbb1 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Fri, 10 Apr 2015 14:21:30 +0200 Subject: [PATCH 32/32] [test][buffer] Add failing test for MultiLinestring. --- test/algorithms/buffer/multi_linestring_buffer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/algorithms/buffer/multi_linestring_buffer.cpp b/test/algorithms/buffer/multi_linestring_buffer.cpp index 0f125f064..1f09ceeb8 100644 --- a/test/algorithms/buffer/multi_linestring_buffer.cpp +++ b/test/algorithms/buffer/multi_linestring_buffer.cpp @@ -29,6 +29,7 @@ static std::string const mikado2 = "MULTILINESTRING((-6.117647058823528993798390 static std::string const mikado3 = "MULTILINESTRING((1 18,4.0559006211180124168436122999992 7.8136645962732922399140989000443),(6.7243816254416959310447055031545 -1.0812720848056533995418249105569,7 -2,7 -8,14 3.6666666666666669627261399000417),(15.297872340425531234586742357351 5.8297872340425538340014099958353,16 7,15.214285714285713524418497399893 5.8445378151260509724806979647838),(13.685863874345550073030608473346 3.5968586387434555717845796607435,-1 -18,-3.7900797165633304253162805252941 -11.117803365810452476125647081062),(-11.540540540540540348501963308081 8,-16 19,8 14),(1 -10,6.5999999999999996447286321199499 -1.200000000000000177635683940025),(11.5 6.5,15 12),(19 10,11.564231738035264385189293534495 6.4886649874055422060337150469422),(-13.438785504407443127661281323526 -5.3183153770812925387190261972137,-17 -7,-12.970074812967581578959652688354 -7.7556109725685784539450651209336),(-2.3532338308457703135445626685396 -9.7462686567164187323442092747428,-1 -10,12.285714285714286475581502600107 3.2857142857142864755815026001073),(14.90000000000000035527136788005 5.9000000000000003552713678800501,15 6,14.893004115226338157640384451952 5.9012345679012341292946075554937),(11.987804878048780921062643756159 3.2195121951219514144781896902714,-11 -18),(-12.210826210826210669324609625619 -11.703703703703702387883822666481,-15 -15,-11.463576158940396609864365018439 -15.589403973509934786534358863719),(-8.9189189189189193029960733838379 -16.013513513513512265262761502527,-3 -17,-7.0297239915074314353660156484693 -14.210191082802548834251865628175),(-12.450511945392491952588898129761 -10.457337883959045399251408525743,-16 -8,-12.923076923076923350208744523115 -8),(-0.52380952380952372493538859998807 -8,18 -8),(2 -19,-2.2961165048543685784920853620861 -9.6917475728155331182733789319173),(6.0463576158940393057150686217938 -1.7284768211920527036795647291001,7 -3,6.4482758620689653028534848999698 -1.3448275862068967967388744000345),(-1.3333333333333339254522798000835 8,4 16,2.9090909090909091716525836091023 8),(0.64705882352941168633719826175366 -6.8823529411764710062016092706472,-3 -16))"; static std::string const mikado4 = "MULTILINESTRING((-15 2,-15 -17,-6 11,-1.9358288770053475591481628725887 10.572192513368984023713892383967),(2.1545064377682408007785852532834 10.14163090128755406738036981551,6.87603305785123986026974307606 9.6446280991735537924114396446384),(8.4810810810810810522752944962122 9.475675675675674369813350494951,13 9),(-15 0,-8 9,-2.9850746268656713766631582984701 4.4865671641791049495395782287233),(-1.8235294117647056211239942058455 3.4411764705882355031008046353236,-1.1428571428571423496123315999284 2.8285714285714291804652020800859),(1.2307692307692308375521861307789 0.69230769230769229061195346730528,1.2857142857142858094476878250134 0.64285714285714290472384391250671,2 0,1.9459459459459460539676456392044 0.51351351351351348650808859019889),(1.908127208480565384363103476062 0.87279151943462895957281943992712,1.9078014184397162900097555393586 0.87588652482269502286271745106205),(1.4685990338164249813246442499803 5.0483091787439615671928550000302,0.63551401869158885560295857430901 12.962616822429906093816498469096,0 19,2.9565217391304345895264304999728 8.6521739130434784925682834000327),(0 19,3.4942528735632185643567027000245 6.770114942528735468840750399977),(4.75 2.375,5.2427184466019420838733822165523 0.65048543689320226235395239200443),(5.5384615384615383248956277384423 -0.38461538461538458122390693461057,5.7358490566037731994697423942853 -1.0754716981132084185901476303115),(5.9777777777777778567269706400111 -1.9222222222222207221875578397885,6.867052023121386739035187929403 -5.0346820809248553629799971531611,10 -16,-14 -19,-12 -12),(0 10,1.9476439790575916788384347455576 5.4554973821989527493769855936989),(-4 1,-4.2790697674418600726653494348284 0.16279069767441856075862460784265))"; +static std::string const mysql_15_04_10 = "MULTILINESTRING((-58 19, 61 88),(1.922421e+307 1.520384e+308, 15 42, 89 -93,-89 -22),(-63 -5, -262141 -536870908, -3 87, 77 -69))"; template void test_all() @@ -97,6 +98,10 @@ void test_all() test_one("mikado4_large", mikado4, join_round32, end_round32, 11212832197.267, 59772.0); test_one("mikado4_small", mikado4, join_round32, end_round32, 2103.686, 10.0); test_one("mikado4_small", mikado4, join_round32, end_flat, 1930.785, 10.0); + +#ifdef BOOST_GEOMETRY_BUFFER_INCLUDE_FAILING_TESTS + test_one("mysql_15_04_10", mysql_15_04_10, join_round32, end_round32, 29151950703.779/*something big*/, 0x98); +#endif }