Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75083 - in sandbox/gtl: boost/polygon boost/polygon/detail libs/polygon/test
From: sydorchuk.andriy_at_[hidden]
Date: 2011-10-21 17:03:14


Author: asydorchuk
Date: 2011-10-21 17:03:09 EDT (Fri, 21 Oct 2011)
New Revision: 75083
URL: http://svn.boost.org/trac/boost/changeset/75083

Log:
Removing obsolet comments from the detail.
Minor refactoring of the gmp sss circle formation functor.
Text files modified:
   sandbox/gtl/boost/polygon/detail/voronoi_calc_kernel.hpp | 188 ++++++++++++++-------------------------
   sandbox/gtl/boost/polygon/detail/voronoi_fpt_kernel.hpp | 172 ++++++++++++++++++++----------------
   sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp | 84 +++++------------
   sandbox/gtl/boost/polygon/voronoi_builder.hpp | 5
   sandbox/gtl/libs/polygon/test/voronoi_fpt_kernel_test.cpp | 98 +++++++++-----------
   sandbox/gtl/libs/polygon/test/voronoi_structures_test.cpp | 2
   6 files changed, 234 insertions(+), 315 deletions(-)

Modified: sandbox/gtl/boost/polygon/detail/voronoi_calc_kernel.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/voronoi_calc_kernel.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/voronoi_calc_kernel.hpp 2011-10-21 17:03:09 EDT (Fri, 21 Oct 2011)
@@ -1,4 +1,4 @@
-// Boost polygon/detail/voronoi_calc_kernel.hpp header file
+// Boost.Polygon library detail/voronoi_calc_kernel.hpp header file
 
 // Copyright Andrii Sydorchuk 2010-2011.
 // Distributed under the Boost Software License, Version 1.0.
@@ -23,44 +23,8 @@
 template <typename T>
 class voronoi_calc_kernel;
 
-// Geometry predicates with floating-point variables usually require
-// high-precision predicates to retrieve the correct result.
-// Epsilon robust predicates give the result within some epsilon relative
-// error, but are a lot faster than high-precision predicates.
-// To make algorithm robust and efficient epsilon robust predicates are
-// used at the first step. In case of the undefined result high-precision
-// arithmetic is used to produce required robustness. This approach
-// requires exact computation of epsilon intervals within which epsilon
-// robust predicates have undefined value.
-// There are two ways to measure an error of floating-point calculations:
-// relative error and ULPs(units in the last place).
-// Let EPS be machine epsilon, then next inequalities have place:
-// 1 EPS <= 1 ULP <= 2 EPS (1), 0.5 ULP <= 1 EPS <= 1 ULP (2).
-// ULPs are good for measuring rounding errors and comparing values.
-// Relative erros are good for computation of general relative
-// errors of formulas or expressions. So to calculate epsilon
-// intervals within which epsilon robust predicates have undefined result
-// next schema is used:
-// 1) Compute rounding errors of initial variables using ULPs;
-// 2) Transform ULPs to epsilons using upper bound of the (1);
-// 3) Compute relative error of the formula using epsilon arithmetic;
-// 4) Transform epsilon to ULPs using upper bound of the (2);
-// In case two values are inside undefined ULP range use high-precision
-// arithmetic to produce the correct result, else output the result.
-// Look at almost_equal function to see how two floating-point variables
-// are checked to fit in the ULP range.
-// If A has relative error of r(A) and B has relative error of r(B) then:
-// 1) r(A + B) <= max(r(A), r(B)), for A * B >= 0;
-// 2) r(A - B) <= B*r(A)+A*r(B)/(A-B), for A * B >= 0;
-// 2) r(A * B) <= r(A) + r(B);
-// 3) r(A / B) <= r(A) + r(B);
-// In addition rounding error should be added, that is always equal to
-// 0.5 ULP or atmost 1 epsilon. As you might see from the above formulas
-// substraction relative error may be extremely large, that's why
-// epsilon robust comparator class is used to store floating point values
-// and avoid substraction.
-// For further information about relative errors and ULPs try this link:
-// http://docs.sun.com/source/806-3568/ncg_goldberg.html
+// Predicates kernel. Operates with the types that could
+// be converted to the int32 without precision loss.
 template <>
 class voronoi_calc_kernel<int> {
 public:
@@ -78,7 +42,7 @@
         LEFT = 1,
     };
 
- // Value is a determinant of two vectors.
+ // Value is a determinant of two vectors (e.g. x1 * y2 - x2 * y1).
     // Return orientation based on the sign of the determinant.
     template <typename T>
     static kOrientation get_orientation(T value) {
@@ -108,7 +72,6 @@
         if ((expr_l_plus == expr_r_plus) && (expr_l == expr_r))
             return static_cast<fpt_type>(0.0);
 
- // Produce the result with epsilon relative error.
         if (!expr_l_plus) {
             if (expr_r_plus)
                 return -static_cast<fpt_type>(expr_l) -
@@ -127,23 +90,11 @@
         }
     }
 
- // Robust orientation test. Works correctly for any input type that
- // can be casted without lose of data to the integer type within a range
- // [-2^32, 2^32-1].
- // Arguments: dif_x1_, dif_y1 - coordinates of the first vector.
- // dif_x2_, dif_y2 - coordinates of the second vector.
- // Returns orientation test result for input vectors.
     template <typename T>
     static kOrientation get_orientation(T dif_x1_, T dif_y1_, T dif_x2_, T dif_y2_) {
         return get_orientation(robust_cross_product(dif_x1_, dif_y1_, dif_x2_, dif_y2_));
     }
 
- // Robust orientation test. Works correctly for any input coordinate type
- // that can be casted without lose of data to integer type within a range
- // [-2^31, 2^31 - 1] - signed integer type.
- // Arguments: point1, point2 - represent the first vector;
- // point2, point3 - represent the second vector;
- // Returns orientation test result for input vectors.
     template <typename Point>
     static kOrientation get_orientation(const Point &point1,
                                         const Point &point2,
@@ -159,6 +110,21 @@
         return get_orientation(robust_cross_product(dx1, dy1, dx2, dy2));
     }
 
