Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85501 - trunk/libs/geometry/index/example
From: adam.wulkiewicz_at_[hidden]
Date: 2013-08-28 09:54:26


Author: awulkiew
Date: 2013-08-28 09:54:25 EDT (Wed, 28 Aug 2013)
New Revision: 85501
URL: http://svn.boost.org/trac/boost/changeset/85501

Log:
[geometry][index]example: added additional implementation of type-erased query iterator to benchmark_experimental

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

Modified: trunk/libs/geometry/index/example/benchmark_experimental.cpp
==============================================================================
--- trunk/libs/geometry/index/example/benchmark_experimental.cpp Wed Aug 28 09:53:16 2013 (r85500)
+++ trunk/libs/geometry/index/example/benchmark_experimental.cpp 2013-08-28 09:54:25 EDT (Wed, 28 Aug 2013) (r85501)
@@ -259,6 +259,38 @@
             dur_t time = clock_t::now() - start;
             std::cout << time << " - type-erased2 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_alt2 first = t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10))));
+ RT::const_query_iterator_alt2 last = t.qend(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10))));
+ std::copy(first, last, std::back_inserter(result));
+ temp += result.size();
+ }
+ dur_t time = clock_t::now() - start;
+ std::cout << time << " - type-erased3 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_alt2 first = t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10))));
+ RT::const_query_iterator_alt2 last = t.qend();
+ std::copy(first, last, std::back_inserter(result));
+ temp += result.size();
+ }
+ dur_t time = clock_t::now() - start;
+ std::cout << time << " - type-erased3 qbegin(B) qend() " << queries_count << " found " << temp << '\n';
+ }
 #endif
 #endif
 
@@ -389,6 +421,38 @@
             dur_t time = clock_t::now() - start;
             std::cout << time << " - type-erased2 qbegin(nearest(P, " << neighbours_count << ")) qend() " << nearest_queries_count << " found " << temp << '\n';
         }
+ {
+ clock_t::time_point start = clock_t::now();
+ size_t temp = 0;
+ for (size_t i = 0 ; i < nearest_queries_count ; ++i )
+ {
+ float x = coords[i].first;
+ float y = coords[i].second;
+ result.clear();
+ RT::const_query_iterator_alt2 first = t.qbegin(bgi::nearest(P(x, y), neighbours_count));
+ RT::const_query_iterator_alt2 last = t.qend(bgi::nearest(P(x, y), neighbours_count));
+ std::copy(first, last, std::back_inserter(result));
+ temp += result.size();
+ }
+ dur_t time = clock_t::now() - start;
+ std::cout << time << " - type-erased3 qbegin(nearest(P, " << neighbours_count << ")) qend(n) " << nearest_queries_count << " found " << temp << '\n';
+ }
+ {
+ clock_t::time_point start = clock_t::now();
+ size_t temp = 0;
+ for (size_t i = 0 ; i < nearest_queries_count ; ++i )
+ {
+ float x = coords[i].first;
+ float y = coords[i].second;
+ result.clear();
+ RT::const_query_iterator_alt2 first = t.qbegin(bgi::nearest(P(x, y), neighbours_count));
+ RT::const_query_iterator_alt2 last = t.qend();
+ std::copy(first, last, std::back_inserter(result));
+ temp += result.size();
+ }
+ dur_t time = clock_t::now() - start;
+ std::cout << time << " - type-erased3 qbegin(nearest(P, " << neighbours_count << ")) qend() " << nearest_queries_count << " found " << temp << '\n';
+ }
 #endif
 
         {


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