Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80444 - in trunk: boost/polygon/detail libs/polygon/benchmark libs/polygon/example
From: sydorchuk.andriy_at_[hidden]
Date: 2012-09-08 08:57:51


Author: asydorchuk
Date: 2012-09-08 08:57:50 EDT (Sat, 08 Sep 2012)
New Revision: 80444
URL: http://svn.boost.org/trac/boost/changeset/80444

Log:
Polygon: Library updates after gcc run.

Text files modified:
   trunk/boost/polygon/detail/voronoi_ctypes.hpp | 6 ++++--
   trunk/libs/polygon/benchmark/voronoi_benchmark_segments.cpp | 1 -
   trunk/libs/polygon/example/Jamfile.v2 | 8 ++++----
   trunk/libs/polygon/example/voronoi_advanced_tutorial.cpp | 20 ++++++--------------
   trunk/libs/polygon/example/voronoi_basic_tutorial.cpp | 2 +-
   trunk/libs/polygon/example/voronoi_visualizer.cpp | 22 ++++++++++++----------
   6 files changed, 27 insertions(+), 32 deletions(-)

Modified: trunk/boost/polygon/detail/voronoi_ctypes.hpp
==============================================================================
--- trunk/boost/polygon/detail/voronoi_ctypes.hpp (original)
+++ trunk/boost/polygon/detail/voronoi_ctypes.hpp 2012-09-08 08:57:50 EDT (Sat, 08 Sep 2012)
@@ -266,7 +266,8 @@
       this->count_ = -this->count_;
   }
 
- extended_int(const extended_int& that) {
+ template<std::size_t M>
+ extended_int(const extended_int<M>& that) {
     this->count_ = that.count();
     std::memcpy(this->chunks_, that.chunks(), that.size() * sizeof(uint32));
   }
@@ -300,7 +301,8 @@
     return *this;
   }
 
- extended_int& operator=(const extended_int& that) {
+ template<std::size_t M>
+ extended_int& operator=(const extended_int<M>& that) {
     this->count_ = that.count();
     std::memcpy(this->chunks_, that.chunks(), that.size() * sizeof(uint32));
     return *this;

Modified: trunk/libs/polygon/benchmark/voronoi_benchmark_segments.cpp
==============================================================================
--- trunk/libs/polygon/benchmark/voronoi_benchmark_segments.cpp (original)
+++ trunk/libs/polygon/benchmark/voronoi_benchmark_segments.cpp 2012-09-08 08:57:50 EDT (Sat, 08 Sep 2012)
@@ -110,7 +110,6 @@
       }
       clean_segment_set(ssd);
     }
- double time_per_test = timer.elapsed() / NUM_RUNS[i];
     running_times.push_back(timer.elapsed());
   }
   return running_times;

Modified: trunk/libs/polygon/example/Jamfile.v2
==============================================================================
--- trunk/libs/polygon/example/Jamfile.v2 (original)
+++ trunk/libs/polygon/example/Jamfile.v2 2012-09-08 08:57:50 EDT (Sat, 08 Sep 2012)
@@ -18,11 +18,11 @@
 
 exe voronoi-visualizer
     :
- voronoi_visualizer.cpp
- [ cast _ moccable-cpp : voronoi_visualizer.cpp ]
- /qt//QtOpenGL
+ voronoi_visualizer.cpp
+ [ cast _ moccable-cpp : voronoi_visualizer.cpp ]
+ /qt//QtOpenGL
     :
- <target-os>windows:<library>opengl
+ <target-os>windows:<library>opengl
     ;
 
 alias "basic-tutorial"

Modified: trunk/libs/polygon/example/voronoi_advanced_tutorial.cpp
==============================================================================
--- trunk/libs/polygon/example/voronoi_advanced_tutorial.cpp (original)
+++ trunk/libs/polygon/example/voronoi_advanced_tutorial.cpp 2012-09-08 08:57:50 EDT (Sat, 08 Sep 2012)
@@ -22,8 +22,7 @@
 #include <boost/timer/timer.hpp>
 
 #include <boost/polygon/voronoi.hpp>