+ template <typename Point>
+ static bool is_vertical(const Point &point1, const Point &point2) {
+ return point1.x() == point2.x();
+ }
+
+ template <typename Site>
+ static bool is_vertical(const Site &site) {
+ return is_vertical(site.point0(), site.point1());
+ }
+
+ template <typename Site>
+ static bool is_segment(const Site &site) {
+ return site.point0() != site.point1();
+ }
+
     template <typename Site, typename Circle>
     class event_comparison_predicate {
     public:
@@ -166,18 +132,30 @@
         typedef Circle circle_type;
 
         bool operator()(const site_type &lhs, const site_type &rhs) const {
- if (lhs.x0() != rhs.x0()) return lhs.x0() < rhs.x0();
+ if (lhs.x0() != rhs.x0()) {
+ return lhs.x0() < rhs.x0();
+ }
             if (!lhs.is_segment()) {
- if (!rhs.is_segment()) return lhs.y0() < rhs.y0();
- if (rhs.is_vertical()) return lhs.y0() <= rhs.y0();
+ if (!rhs.is_segment()) {
+ return lhs.y0() < rhs.y0();
+ }
+ if (is_vertical(rhs)) {
+ return lhs.y0() <= rhs.y0();
+ }
                 return true;
             } else {
- if (rhs.is_vertical()) {
- if(lhs.is_vertical()) return lhs.y0() < rhs.y0();
+ if (is_vertical(rhs)) {
+ if(is_vertical(lhs)) {
+ return lhs.y0() < rhs.y0();
+ }
                     return false;
                 }
- if (lhs.is_vertical()) return true;
- if (lhs.y0() != rhs.y0()) return lhs.y0() < rhs.y0();
+ if (is_vertical(lhs)) {
+ return true;
+ }
+ if (lhs.y0() != rhs.y0()) {
+ return lhs.y0() < rhs.y0();
+ }
                 return get_orientation(lhs.point1(), lhs.point0(), rhs.point1()) == LEFT;
             }
         }
@@ -186,7 +164,9 @@
             if (almost_equal(static_cast<fpt_type>(lhs.x()),
                              static_cast<fpt_type>(rhs.lower_x()), ULPS)) {
                 if (almost_equal(static_cast<fpt_type>(lhs.y()),
- static_cast<fpt_type>(rhs.lower_y()), ULPS)) return false;
+ static_cast<fpt_type>(rhs.lower_y()), ULPS)) {
+ return false;
+ }
                 return static_cast<fpt_type>(lhs.y()) <
                        static_cast<fpt_type>(rhs.lower_y());
             }
@@ -198,7 +178,9 @@
             if (almost_equal(static_cast<fpt_type>(lhs.lower_x()),
                              static_cast<fpt_type>(rhs.x()), ULPS)) {
                 if (almost_equal(static_cast<fpt_type>(lhs.lower_y()),
- static_cast<fpt_type>(rhs.y()), ULPS)) return false;
+ static_cast<fpt_type>(rhs.y()), ULPS)) {
+ return false;
+ }
                 return static_cast<fpt_type>(lhs.lower_y()) <
                        static_cast<fpt_type>(rhs.y());
             }
@@ -238,6 +220,9 @@
     public:
         typedef Site site_type;
         
+ // Returns true if a horizontal line going through a new site intersects
+ // right arc at first, else returns false. If horizontal line goes
+ // through intersection point of the given two arcs returns false also.
         bool operator()(const site_type& left_site,
                         const site_type& right_site,
                         const site_type& new_site) const {
@@ -263,17 +248,9 @@
         // Returns true if a horizontal line going through the new point site
         // intersects right arc at first, else returns false. If horizontal line
         // goes through intersection point of the given two arcs returns false.
- // Works correctly for any input coordinate type that can be casted without
- // lose of data to the integer type within a range [-2^31, 2^31-1].
         bool pp(const site_type &left_site,
                 const site_type &right_site,
                 const site_type &new_site) const {
- // Any two point sites with different x-coordinates create two
- // bisectors. Each bisector is defined by the order the sites
- // appear in its representation. Predicates used in this function
- // won't produce the correct result for the any arrangment of the
- // input sites. That's why some preprocessing is required to handle
- // such cases.
             const point_type &left_point = left_site.point0();
             const point_type &right_point = right_site.point0();
             const point_type &new_point = new_site.point0();
@@ -284,8 +261,6 @@
                 if (new_point.y() >= right_point.y())
                     return true;
             } else {
- // If x-coordinates of the sites are equal, we may produce the
- // result without any further computations.
                 return static_cast<fpt_type>(left_point.y()) +
                        static_cast<fpt_type>(right_point.y()) <
                        2.0 * static_cast<fpt_type>(new_point.y());
@@ -298,11 +273,6 @@
             return dist1 < dist2;
         }
         
- // Returns true if a horizontal line going through a new site intersects
- // right arc at first, else returns false. If horizontal line goes
- // through intersection point of the given two arcs returns false also.
- // reverse_order flag defines arrangement of the sites. If it's false
- // the order is (point, segment), else - (segment, point).
         bool ps(const site_type &left_site, const site_type &right_site,
                 const site_type &new_site, bool reverse_order) const {
             kPredicateResult fast_res = fast_ps(
@@ -318,9 +288,6 @@
             return reverse_order ^ (dist1 < dist2);
         }
 
- // Returns true if a horizontal line going through a new site intersects
- // right arc at first, else returns false. If horizontal line goes
- // through intersection point of the given two arcs returns false also.
         bool ss(const site_type &left_site,
                 const site_type &right_site,
                 const site_type &new_site) const {
@@ -331,10 +298,6 @@
                                        new_site.point0()) == LEFT;
             }
 
- // Distances between the x-coordinate of the sweepline and
- // the x-coordinates of the points of the intersections of the
- // horizontal line going through the new site with arcs corresponding
- // to the first and to the second segment sites respectively.
             fpt_type dist1 = find_distance_to_segment_arc(left_site, new_site.point0());
             fpt_type dist2 = find_distance_to_segment_arc(right_site, new_site.point0());
 
@@ -342,24 +305,17 @@
             return dist1 < dist2;
         }
 
- // Find the x-coordinate (relative to the sweepline position) of the point
- // of the intersection of the horizontal line going through the new site
- // with the arc corresponding to the point site.
- // The relative error is atmost 3EPS.
         fpt_type find_distance_to_point_arc(const site_type &site,
                                             const point_type &point) const {
             fpt_type dx = site.x() - point.x();
             fpt_type dy = site.y() - point.y();
+ // The relative error is atmost 3EPS.
             return (dx * dx + dy * dy) / (static_cast<fpt_type>(2.0) * dx);
         }
 
- // Find the x-coordinate (relative to the sweepline position) of the point
- // of the intersection of the horizontal line going through the new site
- // with the arc corresponding to the segment site.
- // The relative error is atmost 8EPS.
         fpt_type find_distance_to_segment_arc(const site_type &site,
                                               const point_type &point) const {
- if (site.is_vertical()) {
+ if (is_vertical(site)) {
                 return (static_cast<fpt_type>(site.x()) - static_cast<fpt_type>(point.x())) *
                        static_cast<fpt_type>(0.5);
             } else {
@@ -380,9 +336,7 @@
                 } else {
                     k = (k - b1) / (a1 * a1);
                 }
- // Relative error of the robust cross product is 2EPS.
- // Relative error of the k is atmost 5EPS.
- // The resulting relative error is atmost 8EPS.
+ // The relative error is atmost 8EPS.
                 return robust_cross_product(a1, b1, a3, b3) * k;
             }
         }
@@ -406,7 +360,7 @@
             fpt_type b = static_cast<fpt_type>(segment_end.y()) -
                          static_cast<fpt_type>(segment_start.y());
 
