|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85496 - trunk/libs/geometry/index/example
From: adam.wulkiewicz_at_[hidden]
Date: 2013-08-27 20:55:08
Author: awulkiew
Date: 2013-08-27 20:55:08 EDT (Tue, 27 Aug 2013)
New Revision: 85496
URL: http://svn.boost.org/trac/boost/changeset/85496
Log:
[geometry][index]example: added alternative type-erased query iterators 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 Tue Aug 27 20:51:14 2013 (r85495)
+++ trunk/libs/geometry/index/example/benchmark_experimental.cpp 2013-08-27 20:55:08 EDT (Tue, 27 Aug 2013) (r85496)
@@ -227,6 +227,38 @@
dur_t time = clock_t::now() - start;
std::cout << time << " - 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_alt first = t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10))));
+ RT::const_query_iterator_alt 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-erased2 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_alt first = t.qbegin(bgi::intersects(B(P(x - 10, y - 10), P(x + 10, y + 10))));
+ RT::const_query_iterator_alt 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-erased2 qbegin(B) qend() " << queries_count << " found " << temp << '\n';
+ }
#endif
#endif
@@ -325,6 +357,38 @@
dur_t time = clock_t::now() - start;
std::cout << time << " - type-erased 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_alt first = t.qbegin(bgi::nearest(P(x, y), neighbours_count));
+ RT::const_query_iterator_alt 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-erased2 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_alt first = t.qbegin(bgi::nearest(P(x, y), neighbours_count));
+ RT::const_query_iterator_alt 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-erased2 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