Boost logo

Boost-Commit :

From: mariano.consoni_at_[hidden]
Date: 2008-05-19 10:36:35


Author: mconsoni
Date: 2008-05-19 10:36:34 EDT (Mon, 19 May 2008)
New Revision: 45544
URL: http://svn.boost.org/trac/boost/changeset/45544

Log:
- bug with dups fixed.

Text files modified:
   sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/performance_test.cpp | 13 ++++++++-----
   1 files changed, 8 insertions(+), 5 deletions(-)

Modified: sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/performance_test.cpp
==============================================================================
--- sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/performance_test.cpp (original)
+++ sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/performance_test.cpp 2008-05-19 10:36:34 EDT (Mon, 19 May 2008)
@@ -18,7 +18,8 @@
 
 std::vector<std::pair<double,double> > read_data(void)
 {
- std::vector<std::pair<double,double> > v;
+ std::set<std::pair<double,double> > v;
+ std::vector<std::pair<double,double> > r;
 
         std::ifstream data;
         data.open("gis-data.txt");
@@ -27,12 +28,12 @@
         data >> x;
         data >> y;
         while(!data.eof()) {
-// std::cout << "x,y -> " << x << "," << y << std::endl;
                 data >> x;
                 data >> y;
- v.push_back(std::make_pair(x,y));
+ v.insert(std::make_pair(x,y));
         }
- return v;
+ copy(v.begin(), v.end(), std::back_inserter(r));
+ return r;
 }
 
 
@@ -58,6 +59,8 @@
         std::vector<unsigned int> ids;
          std::vector<std::pair<double, double> > points = read_data();
 
+// std::cerr << "Size: " << points.size() << std::endl;
+
         // plane
          const double min_x = -130.0;
          const double min_y = 10.0;
@@ -65,7 +68,7 @@
          const double max_y = 80.0;
 
         // number of points to find on the search phase
- const unsigned int find_count = 50;
+ const unsigned int find_count = 1000;
 
          for(unsigned int i = 0; i < points.size(); i++) {
                  ids.push_back(i);


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