- if (right_site.is_vertical()) {
+ if (is_vertical(right_site)) {
                 if (new_point.y() < site_point.y() && !reverse_order)
                     return MORE;
                 else if (new_point.y() > site_point.y() && reverse_order)
@@ -487,15 +441,15 @@
         }
         
         // Get comparison pair: y coordinate and direction of the newer site.
- std::pair<coordinate_type, int> get_comparison_y(const node_type &node,
- bool is_new_node = true) const {
+ std::pair<coordinate_type, int> get_comparison_y(
+ const node_type &node, bool is_new_node = true) const {
             if (node.left_site().index() == node.right_site().index()) {
                 return std::make_pair(node.left_site().y(), 0);
             }
             if (node.left_site().index() > node.right_site().index()) {
                 if (!is_new_node &&
                     node.left_site().is_segment() &&
- node.left_site().is_vertical()) {
+ is_vertical(node.left_site())) {
                     return std::make_pair(node.left_site().y1(), 1);
                 }
                 return std::make_pair(node.left_site().y(), 1);
@@ -882,7 +836,9 @@
                  bool recompute_c_x = true,
                  bool recompute_c_y = true,
                  bool recompute_lower_x = true) {
- static mpt_type a[3], b[3], c[3], sqr_len[4], cross[4];
+ static mpt_type a[3], b[3], c[3], cA[4], cB[4];
+ // cA - corresponds to the cross product.
+ // cB - corresponds to the squared length.
             a[0] = static_cast<fpt_type>(site1.x1(true)) -
                    static_cast<fpt_type>(site1.x0(true));
             a[1] = static_cast<fpt_type>(site2.x1(true)) -
@@ -902,45 +858,45 @@
             c[2] = mpt_cross(site3.x0(true), site3.y0(true), site3.x1(true), site3.y1(true));
 
             for (int i = 0; i < 3; ++i) {
- sqr_len[i] = a[i] * a[i] + b[i] * b[i];
+ cB[i] = a[i] * a[i] + b[i] * b[i];
             }
 
             for (int i = 0; i < 3; ++i) {
                 int j = (i+1) % 3;
                 int k = (i+2) % 3;
- cross[i] = a[j] * b[k] - a[k] * b[j];
+ cA[i] = a[j] * b[k] - a[k] * b[j];
             }
- fpt_type denom = sqrt_expr_.eval3(cross, sqr_len).get_d();
+ fpt_type denom = sqrt_expr_.eval3(cA, cB).get_d();
 
             if (recompute_c_y) {
                 for (int i = 0; i < 3; ++i) {
                     int j = (i+1) % 3;
                     int k = (i+2) % 3;
- cross[i] = b[j] * c[k] - b[k] * c[j];
+ cA[i] = b[j] * c[k] - b[k] * c[j];
                 }
- fpt_type c_y = sqrt_expr_.eval3(cross, sqr_len).get_d();
+ fpt_type c_y = sqrt_expr_.eval3(cA, cB).get_d();
                 c_event.y(c_y / denom);
             }
 
             if (recompute_c_x || recompute_lower_x) {
- cross[3] = 0;
+ cA[3] = 0;
                 for (int i = 0; i < 3; ++i) {
                     int j = (i+1) % 3;
                     int k = (i+2) % 3;
- cross[i] = a[j] * c[k] - a[k] * c[j];
+ cA[i] = a[j] * c[k] - a[k] * c[j];
                     if (recompute_lower_x) {
- cross[3] += cross[i] * b[i];
+ cA[3] += cA[i] * b[i];
                     }
                 }
 
                 if (recompute_c_x) {
- fpt_type c_x = sqrt_expr_.eval3(cross, sqr_len).get_d();
+ fpt_type c_x = sqrt_expr_.eval3(cA, cB).get_d();
                     c_event.x(c_x / denom);
                 }
                 
                 if (recompute_lower_x) {
- sqr_len[3] = 1;
- fpt_type lower_x = sqrt_expr_.eval4(cross, sqr_len).get_d();
+ cB[3] = 1;
+ fpt_type lower_x = sqrt_expr_.eval4(cA, cB).get_d();
                     c_event.lower_x(lower_x / denom);
                 }
             }
@@ -1027,8 +983,6 @@
         typedef gmp_circle_formation_functor<site_type, circle_type>
             exact_circle_formation_functor_type;
 
- // Find parameters of the inscribed circle that is tangent to three
- // point sites.
         void ppp(const site_type &site1,
                  const site_type &site2,
                  const site_type &site3,
@@ -1080,8 +1034,6 @@
             }
         }
 
- // Find parameters of the inscribed circle that is tangent to two
- // point sites and on segment site.
         void pps(const site_type &site1,
                  const site_type &site2,
                  const site_type &site3,
@@ -1148,8 +1100,6 @@
             }
         }
 
- // Find parameters of the inscribed circle that is tangent to one
- // point site and two segment sites.
         void pss(const site_type &site1,
                  const site_type &site2,
                  const site_type &site3,
@@ -1286,8 +1236,6 @@
             }
         }
 
- // Find parameters of the inscribed circle that is tangent to three
- // segment sites.
         void sss(const site_type &site1,
                  const site_type &site2,
                  const site_type &site3,

Modified: sandbox/gtl/boost/polygon/detail/voronoi_fpt_kernel.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/voronoi_fpt_kernel.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/voronoi_fpt_kernel.hpp 2011-10-21 17:03:09 EDT (Fri, 21 Oct 2011)
@@ -1,6 +1,6 @@
-// Boost polygon/detail/voronoi_fpt_kernel.hpp header file
+// Boost.Polygon library detail/voronoi_fpt_kernel.hpp header file
 
-// Copyright Andrii Sydorchuk 2010.
+// Copyright Andrii Sydorchuk 2010-2011.
 // Distributed under 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)
@@ -10,6 +10,45 @@
 #ifndef BOOST_POLYGON_VORONOI_FPT_KERNEL
 #define BOOST_POLYGON_VORONOI_FPT_KERNEL
 
+// Geometry predicates with floating-point variables usually require
+// high-precision predicates to retrieve the correct result.
+// Epsilon robust predicates give the result within some epsilon relative
+// error, but are a lot faster than high-precision predicates.
+// To make algorithm robust and efficient epsilon robust predicates are
+// used at the first step. In case of the undefined result high-precision
+// arithmetic is used to produce required robustness. This approach
+// requires exact computation of epsilon intervals within which epsilon
+// robust predicates have undefined value.
+// There are two ways to measure an error of floating-point calculations:
+// relative error and ULPs (units in the last place).
+// Let EPS be machine epsilon, then next inequalities have place:
+// 1 EPS <= 1 ULP <= 2 EPS (1), 0.5 ULP <= 1 EPS <= 1 ULP (2).
+// ULPs are good for measuring rounding errors and comparing values.
+// Relative erros are good for computation of general relative
+// errors of formulas or expressions. So to calculate epsilon
+// intervals within which epsilon robust predicates have undefined result
+// next schema is used:
+// 1) Compute rounding errors of initial variables using ULPs;
+// 2) Transform ULPs to epsilons using upper bound of the (1);
+// 3) Compute relative error of the formula using epsilon arithmetic;
+// 4) Transform epsilon to ULPs using upper bound of the (2);
+// In case two values are inside undefined ULP range use high-precision
+// arithmetic to produce the correct result, else output the result.
+// Look at almost_equal function to see how two floating-point variables
+// are checked to fit in the ULP range.
+// If A has relative error of r(A) and B has relative error of r(B) then:
+// 1) r(A + B) <= max(r(A), r(B)), for A * B >= 0;
+// 2) r(A - B) <= B*r(A)+A*r(B)/(A-B), for A * B >= 0;
+// 2) r(A * B) <= r(A) + r(B);
+// 3) r(A / B) <= r(A) + r(B);
+// In addition rounding error should be added, that is always equal to
+// 0.5 ULP or atmost 1 epsilon. As you might see from the above formulas
+// substraction relative error may be extremely large, that's why
+// epsilon robust comparator class is used to store floating point values
+// and avoid substraction.
+// For further information about relative errors and ULPs try this link:
+// http://docs.sun.com/source/806-3568/ncg_goldberg.html
+
 namespace boost {
 namespace polygon {
 namespace detail {
@@ -25,7 +64,7 @@
     // If two floating-point numbers in the same format are ordered (x < y),
     // then they are ordered the same way when their bits are reinterpreted as
     // sign-magnitude integers. Values are considered to be almost equal if
- // their integer reinterpretatoins differ in not more than maxUlps units.
+ // their integer reinterpretations differ in not more than maxUlps units.
     template <typename T>
     bool almost_equal(T a, T b, unsigned int ulps);
 
@@ -96,15 +135,15 @@
     class robust_fpt {
     public:
         typedef FPT floating_point_type;
- typedef double relative_error_type;
+ typedef FPT relative_error_type;
 
         // Rounding error is at most 1 EPS.
         static const relative_error_type ROUNDING_ERROR;
 
- // Constructors.
         robust_fpt() : fpv_(0.0), re_(0) {}
         explicit robust_fpt(int fpv) : fpv_(fpv), re_(0) {}
- explicit robust_fpt(floating_point_type fpv, bool rounded = true) : fpv_(fpv) {
+ explicit robust_fpt(floating_point_type fpv,
+ bool rounded = true) : fpv_(fpv) {
             re_ = rounded ? ROUNDING_ERROR : 0;
         }
         robust_fpt(floating_point_type fpv, relative_error_type error) :
@@ -117,7 +156,9 @@
         template <typename T>
         bool operator==(T that) const {
             floating_point_type value = static_cast<floating_point_type>(that);
- return almost_equal(this->fpv_, value, static_cast<unsigned int>(this->ulp()));
+ return almost_equal(this->fpv_,
+ value,
+ static_cast<unsigned int>(this->ulp()));
         }
 
         template <typename T>
@@ -150,7 +191,7 @@
         }
 
         bool operator==(const robust_fpt &that) const {
- unsigned int ulp = static_cast<unsigned int>(ceil(this->re_ + that.re_));
+ unsigned int ulp = static_cast<unsigned int>(this->re_ + that.re_);
                 return almost_equal(this->fpv_, that.fpv_, ulp);
         }
 
@@ -192,8 +233,9 @@
                 (this->fpv_ <= 0 && that.fpv_ <= 0))
                 this->re_ = (std::max)(this->re_, that.re_) + ROUNDING_ERROR;
             else {
- floating_point_type temp = (this->fpv_ * this->re_ - that.fpv_ * that.re_) / fpv;
- this->re_ = std::fabs(get_d(temp)) + ROUNDING_ERROR;
+ floating_point_type temp =
+ (this->fpv_ * this->re_ - that.fpv_ * that.re_) / fpv;
+ this->re_ = std::fabs(temp) + ROUNDING_ERROR;
             }
             this->fpv_ = fpv;
                 return *this;
@@ -205,8 +247,9 @@
                 (this->fpv_ <= 0 && that.fpv_ >= 0))
                 this->re_ = (std::max)(this->re_, that.re_) + ROUNDING_ERROR;
             else {
- floating_point_type temp = (this->fpv_ * this->re_ + that.fpv_ * that.re_) / fpv;
- this->re_ = std::fabs(get_d(temp)) + ROUNDING_ERROR;
+ floating_point_type temp =
+ (this->fpv_ * this->re_ + that.fpv_ * that.re_) / fpv;
+ this->re_ = std::fabs(temp) + ROUNDING_ERROR;
             }
             this->fpv_ = fpv;
                 return *this;
@@ -231,8 +274,9 @@
                 (this->fpv_ <= 0 && that.fpv_ <= 0))
                 re = (std::max)(this->re_, that.re_) + ROUNDING_ERROR;
             else {
- floating_point_type temp = (this->fpv_ * this->re_ - that.fpv_ * that.re_) / fpv;
- re = std::fabs(get_d(temp)) + ROUNDING_ERROR;
+ floating_point_type temp =
+ (this->fpv_ * this->re_ - that.fpv_ * that.re_) / fpv;
+ re = std::fabs(temp) + ROUNDING_ERROR;
             }
             return robust_fpt(fpv, re);
         }
@@ -244,8 +288,9 @@
                 (this->fpv_ <= 0 && that.fpv_ >= 0))
                 re = (std::max)(this->re_, that.re_) + ROUNDING_ERROR;
             else {
- floating_point_type temp = (this->fpv_ * this->re_ + that.fpv_ * that.re_) / fpv;
- re = std::fabs(get_d(temp)) + ROUNDING_ERROR;
+ floating_point_type temp =
+ (this->fpv_ * this->re_ + that.fpv_ * that.re_) / fpv;
+ re = std::fabs(temp) + ROUNDING_ERROR;
             }
             return robust_fpt(fpv, re);
         }
