|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63580 - sandbox/geometry/boost/geometry/multi/algorithms
From: barend.gehrels_at_[hidden]
Date: 2010-07-04 06:07:22
Author: barendgehrels
Date: 2010-07-04 06:07:22 EDT (Sun, 04 Jul 2010)
New Revision: 63580
URL: http://svn.boost.org/trac/boost/changeset/63580
Log:
Added non-const version of get_section
Major changes in distance strategies
Changed double from simplify to template parameter
Added a promote_floating_point
Added a fp_coordinate_type
Added namespaced point in custom example
Added mpl assertion in overlaps (should be done in most algorithms by default)
Added high precision test for various distance algorithms
Text files modified:
sandbox/geometry/boost/geometry/multi/algorithms/distance.hpp | 29 +++++++++--------------------
1 files changed, 9 insertions(+), 20 deletions(-)
Modified: sandbox/geometry/boost/geometry/multi/algorithms/distance.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/multi/algorithms/distance.hpp (original)
+++ sandbox/geometry/boost/geometry/multi/algorithms/distance.hpp 2010-07-04 06:07:22 EDT (Sun, 04 Jul 2010)
@@ -34,31 +34,26 @@
struct distance_single_to_multi
{
typedef typename Strategy::return_type return_type;
+
static inline return_type apply(Geometry const& geometry,
MultiGeometry const& multi,
Strategy const& strategy)
{
using namespace boost;
- return_type mindist = make_distance_result<return_type>(
- numeric::bounds
- <
- typename select_coordinate_type
- <
- Geometry,
- MultiGeometry
- >::type
- >::highest());
+ bool first = true;
+ return_type mindist;
for(typename range_iterator<MultiGeometry const>::type it = begin(multi);
it != end(multi);
++it)
{
return_type dist = geometry::distance(geometry, *it);
- if (dist < mindist)
+ if (first || dist < mindist)
{
mindist = dist;
}
+ first = false;
}
return mindist;
@@ -75,15 +70,8 @@
{
using namespace boost;
- return_type mindist = make_distance_result<return_type>(
- numeric::bounds
- <
- typename select_coordinate_type
- <
- Multi1,
- Multi2
- >::type
- >::highest());
+ bool first = true;
+ return_type mindist;
for(typename range_iterator<Multi1 const>::type it = begin(multi1);
it != end(multi1);
@@ -95,10 +83,11 @@
Multi2,
Strategy
>::apply(*it, multi2, strategy);
- if (dist < mindist)
+ if (first || dist < mindist)
{
mindist = dist;
}
+ first = false;
}
return mindist;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk