Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85518 - trunk/libs/geometry/index/example
From: adam.wulkiewicz_at_[hidden]
Date: 2013-08-29 19:05:33


Author: awulkiew
Date: 2013-08-29 19:05:33 EDT (Thu, 29 Aug 2013)
New Revision: 85518
URL: http://svn.boost.org/trac/boost/changeset/85518

Log:
[geometry][index] examples: added queried() range and ranges created from query iterators to benchmark_experimental.

Text files modified:
   trunk/libs/geometry/index/example/benchmark_experimental.cpp | 71 ++++++++++++++++++++++++++++++++++++++-
   1 files changed, 68 insertions(+), 3 deletions(-)

Modified: trunk/libs/geometry/index/example/benchmark_experimental.cpp
==============================================================================
--- trunk/libs/geometry/index/example/benchmark_experimental.cpp Thu Aug 29 18:59:02 2013 (r85517)
+++ trunk/libs/geometry/index/example/benchmark_experimental.cpp 2013-08-29 19:05:33 EDT (Thu, 29 Aug 2013) (r85518)
@@ -71,10 +71,10 @@
 #ifndef BOOST_GEOMETRY_INDEX_BENCHMARK_DEBUG
     size_t values_count = 1000000;
     size_t queries_count = 100000;
- size_t nearest_queries_count = 10000;
+ size_t nearest_queries_count = 20000;
     unsigned neighbours_count = 10;
     size_t path_queries_count = 2000;
- size_t path_queries_count2 = 10000;
+ size_t path_queries_count2 = 20000;
     unsigned path_values_count = 10;
 #else
     size_t values_count = 1000;
@@ -174,6 +174,21 @@
             std::cout << time << " - query(B) " << queries_count << " found " << temp << '\n';
         }
 
+ {
+ clock_t::time_point start = clock_t::now();
+ size_t temp = 0;
+ for (size_t i = 0 ; i < queries_count ; ++i )
+ {
+ float x = coords[i].first;
+ float y = coords[i].second;
+ result.clear();
+ boost::copy(t | bgi::adaptors::queried(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))),
+ std::back_inserter(result));
+ temp += result.size();
+ }
+ dur_t time = clock_t::now() - start;
+ std::cout << time << " - range queried(B) " << queries_count << " found " << temp << '\n';
+ }
 
         {
             clock_t::time_point start = clock_t::now();
@@ -186,7 +201,7 @@
                 std::copy(
                     t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))),
                     t.qend(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))),
- std::back_inserter(result));
+ std::back_inserter(result));
                 temp += result.size();
             }
             dur_t time = clock_t::now() - start;
@@ -209,6 +224,24 @@
             dur_t time = clock_t::now() - start;
             std::cout << time << " - qbegin(B) qend() " << queries_count << " found " << temp << '\n';
         }
+ {
+ clock_t::time_point start = clock_t::now();
+ size_t temp = 0;
+ for (size_t i = 0 ; i < queries_count ; ++i )
+ {
+ float x = coords[i].first;
+ float y = coords[i].second;
+ result.clear();
+ boost::copy(
+ std::make_pair(
+ t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10)))),
+ t.qend(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10))))
+ ), std::back_inserter(result));
+ temp += result.size();
+ }
+ dur_t time = clock_t::now() - start;
+ std::cout << time << " - range qbegin(B) qend(B)" << queries_count << " found " << temp << '\n';
+ }
 
         {
             clock_t::time_point start = clock_t::now();
@@ -242,6 +275,38 @@
             dur_t time = clock_t::now() - start;
             std::cout << time << " - type-erased qbegin(B) qend() " << queries_count << " found " << temp << '\n';
         }
+ {
+ clock_t::time_point start = clock_t::now();
+ size_t temp = 0;
+ for (size_t i = 0 ; i < queries_count ; ++i )
+ {
+ float x = coords[i].first;
+ float y = coords[i].second;
+ result.clear();
+ RT::const_query_iterator first = t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10))));
+ RT::const_query_iterator last = t.qend(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10))));
+ boost::copy(std::make_pair(first, last), std::back_inserter(result));
+ temp += result.size();
+ }
+ dur_t time = clock_t::now() - start;
+ std::cout << time << " - range type-erased qbegin(B) qend(B) " << queries_count << " found " << temp << '\n';
+ }
+ {
+ clock_t::time_point start = clock_t::now();
+ size_t temp = 0;
+ for (size_t i = 0 ; i < queries_count ; ++i )
+ {
+ float x = coords[i].first;
+ float y = coords[i].second;
+ result.clear();
+ RT::const_query_iterator first = t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10))));
+ RT::const_query_iterator last = t.qend();
+ boost::copy(std::make_pair(first, last), std::back_inserter(result));
+ temp += result.size();
+ }
+ dur_t time = clock_t::now() - start;
+ std::cout << time << " - range type-erased qbegin(B) qend() " << queries_count << " found " << temp << '\n';
+ }
 
         {
             clock_t::time_point start = clock_t::now();


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