@@ -210,7 +202,7 @@ void test_all()
test_forward("putp6", 4.897000, 52.371000, 324931.055842, 5842588.644796, "+proj=putp6 +ellps=WGS84 +units=m");
test_forward
("putp6p", 4.897000, 52.371000, 338623.512107, 6396742.919679, "+proj=putp6p +ellps=WGS84 +units=m");
test_forward
("qua_aut", 4.897000, 52.371000, 370892.621714, 5629072.862494, "+proj=qua_aut +ellps=WGS84 +units=m");
- test_forward
("robin", 4.897000, 52.371000, 394576.507489, 5571243.439235, "+proj=robin +ellps=WGS84 +units=m");
+ test_forward
("robin", 4.897000, 52.371000, 394576.507489, 5570940.631371, "+proj=robin +ellps=WGS84 +units=m");
test_forward
("rouss", 4.897000, 52.371000, 412826.227669, 6248368.849775, "+proj=rouss +ellps=WGS84 +units=m");
test_forward
("rpoly", 4.897000, 52.371000, 332447.130797, 5841164.662431, "+proj=rpoly +ellps=WGS84 +units=m");
test_forward
("sinu", 4.897000, 52.371000, 333528.909809, 5804625.044313, "+proj=sinu +ellps=WGS84 +units=m");
@@ -325,7 +317,7 @@ void test_all()
test_inverse
("putp6", 324931.055842, 5842588.644796, 4.897000, 52.371000, "+proj=putp6 +ellps=WGS84 +units=m");
test_inverse
("putp6p", 338623.512107, 6396742.919679, 4.897000, 52.371000, "+proj=putp6p +ellps=WGS84 +units=m");
test_inverse
("qua_aut", 370892.621714, 5629072.862494, 4.897000, 52.371000, "+proj=qua_aut +ellps=WGS84 +units=m");
- test_inverse
("robin", 394576.507489, 5571243.439235, 4.897000, 52.371000, "+proj=robin +ellps=WGS84 +units=m");
+ test_inverse
("robin", 394576.507489, 5570940.631371, 4.897000, 52.371000, "+proj=robin +ellps=WGS84 +units=m");
test_inverse
("rouss", 412826.227669, 6248368.849775, 4.959853, 52.433747, "+proj=rouss +ellps=WGS84 +units=m"); // F/I: 8188.459174
test_inverse
("sinu", 333528.909809, 5804625.044313, 4.897000, 52.371000, "+proj=sinu +ellps=WGS84 +units=m");
test_inverse
("somerc", 545131.546415, 6833623.829215, 4.897000, 52.371000, "+proj=somerc +ellps=WGS84 +units=m");
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_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;
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/buffer/turn_in_piece_visitor.hpp b/include/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp
index a7731549d..8803efdec 100644
--- a/include/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp
+++ b/include/boost/geometry/algorithms/detail/buffer/turn_in_piece_visitor.hpp
@@ -9,6 +9,9 @@
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_TURN_IN_PIECE_VISITOR
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_TURN_IN_PIECE_VISITOR
+
+#include
+
#include
#include
@@ -172,7 +175,8 @@ public :
typename strategy_type::state_type state;
strategy_type strategy;
-
+ boost::ignore_unused(strategy);
+
for (std::size_t s = 0; s < piece.sections.size(); s++)
{
section_type const& section = piece.sections[s];
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..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,9 @@ 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 = ++seg_or_box_points.begin();
+ 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;
for (point_iterator_type pit = points_begin(geometry);
@@ -229,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);
@@ -250,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/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
{
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..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,9 +50,10 @@ struct has_duplicates
geometry::equal_to::type> equal;
- iterator it = boost::begin(view);
- iterator next = ++boost::begin(view);
- for (; next != boost::end(view); ++it, ++next)
+ const_iterator it = boost::const_begin(view);
+ const_iterator next = it;
+ ++next;
+ for (; next != boost::const_end(view); ++it, ++next)
{
if ( equal(*it, *next) )
{
diff --git a/include/boost/geometry/algorithms/detail/partition.hpp b/include/boost/geometry/algorithms/detail/partition.hpp
index 25a34ba2e..8b19add47 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,26 @@ 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
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)
+ 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,99 +85,109 @@ inline void divide_into_subsets(Box const& lower_box,
}
}
-template
-inline void expand_with_elements(Box& total,
- InputCollection const& collection,
- index_vector_type const& input)
+template
+<
+ typename ExpandPolicy,
+ typename Box,
+ typename IteratorVector
+>
+inline void expand_with_elements(Box& total, 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,
- Policy& policy)
+// Match forward_range with itself
+template
+inline void handle_one(IteratorVector const& input, Policy& policy)
{
if (boost::size(input) == 0)
{
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 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,
+inline void handle_two(IteratorVector1 const& input1,
+ 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 +204,7 @@ template
typename ExpandPolicy2,
typename VisitBoxPolicy
>
-class partition_two_collections;
+class partition_two_ranges;
template
@@ -204,79 +215,71 @@ 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(IteratorVector const& input)
{
Box box;
geometry::assign_inverse(box);
- expand_with_elements(box, collection, input);
+ expand_with_elements(box, input);
return box;
}
- template
+ template
static inline void next_level(Box const& box,
- InputCollection const& collection,
- index_vector_type const& input,
+ 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,
- level + 1, min_elements, policy, box_policy);
+ >::apply(box, input, level + 1, min_elements, policy, box_policy);
}
else
{
- handle_one(collection, input, policy);
+ handle_one(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
static inline void next_level2(Box const& box,
- InputCollection const& collection,
- index_vector_type const& input1,
- index_vector_type const& input2,
+ 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,
- level + 1, min_elements, policy, box_policy);
+ >::apply(box, input1, input2, level + 1, min_elements,
+ policy, box_policy);
}
else
{
- handle_two(collection, input1, collection, input2, policy);
+ handle_two(input1, input2, policy);
}
}
public :
- template
+ template
static inline void apply(Box const& box,
- InputCollection const& collection,
- index_vector_type const& input,
+ IteratorVector const& input,
std::size_t level,
std::size_t min_elements,
Policy& policy, VisitBoxPolicy& box_policy)
@@ -286,33 +289,31 @@ 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,
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(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,
- min_elements, policy, box_policy);
+ next_level(exceeding_box, 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,
- min_elements, policy, box_policy);
- next_level2(exceeding_box, collection, exceeding, upper, 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, 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, collection, lower, level, min_elements,
- policy, box_policy);
- next_level(upper_box, collection, 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);
}
};
@@ -326,25 +327,21 @@ 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 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,
+ IteratorVector1 const& input1,
+ 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,50 +350,38 @@ class partition_two_collections
ExpandPolicy1,
ExpandPolicy2,
VisitBoxPolicy
- >::apply(box, collection1, input1, collection2, input2,
- level + 1, min_elements,
- policy, box_policy);
+ >::apply(box, input1, input2, level + 1, min_elements,
+ policy, box_policy);
}
- template
- <
- typename ExpandPolicy,
- typename InputCollection
- >
- static inline Box get_new_box(InputCollection const& collection,
- index_vector_type const& input)
+ template
+ static inline Box get_new_box(IteratorVector const& input)
{
Box box;
geometry::assign_inverse(box);
- expand_with_elements(box, collection, input);
+ expand_with_elements(box, input);
return box;
}
- template
- <
- typename InputCollection1,
- typename InputCollection2
- >
- static inline Box get_new_box(InputCollection1 const& collection1,
- index_vector_type const& input1,
- InputCollection2 const& collection2,
- index_vector_type const& input2)
+ template
+ static inline Box get_new_box(IteratorVector1 const& input1,
+ IteratorVector2 const& input2)
{
- Box box = get_new_box(collection1, input1);
- expand_with_elements(box, collection2, input2);
+ Box box = get_new_box(input1);
+ expand_with_elements(box, input2);
return box;
}
public :
template
<
- typename InputCollection1,
- typename InputCollection2,
- typename Policy
+ 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,
+ IteratorVector1 const& input1,
+ IteratorVector2 const& input2,
std::size_t level,
std::size_t min_elements,
Policy& policy, VisitBoxPolicy& box_policy)
@@ -406,11 +391,11 @@ 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,
+ IteratorVector1 lower1, upper1, exceeding1;
+ IteratorVector2 lower2, upper2, exceeding2;
+ divide_into_subsets(lower_box, upper_box,
input1, lower1, upper1, exceeding1);
- divide_into_subsets(lower_box, upper_box, collection2,
+ divide_into_subsets(lower_box, upper_box,
input2, lower2, upper2, exceeding2);
if (boost::size(exceeding1) > 0)
@@ -419,35 +404,31 @@ 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,
- 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(collection1, exceeding1, collection2, exceeding2,
- policy);
+ handle_two(exceeding1, 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);
+ 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(collection1, exceeding1, collection2, lower2, policy);
- handle_two(collection1, exceeding1, collection2, upper2, policy);
+ handle_two(exceeding1, lower2, policy);
+ handle_two(exceeding1, upper2, policy);
}
}
@@ -456,37 +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(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);
+ 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(collection1, lower1, collection2, exceeding2, policy);
- handle_two(collection1, upper1, collection2, exceeding2, policy);
+ handle_two(lower1, exceeding2, policy);
+ handle_two(upper1, exceeding2, policy);
}
}
if (recurse_ok(lower1, lower2, min_elements, level))
{
- next_level(lower_box, collection1, lower1, collection2, lower2, level,
- min_elements, policy, box_policy);
+ next_level(lower_box, lower1, lower2, level,
+ min_elements, policy, box_policy);
}
else
{
- handle_two(collection1, lower1, collection2, lower2, policy);
+ handle_two(lower1, lower2, policy);
}
if (recurse_ok(upper1, upper2, min_elements, level))
{
- next_level(upper_box, collection1, upper1, collection2, upper2, level,
- min_elements, policy, box_policy);
+ next_level(upper_box, upper1, upper2, level,
+ min_elements, policy, box_policy);
}
else
{
- handle_two(collection1, upper1, collection2, upper2, policy);
+ handle_two(upper1, upper2, policy);
}
}
};
@@ -523,63 +503,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,
- visitor, box_visitor);
+ >::apply(total, 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 +573,55 @@ 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,
- 0, min_elements, visitor, box_visitor);
+ >::apply(total, iterator_vector1, 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);
diff --git a/include/boost/geometry/algorithms/detail/relate/result.hpp b/include/boost/geometry/algorithms/detail/relate/result.hpp
index c32877852..e26bda67f 100644
--- a/include/boost/geometry/algorithms/detail/relate/result.hpp
+++ b/include/boost/geometry/algorithms/detail/relate/result.hpp
@@ -236,11 +236,11 @@ struct interrupt_dispatch
static inline bool apply(Mask const& mask)
{
char m = mask.template get();
- return check(m);
+ return check_element(m);
}
template
- static inline bool check(char m)
+ static inline bool check_element(char m)
{
if ( BOOST_GEOMETRY_CONDITION(V >= '0' && V <= '9') )
{
@@ -395,7 +395,7 @@ inline bool may_update(Mask const& mask, Matrix const& matrix)
::template apply(mask, matrix);
}
-// check()
+// check_matrix()
template
struct check_dispatch
@@ -486,7 +486,7 @@ struct check_dispatch< boost::tuples::cons >
};
template
-inline bool check(Mask const& mask, Matrix const& matrix)
+inline bool check_matrix(Mask const& mask, Matrix const& matrix)
{
return check_dispatch::apply(mask, matrix);
}
@@ -547,7 +547,7 @@ public:
result_type result() const
{
return !interrupt
- && check(m_mask, static_cast(*this));
+ && check_matrix(m_mask, static_cast(*this));
}
template
@@ -965,7 +965,7 @@ struct static_check_dispatch
};
template
-struct static_check
+struct static_check_matrix
{
template
static inline bool apply(Matrix const& matrix)
@@ -998,7 +998,7 @@ public:
result_type result() const
{
return (!Interrupt || !interrupt)
- && static_check::
+ && static_check_matrix::
apply(static_cast(*this));
}
diff --git a/include/boost/geometry/extensions/contrib/ttmath_stub.hpp b/include/boost/geometry/extensions/contrib/ttmath_stub.hpp
index e2ade189b..014378e06 100644
--- a/include/boost/geometry/extensions/contrib/ttmath_stub.hpp
+++ b/include/boost/geometry/extensions/contrib/ttmath_stub.hpp
@@ -1,8 +1,13 @@
// 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 2014, 2015.
+// Modifications copyright (c) 2014-2015, Oracle and/or its affiliates.
+
+// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
@@ -83,7 +88,6 @@ namespace ttmath
return ACos(v);
}
-
template
inline Big atan2(Big const& y, Big const& x)
{
@@ -103,6 +107,13 @@ namespace ttmath
return two * ATan((sqrt(x * x + y * y) - x) / y);
}
+ // needed in order to work with boost::geometry::math::mod
+ template
+ inline Big mod(Big const& x,
+ Big const& y)
+ {
+ return Mod(x, y);
+ }
}
// Specific structure implementing constructor
@@ -116,18 +127,18 @@ struct ttmath_big : ttmath::Big<1,4>
: ttmath::Big<1,4>(v)
{}
+ // unary operator+() is implemented for completeness
+ inline ttmath_big const& operator+() const
+ {
+ return *this;
+ }
+
// needed in order to work with boost::geometry::math::abs
inline ttmath_big operator-() const
{
return ttmath::Big<1,4>::operator-();
}
- // needed because unary operator-() is defined (above)
- inline ttmath_big operator-(ttmath_big const& other) const
- {
- return ttmath::Big<1,4>::operator-(other);
- }
-
/*
inline operator double() const
{
@@ -141,6 +152,29 @@ struct ttmath_big : ttmath::Big<1,4>
*/
};
+
+// arithmetic operators for ttmath_big objects, defined as free functions
+inline ttmath_big operator+(ttmath_big const& x, ttmath_big const& y)
+{
+ return static_cast const&>(x).operator+(y);
+}
+
+inline ttmath_big operator-(ttmath_big const& x, ttmath_big const& y)
+{
+ return static_cast const&>(x).operator-(y);
+}
+
+inline ttmath_big operator*(ttmath_big const& x, ttmath_big const& y)
+{
+ return static_cast const&>(x).operator*(y);
+}
+
+inline ttmath_big operator/(ttmath_big const& x, ttmath_big const& y)
+{
+ return static_cast const&>(x).operator/(y);
+}
+
+
namespace boost{ namespace geometry { namespace math
{
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;
};
diff --git a/include/boost/geometry/extensions/gis/projections/proj/aeqd.hpp b/include/boost/geometry/extensions/gis/projections/proj/aeqd.hpp
index a0b599763..5e240ee1a 100644
--- a/include/boost/geometry/extensions/gis/projections/proj/aeqd.hpp
+++ b/include/boost/geometry/extensions/gis/projections/proj/aeqd.hpp
@@ -115,7 +115,7 @@ namespace boost { namespace geometry { namespace projections
ct = cos(t); st = sin(t);
Az = atan2(sin(lp_lon) * ct, this->m_proj_parm.cosph0 * st - this->m_proj_parm.sinph0 * coslam * ct);
cA = cos(Az); sA = sin(Az);
- s = aasin( fabs(sA) < TOL ?
+ s = aasin(fabs(sA) < TOL ?
(this->m_proj_parm.cosph0 * st - this->m_proj_parm.sinph0 * coslam * ct) / cA :
sin(lp_lon) * ct / sA );
H = this->m_proj_parm.He * cA;
diff --git a/include/boost/geometry/extensions/gis/projections/proj/aitoff.hpp b/include/boost/geometry/extensions/gis/projections/proj/aitoff.hpp
index dfa18b963..b20ca3fcb 100644
--- a/include/boost/geometry/extensions/gis/projections/proj/aitoff.hpp
+++ b/include/boost/geometry/extensions/gis/projections/proj/aitoff.hpp
@@ -135,6 +135,7 @@ namespace boost { namespace geometry { namespace projections
\par Projection characteristics
- Miscellaneous
- Spheroid
+ - no inverse
\par Example
\image html ex_aitoff.gif
*/
@@ -156,6 +157,7 @@ namespace boost { namespace geometry { namespace projections
\par Projection characteristics
- Miscellaneous
- Spheroid
+ - no inverse
- lat_1
\par Example
\image html ex_wintri.gif
diff --git a/include/boost/geometry/extensions/gis/projections/proj/goode.hpp b/include/boost/geometry/extensions/gis/projections/proj/goode.hpp
index 56204bf83..2058f2c47 100644
--- a/include/boost/geometry/extensions/gis/projections/proj/goode.hpp
+++ b/include/boost/geometry/extensions/gis/projections/proj/goode.hpp
@@ -41,7 +41,6 @@
#include
#include
#include