@@ -276,27 +321,14 @@
     };
 
     template <typename T>
- const typename robust_fpt<T>::relative_error_type robust_fpt<T>::ROUNDING_ERROR = 1;
+ const typename robust_fpt<T>::relative_error_type
+ robust_fpt<T>::ROUNDING_ERROR = 1;
 
- // Class used to make computations with epsilon relative error.
- // ERC consists of two values: value1 and value2, both positive.
+ // robust_dif consists of two not negative values: value1 and value2.
     // The resulting expression is equal to the value1 - value2.
- // The main idea is to represent any expression that consists of
- // addition, substraction, multiplication and division operations
- // to avoid using substraction. Substraction of a positive value
- // is equivalent to the addition to value2 and substraction of
- // a negative value is equivalent to the addition to value1.
- // Cons: ERC gives error relative not to the resulting value,
- // but relative to some expression instead. Example:
- // center_x = 100, ERC's value1 = 10^20, value2 = 10^20,
- // center_x = 1000, ERC's value3 = 10^21, value4 = 10^21,
- // such two centers are considered equal(
- // value1 + value4 = value2 + value3), while they are not.
- // Pros: ERC is much faster then approaches based on the use
- // of high-precision libraries. However this will give correct
- // answer for the previous example.
- // Solution: Use ERCs in case of defined comparison results and use
- // high-precision libraries for undefined results.
+ // Substraction of a positive value is equivalent to the addition to value2
+ // and substraction of a negative value is equivalent to the addition to
+ // value1. The structure implicitly avoids difference computation.
     template <typename T>
     class robust_dif {
     public:
@@ -349,8 +381,7 @@
             return *this;
         }
 
