Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82607 - sandbox-branches/geometry/index/tests
From: adam.wulkiewicz_at_[hidden]
Date: 2013-01-25 08:34:28


Author: awulkiew
Date: 2013-01-25 08:34:27 EST (Fri, 25 Jan 2013)
New Revision: 82607
URL: http://svn.boost.org/trac/boost/changeset/82607

Log:
removed old queries from additional_speed test.
Text files modified:
   sandbox-branches/geometry/index/tests/additional_speed.cpp | 120 +++-------------------------------------
   1 files changed, 9 insertions(+), 111 deletions(-)

Modified: sandbox-branches/geometry/index/tests/additional_speed.cpp
==============================================================================
--- sandbox-branches/geometry/index/tests/additional_speed.cpp (original)
+++ sandbox-branches/geometry/index/tests/additional_speed.cpp 2013-01-25 08:34:27 EST (Fri, 25 Jan 2013)
@@ -59,7 +59,7 @@
     //typedef bgi::rtree<B, bgi::rstar<32, 8> > RT;
     //typedef bgi::rtree<B, bgi::runtime::rstar > RT;
 
- for (unsigned i = 0 ; i < 10 ; ++i)
+ for (;;)
     {
         RT t;
         //RT t(bgi::runtime::linear(32, 8));
@@ -93,64 +93,11 @@
                 float x = coords[i].first;
                 float y = coords[i].second;
                 result.clear();
- t.spatial_query(B(P(x - 10, y - 10), P(x + 10, y + 10)), std::back_inserter(result));
+ t.query(B(P(x - 10, y - 10), P(x + 10, y + 10)), std::back_inserter(result));
                 temp += result.size();
             }
             double time = tim.elapsed();
- std::cout << time << "s - spatial_query(B) " << queries_count << " found " << temp << '\n';
- }
-
- {
- tim.restart();
- size_t temp = 0;
- for (size_t i = 0 ; i < queries_count / 2 ; ++i )
- {
- float x1 = coords[i].first;
- float y1 = coords[i].second;
- float x2 = coords[i+1].first;
- float y2 = coords[i+1].second;
- float x3 = coords[i+2].first;
- float y3 = coords[i+2].second;
- result.clear();
- t.spatial_query(
- boost::make_tuple(
- bgi::intersects(B(P(x1 - 10, y1 - 10), P(x1 + 10, y1 + 10))),
- !bgi::within(B(P(x2 - 10, y2 - 10), P(x2 + 10, y2 + 10))),
- !bgi::overlaps(B(P(x3 - 10, y3 - 10), P(x3 + 10, y3 + 10)))
- ),
- std::back_inserter(result)
- );
- temp += result.size();
- }
- double time = tim.elapsed();
- std::cout << time << "s - spatial_query(i, !w, !o) " << queries_count << " found " << temp << '\n';
- }
-
- {
- tim.restart();
- size_t temp = 0;
- for (size_t i = 0 ; i < queries_count / 2 ; ++i )
- {
- float x1 = coords[i].first;
- float y1 = coords[i].second;
- float x2 = coords[i+1].first;
- float y2 = coords[i+1].second;
- float x3 = coords[i+2].first;
- float y3 = coords[i+2].second;
- result.clear();
- t.spatial_query(
- bgi::intersects(B(P(x1 - 10, y1 - 10), P(x1 + 10, y1 + 10)))
- &&
- !bgi::within(B(P(x2 - 10, y2 - 10), P(x2 + 10, y2 + 10)))
- &&
- !bgi::overlaps(B(P(x3 - 10, y3 - 10), P(x3 + 10, y3 + 10)))
- ,
- std::back_inserter(result)
- );
- temp += result.size();
- }
- double time = tim.elapsed();
- std::cout << time << "s - spatial_query(i && !w && !o) " << queries_count << " found " << temp << '\n';
+ std::cout << time << "s - query(B) " << queries_count << " found " << temp << '\n';
         }
 
         {
@@ -189,10 +136,10 @@
             {
                 float x = coords[i].first + 100;
                 float y = coords[i].second + 100;
- temp += t.nearest_query(P(x, y), result_one);
+ temp += t.query(bgi::nearest(P(x, y)), result_one);
             }
             double time = tim.elapsed();
- std::cout << time << "s - nearest_query(P) " << (queries_count / 10) << " found " << temp << '\n';
+ std::cout << time << "s - query(nearest(P)) " << (queries_count / 10) << " found " << temp << '\n';
         }
 
         {
@@ -203,10 +150,10 @@
                 float x = coords[i].first + 100;
                 float y = coords[i].second + 100;
                 result.clear();
- temp += t.nearest_query(P(x, y), 5, std::back_inserter(result));
+ temp += t.query(bgi::nearest(P(x, y), 5), std::back_inserter(result));
             }
             double time = tim.elapsed();
- std::cout << time << "s - nearest_query(P, 5) " << (queries_count / 10) << " found " << temp << '\n';
+ std::cout << time << "s - query(nearest(P, 5)) " << (queries_count / 10) << " found " << temp << '\n';
         }
 
         {
@@ -217,66 +164,17 @@
                 float x = coords[i].first + 100;
                 float y = coords[i].second + 100;
                 result.clear();
- temp += t.nearest_query(
+ temp += t.query(bgi::nearest(
                     bgi::bounded(
                         bgi::to_nearest(P(x, y)),
                         bgi::to_centroid(0),
                         bgi::to_furthest(100000)
                     ),
- 5,
+ 5),
                     std::back_inserter(result)
                 );
             }
             double time = tim.elapsed();
- std::cout << time << "s - nearest_query(bounded(n, c, f), 5) " << (queries_count / 10) << " found " << temp << '\n';
- }
-
- {
- tim.restart();
- size_t temp = 0;
- for (size_t i = 0 ; i < queries_count / 10 ; ++i )
- {
- float x = coords[i].first + 100;
- float y = coords[i].second + 100;
- temp += t.query(bgi::nearest(P(x, y)), result_one);
- }
- double time = tim.elapsed();
- std::cout << time << "s - query(nearest(P)) " << (queries_count / 10) << " found " << temp << '\n';
- }
-
- {
- tim.restart();
- size_t temp = 0;
- for (size_t i = 0 ; i < queries_count / 10 ; ++i )
- {
- float x = coords[i].first + 100;
- float y = coords[i].second + 100;
- result.clear();
- temp += t.query(bgi::nearest(P(x, y), 5), std::back_inserter(result));
- }
- double time = tim.elapsed();
- std::cout << time << "s - query(nearest(P, 5)) " << (queries_count / 10) << " found " << temp << '\n';
- }
-
- {
- tim.restart();
- size_t temp = 0;
- for (size_t i = 0 ; i < queries_count / 10 ; ++i )
- {
- float x = coords[i].first + 100;
- float y = coords[i].second + 100;
- result.clear();
- temp += t.query(bgi::nearest(
- bgi::bounded(
- bgi::to_nearest(P(x, y)),
- bgi::to_centroid(0),
- bgi::to_furthest(100000)
- ),
- 5),
- std::back_inserter(result)
- );
- }
- double time = tim.elapsed();
             std::cout << time << "s - query(nearest(bounded(n, c, f), 5)) " << (queries_count / 10) << " found " << temp << '\n';
         }
 


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