-using boost::polygon::voronoi_builder;
-using boost::polygon::voronoi_diagram;
+using namespace boost::polygon;
 
 struct my_ulp_comparison {
   enum Result {
@@ -88,20 +87,13 @@
 // Voronoi diagram traits.
 struct my_voronoi_diagram_traits {
   typedef fpt80 coordinate_type;
- typedef struct {
- template <typename CT>
- fpt80 operator()(const CT& that) const {
- return static_cast<fpt80>(that);
- }
- } ctype_converter_type;
- typedef detail::point_2d<coordinate_type> point_type;
   typedef voronoi_cell<coordinate_type> cell_type;
   typedef voronoi_vertex<coordinate_type> vertex_type;
   typedef voronoi_edge<coordinate_type> edge_type;
- typedef struct {
+ typedef class {
   public:
     enum { ULPS = 128 };
- bool operator()(const point_type &v1, const point_type &v2) const {
+ bool operator()(const vertex_type &v1, const vertex_type &v2) const {
       return (ulp_cmp(v1.x(), v2.x(), ULPS) == my_ulp_comparison::EQUAL &&
               ulp_cmp(v1.y(), v2.y(), ULPS) == my_ulp_comparison::EQUAL);
     }
@@ -146,8 +138,8 @@
 
   printf("Construction done in: %s seconds.\n", ftime.c_str());
   printf("Resulting Voronoi graph has the following stats:\n");
- printf("Number of Voronoi cells: %d.\n", vd.num_cells());
- printf("Number of Voronoi vertices: %d.\n", vd.num_vertices());
- printf("Number of Voronoi edges: %d.\n", vd.num_edges());
+ printf("Number of Voronoi cells: %lu.\n", vd.num_cells());
+ printf("Number of Voronoi vertices: %lu.\n", vd.num_vertices());
+ printf("Number of Voronoi edges: %lu.\n", vd.num_edges());
   return 0;
 }

Modified: trunk/libs/polygon/example/voronoi_basic_tutorial.cpp
==============================================================================
--- trunk/libs/polygon/example/voronoi_basic_tutorial.cpp (original)
+++ trunk/libs/polygon/example/voronoi_basic_tutorial.cpp 2012-09-08 08:57:50 EDT (Sat, 08 Sep 2012)
@@ -149,7 +149,7 @@
     }
     for (voronoi_diagram<double>::const_cell_iterator it = vd.cells().begin();
          it != vd.cells().end(); ++it) {
- printf("%d ", it->color());
+ printf("%lu ", it->color());
     }
     printf("\n");
     printf("\n");

Modified: trunk/libs/polygon/example/voronoi_visualizer.cpp
==============================================================================
--- trunk/libs/polygon/example/voronoi_visualizer.cpp (original)
+++ trunk/libs/polygon/example/voronoi_visualizer.cpp 2012-09-08 08:57:50 EDT (Sat, 08 Sep 2012)
@@ -14,9 +14,7 @@
 #include <QtOpenGL/QGLWidget>
 #include <QtGui/QtGui>
 
-#include <boost/polygon/point_data.hpp>
-#include <boost/polygon/rectangle_data.hpp>
-#include <boost/polygon/segment_data.hpp>
+#include <boost/polygon/polygon.hpp>
 #include <boost/polygon/voronoi.hpp>
 using namespace boost::polygon;
 
@@ -107,9 +105,9 @@
 
  private:
   typedef double coordinate_type;
- typedef point_data<double> point_type;
- typedef segment_data<double> segment_type;
- typedef rectangle_data<double> rect_type;
+ typedef point_data<coordinate_type> point_type;
+ typedef segment_data<coordinate_type> segment_type;
+ typedef rectangle_data<coordinate_type> rect_type;
   typedef voronoi_builder<int> VB;
   typedef voronoi_diagram<coordinate_type> VD;
   typedef VD::cell_type cell_type;
@@ -217,9 +215,11 @@
       glVertex2f(point.x(), point.y());
     }
     for (std::size_t i = 0; i < segment_data_.size(); ++i) {
- point_type lp = deconvolve(low(segment_data_[i]), shift_);
- point_type hp = deconvolve(high(segment_data_[i]), shift_);
+ point_type lp = low(segment_data_[i]);
+ lp = deconvolve(lp, shift_);
       glVertex2f(lp.x(), lp.y());
+ point_type hp = high(segment_data_[i]);
+ hp = deconvolve(hp, shift_);
       glVertex2f(hp.x(), hp.y());
     }
     glEnd();
@@ -231,9 +231,11 @@
     glLineWidth(2.7f);
     glBegin(GL_LINES);
     for (std::size_t i = 0; i < segment_data_.size(); ++i) {
- point_type lp = deconvolve(low(segment_data_[i]), shift_);
- point_type hp = deconvolve(high(segment_data_[i]), shift_);
+ point_type lp = low(segment_data_[i]);
+ lp = deconvolve(lp, shift_);
       glVertex2f(lp.x(), lp.y());
+ point_type hp = high(segment_data_[i]);
+ hp = deconvolve(hp, shift_);
       glVertex2f(hp.x(), hp.y());
     }
     glEnd();


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