- robust_dif<T> &operator+=(
- const robust_dif<T> &that) {
+ robust_dif<T> &operator+=(const robust_dif<T> &that) {
             positive_sum_ += that.positive_sum_;
             negative_sum_ += that.negative_sum_;
             return *this;
@@ -364,8 +395,7 @@
             return *this;
         }
 
- robust_dif<T> &operator-=(
- const robust_dif<T> &that) {
+ robust_dif<T> &operator-=(const robust_dif<T> &that) {
             positive_sum_ += that.negative_sum_;
             negative_sum_ += that.positive_sum_;
             return *this;
@@ -383,8 +413,7 @@
             return *this;
         }
 
- robust_dif<T> &operator*=(
- const robust_dif<T> &that) {
+ robust_dif<T> &operator*=(const robust_dif<T> &that) {
             T positive_sum = this->positive_sum_ * that.positive_sum_ +
                              this->negative_sum_ * that.negative_sum_;
             T negative_sum = this->positive_sum_ * that.negative_sum_ +
@@ -412,16 +441,14 @@
     };
 
     template<typename T>
- robust_dif<T> operator+(
- const robust_dif<T>& lhs,
- const robust_dif<T>& rhs) {
+ robust_dif<T> operator+(const robust_dif<T>& lhs,
+ const robust_dif<T>& rhs) {
         return robust_dif<T>(lhs.pos() + rhs.pos(),
                              lhs.neg() + rhs.neg());
     }
 
     template<typename T>
- robust_dif<T> operator+(
- const robust_dif<T>& lhs, const T& rhs) {
+ robust_dif<T> operator+(const robust_dif<T>& lhs, const T& rhs) {
         if (rhs >= 0) {
             return robust_dif<T>(lhs.pos() + rhs, lhs.neg());
         } else {
@@ -430,8 +457,7 @@
     }
 
     template<typename T>
- robust_dif<T> operator+(
- const T& lhs, const robust_dif<T>& rhs) {
+ robust_dif<T> operator+(const T& lhs, const robust_dif<T>& rhs) {
         if (lhs >= 0) {
             return robust_dif<T>(lhs + rhs.pos(), rhs.neg());
         } else {
@@ -440,15 +466,13 @@
     }
 
     template<typename T>
- robust_dif<T> operator-(
- const robust_dif<T>& lhs,
- const robust_dif<T>& rhs) {
+ robust_dif<T> operator-(const robust_dif<T>& lhs,
+ const robust_dif<T>& rhs) {
         return robust_dif<T>(lhs.pos() + rhs.neg(), lhs.neg() + rhs.pos());
     }
 
     template<typename T>
- robust_dif<T> operator-(
- const robust_dif<T>& lhs, const T& rhs) {
+ robust_dif<T> operator-(const robust_dif<T>& lhs, const T& rhs) {
         if (rhs >= 0) {
             return robust_dif<T>(lhs.pos(), lhs.neg() + rhs);
         } else {
@@ -457,8 +481,7 @@
     }
 
     template<typename T>
- robust_dif<T> operator-(
- const T& lhs, const robust_dif<T>& rhs) {
+ robust_dif<T> operator-(const T& lhs, const robust_dif<T>& rhs) {
         if (lhs >= 0) {
             return robust_dif<T>(lhs + rhs.neg(), rhs.pos());
         } else {
@@ -467,17 +490,15 @@
     }
 
     template<typename T>
- robust_dif<T> operator*(
- const robust_dif<T>& lhs,
- const robust_dif<T>& rhs) {
+ robust_dif<T> operator*(const robust_dif<T>& lhs,
+ const robust_dif<T>& rhs) {
         T res_pos = lhs.pos() * rhs.pos() + lhs.neg() * rhs.neg();
         T res_neg = lhs.pos() * rhs.neg() + lhs.neg() * rhs.pos();
         return robust_dif<T>(res_pos, res_neg);
     }
 
     template<typename T>
- robust_dif<T> operator*(
- const robust_dif<T>& lhs, const T& val) {
+ robust_dif<T> operator*(const robust_dif<T>& lhs, const T& val) {
         if (val >= 0) {
             return robust_dif<T>(lhs.pos() * val, lhs.neg() * val);
         } else {
@@ -486,8 +507,7 @@
     }
 
     template<typename T>
- robust_dif<T> operator*(
- const T& val, const robust_dif<T>& rhs) {
+ robust_dif<T> operator*(const T& val, const robust_dif<T>& rhs) {
         if (val >= 0) {
             return robust_dif<T>(val * rhs.pos(), val * rhs.neg());
         } else {
@@ -496,23 +516,21 @@
     }
 
     template<typename T>
- robust_dif<T> operator/(
- const robust_dif<T>& lhs, const T& val) {
+ robust_dif<T> operator/(const robust_dif<T>& lhs, const T& val) {
         if (val >= 0) {
             return robust_dif<T>(lhs.pos() / val, lhs.neg() / val);
         } else {
             return robust_dif<T>(-lhs.neg() / val, -lhs.pos() / val);
         }
     }
-
     
- ///////////////////////////////////////////////////////////////////////////
- // VORONOI ROBUST SQRT EXPRESSION ////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////
+ // Used to compute expressions that operate with sqrts with predefined
+ // relative error. Evaluates expressions of the next type:
+ // sum(i = 1 .. n)(A[i] * sqrt(B[i])), 1 <= n <= 4.
     template <typename mpt, typename mpf>
     class robust_sqrt_expr {
     public:
- // Evaluates expression:
+ // Evaluates expression (re = 4 EPS):
         // A[0] * sqrt(B[0]).
         mpf& eval1(mpt *A, mpt *B) {
             a[0] = A[0];
@@ -521,9 +539,8 @@
             return b[0] *= a[0];
         }
 
- // Evaluates expression:
- // A[0] * sqrt(B[0]) + A[1] * sqrt(B[1]) with
- // 7 * EPS relative error in the worst case.
+ // Evaluates expression (re = 7 EPS):
+ // A[0] * sqrt(B[0]) + A[1] * sqrt(B[1]).
         mpf& eval2(mpt *A, mpt *B) {
             a[1] = eval1(A, B);
             b[1] = eval1(A + 1, B + 1);
@@ -538,9 +555,8 @@
             return b[1] /= a[1];
         }
 
- // Evaluates expression:
- // A[0] * sqrt(B[0]) + A[1] * sqrt(B[1]) + A[2] * sqrt(B[2])
- // with 16 * EPS relative error in the worst case.
+ // Evaluates expression (re = 16 EPS):
+ // A[0] * sqrt(B[0]) + A[1] * sqrt(B[1]) + A[2] * sqrt(B[2]).
         mpf& eval3(mpt *A, mpt *B) {
             a[2] = eval2(A, B);
             b[2] = eval1(A + 2, B + 2);
@@ -562,9 +578,9 @@
         }
 
         
- // Evaluates expression:
- // A[0] * sqrt(B[0]) + A[1] * sqrt(B[1]) + A[2] * sqrt(B[2]) + A[3] * sqrt(B[3])
- // with 25 * EPS relative error in the worst case.
+ // Evaluates expression (re = 25 EPS):
+ // A[0] * sqrt(B[0]) + A[1] * sqrt(B[1]) +
+ // A[2] * sqrt(B[2]) + A[3] * sqrt(B[3]).
         mpf& eval4(mpt *A, mpt *B) {
             a[3] = eval2(A, B);
             b[3] = eval2(A + 2, B + 2);

Modified: sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp (original)
+++ sandbox/gtl/boost/polygon/detail/voronoi_structures.hpp 2011-10-21 17:03:09 EDT (Fri, 21 Oct 2011)
@@ -1,6 +1,6 @@
-// Boost.Polygon detail/voronoi_structures.hpp header file
+// Boost.Polygon library detail/voronoi_structures.hpp header file
 
-// Copyright Andrii Sydorchuk 2010.
+// Copyright Andrii Sydorchuk 2010-2011.
 // Distributed under 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)
@@ -38,8 +38,6 @@
             return (this->x_ != that.x()) || (this->y_ != that.y());
         }
 
- // Comparison function.
- // Defines ordering of the points on the 2D plane.
         bool operator<(const point_2d &that) const {
             if (this->x_ != that.x_)
                 return this->x_ < that.x_;
@@ -96,18 +94,14 @@
     // Variables: point0_ - point site or segment's startpoint;
     // point1_ - segment's endpoint if site is a segment;
     // index_ - site event index among other sites;
- // is_segment_ - flag whether site is a segment;
- // is_vertical_ - flag whether site is vertical;
     // is_inverse_ - defines type of the segment site.
- // Note: for all the point sites is_vertical_ flag is true,
- // is_inverse_ flag is false.
+ // Note: for all the sites is_inverse_ flag is equal to false by default.
     template <typename T>
     class site_event {
     public:
         typedef T coordinate_type;
         typedef point_2d<T> point_type;
 
- // Point site contructors.
         site_event() :
             point0_(0, 0),
             point1_(0, 0),
@@ -125,7 +119,6 @@
             site_index_(index),
             is_inverse_(false) {}
 
- // Segment site constructors.
         site_event(coordinate_type x1, coordinate_type y1,
                    coordinate_type x2, coordinate_type y2, int index):
             point0_(x1, y1),
@@ -154,60 +147,46 @@
             return y0(oriented);
         }
 
- // Return x-coordinate of the point for the point sites.
- // Return x-coordinate of the startpoint for the segment sites.
         coordinate_type x0(bool oriented = false) const {
             if (!oriented)
                 return point0_.x();
             return is_inverse_ ? point1_.x() : point0_.x();
         }
 
- // Return y-coordinate of the point for the point sites.
- // Return y-coordinate of the startpoint for the segment sites.
         coordinate_type y0(bool oriented = false) const {
             if (!oriented)
                 return point0_.y();
             return is_inverse_ ? point1_.y() : point0_.y();
         }
 
- // Return x-coordinate of the endpoint of the segment sites.
- // Doesn't make sense for the point sites.
         coordinate_type x1(bool oriented = false) const {
             if (!oriented)
                 return point1_.x();
             return is_inverse_ ? point0_.x() : point1_.x();
         }
 
- // Return y-coordinate of the endpoint of the segment sites.
- // Doesn't make sense for the point sites.
         coordinate_type y1(bool oriented = false) const {
             if (!oriented)
                 return point1_.y();
             return is_inverse_ ? point0_.y() : point1_.y();
         }
 
- // Return point for the point sites.
- // Return startpoint for the segment sites.
         const point_type &point0(bool oriented = false) const {
             if (!oriented)
                 return point0_;
             return is_inverse_ ? point1_ : point0_;
         }
 
- // Return endpoint of the segment sites.
- // Doesn't make sense for the point sites.
         const point_type &point1(bool oriented = false) const {
             if (!oriented)
                 return point1_;
             return is_inverse_ ? point0_ : point1_;
         }
 
- // Return index of the site among all the other sites.
         void index(int index) {
             site_index_ = index;
         }
 
- // Change segment site orientation to the opposite one.
         void inverse() {
             is_inverse_ ^= true;
         }
@@ -216,12 +195,12 @@
             return site_index_;
         }
 
- bool is_segment() const {
- return point0_.x() != point1_.x() || point0_.y() != point1_.y();
+ bool is_point() const {
+ return point0_.x() == point1_.x() && point0_.y() == point1_.y();
         }
 
- bool is_vertical() const {
- return point0_.x() == point1_.x();
+ bool is_segment() const {
+ return point0_.x() != point1_.x() || point0_.y() != point1_.y();
         }
 
         bool is_inverse() const {
@@ -241,22 +220,11 @@
     // Circle event is made by the two consequtive nodes in the beach line data
     // structure. In case another node was inserted during algorithm execution
     // between the given two nodes circle event becomes inactive.
- // Circle events order is based on the comparison of the rightmost points
- // of the circles. The order is the same like for the point_2d class.
- // However as coordinates of the circle events might be not integers extra
- // comparison checks are required to make the comparison robust.
- // Next representation is used to store parameters of the circle:
- // each of the parameters is represented as fraction
- // numerator / denominator. Denominator is common for each of the
- // three parameters. Epsilon robust comparator class is used
- // to represent parameters of the circle events.
     // Variables: center_x_ - numerator of the center's x-coordinate.
     // center_y_ - numerator of the center's y-coordinate.
     // lower_x_ - numerator of the bottom point's x-coordinate.
- // denom_ - positive denominator for the previous three values.
- // bisector_node_ - iterator to the second bisector's node.
     // is_active_ - flag whether circle event is still active.
- // lower_y coordinate is always equal to center_y.
+ // NOTE: lower_y coordinate is always equal to center_y.
     template <typename T>
     class circle_event {
     public:
@@ -272,7 +240,6 @@
             lower_x_(lower_x),
             is_active_(true) {}
 
- // Evaluate x-coordinate of the center of the circle.
         coordinate_type x() const {
             return center_x_;
         }
@@ -281,7 +248,6 @@
             center_x_ = center_x;
         }
 
- // Evaluate y-coordinate of the center of the circle.
         coordinate_type y() const {
             return center_y_;
         }
@@ -290,19 +256,18 @@
             center_y_ = center_y;
         }
 
- // Evaluate x-coordinate of the rightmost point of the circle.
         coordinate_type lower_x() const {
             return lower_x_;
         }
 
- coordinate_type lower_y() const {
- return center_y_;
- }
-
         void lower_x(coordinate_type lower_x) {
             lower_x_ = lower_x;
         }
 
+ coordinate_type lower_y() const {
+ return center_y_;
+ }
+
         bool is_active() const {
             return is_active_;
         }
@@ -319,8 +284,8 @@
     };
 
     // Event queue data structure, holds circle events.
- // During algorithm run, some of the circle events disappear(become
- // inactive). Priority queue data structure by itself doesn't support
+ // During algorithm run, some of the circle events disappear (become
+ // inactive). Priority queue data structure doesn't support
     // iterators (there is no direct ability to modify its elements).
     // Instead list is used to store all the circle events and priority queue
     // of the iterators to the list elements is used to keep the correct circle
@@ -373,13 +338,13 @@
 
     // Represents a bisector node made by two arcs that correspond to the left
     // and right sites. Arc is defined as a curve with points equidistant from
- // the site and from the sweepline. If the site is a point then the arc is
+ // the site and from the sweepline. If the site is a point then arc is
     // a parabola, otherwise it's a line segment. A segment site event will
- // produce different bisectors depending on its direction.
+ // produce different bisectors based on its direction.
     // In the general case two sites will create two opposite bisectors. That's
     // why the order of the sites is important to define the unique bisector.
- // The one site is considered to be newer than the other in case it was
- // processed by the algorithm later.
+ // The one site is considered to be newer than the other one if it was
+ // processed by the algorithm later (e.g. has greater index).
     template <typename Site>
     class beach_line_node_key {
     public:
@@ -393,7 +358,8 @@
 
         // Constructs a new bisector. The input to the constructor is the two
         // sites that create the bisector. The order of sites is important.
- beach_line_node_key(const site_type &left_site, const site_type &right_site) :
+ beach_line_node_key(const site_type &left_site,
+ const site_type &right_site) :
             left_site_(left_site),
             right_site_(right_site) {}
 
@@ -427,9 +393,9 @@
     };
 
     // Represents edge data sturcture from the voronoi output, that is
- // associated as a value with beach line bisector as a key in the beach
- // line. Contains iterator to the circle event in the circle event
- // queue in case it's the second bisector that forms a circle event.
+ // associated as a value with beach line bisector in the beach
+ // line. Contains pointer to the circle event in the circle event
+ // queue if the edge corresponds to the right bisector of the circle event.
     template <typename Edge, typename Circle>
     class beach_line_node_data {
     public:
@@ -437,7 +403,7 @@
             circle_event_(NULL),
             edge_(new_edge) {}
 
- Circle *circle_event() const {
+ Circle *circle_event() {
             return circle_event_;
         }
 
@@ -445,7 +411,7 @@
             circle_event_ = circle_event;
         }
 
- Edge *edge() const {
+ Edge *edge() {
             return edge_;
         }
 

Modified: sandbox/gtl/boost/polygon/voronoi_builder.hpp
==============================================================================
--- sandbox/gtl/boost/polygon/voronoi_builder.hpp (original)
+++ sandbox/gtl/boost/polygon/voronoi_builder.hpp 2011-10-21 17:03:09 EDT (Fri, 21 Oct 2011)
@@ -236,8 +236,9 @@
 
                 // Count the number of the sites to init the beach line.
                 while(site_event_iterator_ != site_events_.end() &&
- site_event_iterator_->x() == site_events_.begin()->x() &&
- site_event_iterator_->is_vertical()) {
+ calc_kernel_type::is_vertical(site_event_iterator_->point0(),
+ site_events_.begin()->point0()) &&
+ calc_kernel_type::is_vertical(*site_event_iterator_)) {
                     ++site_event_iterator_;
                     ++skip;
                 }

Modified: sandbox/gtl/libs/polygon/test/voronoi_fpt_kernel_test.cpp
==============================================================================
--- sandbox/gtl/libs/polygon/test/voronoi_fpt_kernel_test.cpp (original)
+++ sandbox/gtl/libs/polygon/test/voronoi_fpt_kernel_test.cpp 2011-10-21 17:03:09 EDT (Fri, 21 Oct 2011)
@@ -20,131 +20,121 @@
 #include "boost/polygon/detail/voronoi_calc_kernel.hpp"
 using namespace boost::polygon::detail;
 
-typedef boost::mpl::list<double, mpf_class, mpt_wrapper<mpf_class, 8> > test_types;
+typedef robust_fpt<double> rfpt_type;
 
-BOOST_AUTO_TEST_CASE_TEMPLATE(robust_fpt_constructors_test1, T, test_types) {
- typedef robust_fpt<T> rfpt_type;
+BOOST_AUTO_TEST_CASE(robust_fpt_constructors_test1) {
     rfpt_type a = rfpt_type();
- BOOST_CHECK_EQUAL(a.fpv() == static_cast<T>(0), true);
+ BOOST_CHECK_EQUAL(a.fpv() == 0.0, true);
     BOOST_CHECK_EQUAL(a.re() == 0.0, true);
     BOOST_CHECK_EQUAL(a.ulp() == 0, true);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE(robust_fpt_constructors_test2, T, test_types) {
- typedef robust_fpt<T> rfpt_type;
- rfpt_type a(static_cast<T>(10));
- BOOST_CHECK_EQUAL(a.fpv() == static_cast<T>(10), true);
+BOOST_AUTO_TEST_CASE(robust_fpt_constructors_test2) {
+ rfpt_type a(10.0);
+ BOOST_CHECK_EQUAL(a.fpv() == 10.0, true);
     BOOST_CHECK_EQUAL(a.re() == 1.0, true);
     BOOST_CHECK_EQUAL(a.ulp() == 1.0, true);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE(robust_fpt_constructors_test3, T, test_types) {
- typedef robust_fpt<T> rfpt_type;
- rfpt_type a(static_cast<T>(10), false);
- BOOST_CHECK_EQUAL(a.fpv() == static_cast<T>(10), true);
+BOOST_AUTO_TEST_CASE(robust_fpt_constructors_test3) {
+ rfpt_type a(10.0, false);
+ BOOST_CHECK_EQUAL(a.fpv() == 10.0, true);
     BOOST_CHECK_EQUAL(a.re() == 0.0, true);
     BOOST_CHECK_EQUAL(a.ulp() == 0.0, true);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE(robust_fpt_constructors_test4, T, test_types) {
- typedef robust_fpt<T> rfpt_type;
- rfpt_type a(static_cast<T>(10), 3.0);
- BOOST_CHECK_EQUAL(a.fpv() == static_cast<T>(10), true);
+BOOST_AUTO_TEST_CASE(robust_fpt_constructors_test4) {
+ rfpt_type a(10.0, 3.0);
+ BOOST_CHECK_EQUAL(a.fpv() == 10.0, true);
     BOOST_CHECK_EQUAL(a.re() == 3.0, true);
     BOOST_CHECK_EQUAL(a.ulp() == 3.0, true);
 
- rfpt_type b(static_cast<T>(10), 2.75);
- BOOST_CHECK_EQUAL(b.fpv() == static_cast<T>(10), true);
+ rfpt_type b(10.0, 2.75);
+ BOOST_CHECK_EQUAL(b.fpv() == 10.0, true);
     BOOST_CHECK_EQUAL(b.re() == 2.75, true);
     BOOST_CHECK_EQUAL(b.ulp() == 2.75, true);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE(robust_fpt_sum_test1, T, test_types) {
- typedef robust_fpt<T> rfpt_type;
- rfpt_type a(static_cast<T>(2), 5.0);
- rfpt_type b(static_cast<T>(3), 4.0);
+BOOST_AUTO_TEST_CASE(robust_fpt_sum_test1) {
+ rfpt_type a(2.0, 5.0);
+ rfpt_type b(3.0, 4.0);
     rfpt_type c = a + b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(5), true);
+ BOOST_CHECK_EQUAL(c.fpv() == 5.0, true);
     BOOST_CHECK_EQUAL(c.re() == 6.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 6.0, true);
 
     c += b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(8), true);
+ BOOST_CHECK_EQUAL(c.fpv() == 8.0, true);
     BOOST_CHECK_EQUAL(c.re() == 7.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 7.0, true);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE(robust_fpt_sum_test2, T, test_types) {
- typedef robust_fpt<T> rfpt_type;
- rfpt_type a(static_cast<T>(3), 2.0);
- rfpt_type b(static_cast<T>(-2), 3.0);
+BOOST_AUTO_TEST_CASE(robust_fpt_sum_test2) {
+ rfpt_type a(3.0, 2.0);
+ rfpt_type b(-2.0, 3.0);
     rfpt_type c = a + b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(1), true);
+ BOOST_CHECK_EQUAL(c.fpv() == 1.0, true);
     BOOST_CHECK_EQUAL(c.re() == 13.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 13.0, true);
 
     c += b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(-1), true);
+ BOOST_CHECK_EQUAL(c.fpv() == -1.0, true);
     BOOST_CHECK_EQUAL(c.re() == 20.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 20.0, true);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE(robust_fpt_dif_test1, T, test_types) {
- typedef robust_fpt<T> rfpt_type;
- rfpt_type a(static_cast<T>(2), 5.0);
- rfpt_type b(static_cast<T>(-3), 4.0);
+BOOST_AUTO_TEST_CASE(robust_fpt_dif_test1) {
+ rfpt_type a(2.0, 5.0);
+ rfpt_type b(-3.0, 4.0);
     rfpt_type c = a - b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(5), true);
+ BOOST_CHECK_EQUAL(c.fpv() == 5.0, true);
     BOOST_CHECK_EQUAL(c.re() == 6.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 6.0, true);
 
     c -= b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(8), true);
+ BOOST_CHECK_EQUAL(c.fpv() == 8.0, true);
     BOOST_CHECK_EQUAL(c.re() == 7.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 7.0, true);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE(robust_fpt_dif_test2, T, test_types) {
- typedef robust_fpt<T> rfpt_type;
- rfpt_type a(static_cast<T>(3), 2.0);
- rfpt_type b(static_cast<T>(2), 3.0);
+BOOST_AUTO_TEST_CASE(robust_fpt_dif_test2) {
+ rfpt_type a(3.0, 2.0);
+ rfpt_type b(2.0, 3.0);
     rfpt_type c = a - b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(1), true);
+ BOOST_CHECK_EQUAL(c.fpv() == 1.0, true);
     BOOST_CHECK_EQUAL(c.re() == 13.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 13.0, true);
 
     c -= b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(-1), true);
+ BOOST_CHECK_EQUAL(c.fpv() == -1.0, true);
     BOOST_CHECK_EQUAL(c.re() == 20.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 20.0, true);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE(robust_fpt_mult_test3, T, test_types) {
- typedef robust_fpt<T> rfpt_type;
- rfpt_type a(static_cast<T>(2), 3.0);
- rfpt_type b(static_cast<T>(4));
+BOOST_AUTO_TEST_CASE(robust_fpt_mult_test3) {
+ rfpt_type a(2.0, 3.0);
+ rfpt_type b(4.0);
     rfpt_type c = a * b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(8), true);
+ BOOST_CHECK_EQUAL(c.fpv() == 8.0, true);
     BOOST_CHECK_EQUAL(c.re() == 5.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 5.0, true);
 
     c *= b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(32), true);
+ BOOST_CHECK_EQUAL(c.fpv() == 32.0, true);
     BOOST_CHECK_EQUAL(c.re() == 7.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 7.0, true);
 }
 
-BOOST_AUTO_TEST_CASE_TEMPLATE(robust_fpt_div_test1, T, test_types) {
- typedef robust_fpt<T> rfpt_type;
- rfpt_type a(static_cast<T>(2), 3.0);
- rfpt_type b(static_cast<T>(4));
+BOOST_AUTO_TEST_CASE(robust_fpt_div_test1) {
+ rfpt_type a(2.0, 3.0);
+ rfpt_type b(4.0);
     rfpt_type c = a / b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(0.5), true);
+ BOOST_CHECK_EQUAL(c.fpv() == 0.5, true);
     BOOST_CHECK_EQUAL(c.re() == 5.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 5.0, true);
 
     c /= b;
- BOOST_CHECK_EQUAL(c.fpv() == static_cast<T>(0.125), true);
+ BOOST_CHECK_EQUAL(c.fpv() == 0.125, true);
     BOOST_CHECK_EQUAL(c.re() == 7.0, true);
     BOOST_CHECK_EQUAL(c.ulp() == 7.0, true);
 }

Modified: sandbox/gtl/libs/polygon/test/voronoi_structures_test.cpp
==============================================================================
--- sandbox/gtl/libs/polygon/test/voronoi_structures_test.cpp (original)
+++ sandbox/gtl/libs/polygon/test/voronoi_structures_test.cpp 2011-10-21 17:03:09 EDT (Fri, 21 Oct 2011)
@@ -36,7 +36,6 @@
     BOOST_CHECK_EQUAL(s.y0() == s.y1() && s.y1() == 2, true);
     BOOST_CHECK_EQUAL(s.index() == 0, true);
     BOOST_CHECK_EQUAL(s.is_segment(), false);
- BOOST_CHECK_EQUAL(s.is_vertical(), true);
     BOOST_CHECK_EQUAL(s.is_inverse(), false);
 }
 
@@ -48,7 +47,6 @@
     BOOST_CHECK_EQUAL(s.y1(true) == 4 && s.y1() == 4, true);
     BOOST_CHECK_EQUAL(s.index() == 0, true);
     BOOST_CHECK_EQUAL(s.is_segment(), true);
- BOOST_CHECK_EQUAL(s.is_vertical(), false);
     BOOST_CHECK_EQUAL(s.is_inverse(), false);
     s.inverse();
     BOOST_CHECK_EQUAL(s.x1(true) == 1 && s.x0() == 1, true);


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