Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83944 - in trunk/libs/geometry: doc/html/img/index/rtree doc/index/rtree example/index test/index/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2013-04-17 20:04:30


Author: awulkiew
Date: 2013-04-17 20:04:29 EDT (Wed, 17 Apr 2013)
New Revision: 83944
URL: http://svn.boost.org/trac/boost/changeset/83944

Log:
geometry.index: docs - updated rtree times and linear picture, test - cosmetic change in experimental query iterator test, example - added experimental query iterator to the benchmark
Binary files modified:
   trunk/libs/geometry/doc/html/img/index/rtree/linear.png
Text files modified:
   trunk/libs/geometry/doc/index/rtree/introduction.qbk | 6 +++---
   trunk/libs/geometry/example/index/benchmark.cpp | 28 ++++++++++++++++++++++++----
   trunk/libs/geometry/test/index/rtree/test_rtree.hpp | 10 +---------
   3 files changed, 28 insertions(+), 16 deletions(-)

Modified: trunk/libs/geometry/doc/html/img/index/rtree/linear.png
==============================================================================
Binary files. No diff available.

Modified: trunk/libs/geometry/doc/index/rtree/introduction.qbk
==============================================================================
--- trunk/libs/geometry/doc/index/rtree/introduction.qbk (original)
+++ trunk/libs/geometry/doc/index/rtree/introduction.qbk 2013-04-17 20:04:29 EDT (Wed, 17 Apr 2013)
@@ -39,9 +39,9 @@
 [table
 [[] [linear algorithm] [quadratic algorithm] [R*-tree]]
 [[*Example structure*] [[$img/index/rtree/linear.png]] [[$img/index/rtree/quadratic.png]] [[$img/index/rtree/rstar.png]]]
-[[*1M Values inserts*] [2.11s] [2.98s] [5.49s]]
-[[*100k spatial queries*] [1.52s] [0.45s] [0.17s]]
-[[*100k knn queries*] [4.51s] [2.22s] [0.6s]]
+[[*1M Values inserts*] [1.65s] [2.51s] [4.96s]]
+[[*100k spatial queries*] [0.87s] [0.25s] [0.09s]]
+[[*100k knn queries*] [3.25s] [1.41s] [0.51s]]
 ]
 
 [heading Implementation details]

Modified: trunk/libs/geometry/example/index/benchmark.cpp
==============================================================================
--- trunk/libs/geometry/example/index/benchmark.cpp (original)
+++ trunk/libs/geometry/example/index/benchmark.cpp 2013-04-17 20:04:29 EDT (Wed, 17 Apr 2013)
@@ -9,6 +9,7 @@
 
 #include <iostream>
 
+#define BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL
 #include <boost/geometry/index/rtree.hpp>
 
 #include <boost/chrono.hpp>
@@ -47,9 +48,9 @@
 
     typedef bg::model::point<double, 2, bg::cs::cartesian> P;
     typedef bg::model::box<P> B;
- typedef bgi::rtree<B, bgi::linear<32, 8> > RT;
- //typedef bgi::rtree<B, bgi::quadratic<32, 8> > RT;
- //typedef bgi::rtree<B, bgi::rstar<32, 8> > RT;
+ typedef bgi::rtree<B, bgi::linear<16, 4> > RT;
+ //typedef bgi::rtree<B, bgi::quadratic<8, 3> > RT;
+ //typedef bgi::rtree<B, bgi::rstar<8, 3> > RT;
 
     std::cout << "sizeof rtree: " << sizeof(RT) << std::endl;
 
@@ -91,6 +92,25 @@
             std::cout << time << " - query(B) " << queries_count << " found " << temp << '\n';
         }
 
+#ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL
+ {
+ 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();
+ 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));
+ temp += result.size();
+ }
+ dur_t time = clock_t::now() - start;
+ std::cout << time << " - query iterator(B) " << queries_count << " found " << temp << '\n';
+ }
+#endif
+
         {
             clock_t::time_point start = clock_t::now();
             size_t temp = 0;
@@ -123,7 +143,7 @@
         {
             clock_t::time_point start = clock_t::now();
             size_t temp = 0;
- for (size_t i = 0 ; i < queries_count / 10 ; ++i )
+ for (size_t i = 0 ; i < queries_count / 1 ; ++i )
             {
                 float x = coords[i].first + 100;
                 float y = coords[i].second + 100;

Modified: trunk/libs/geometry/test/index/rtree/test_rtree.hpp
==============================================================================
--- trunk/libs/geometry/test/index/rtree/test_rtree.hpp (original)
+++ trunk/libs/geometry/test/index/rtree/test_rtree.hpp 2013-04-17 20:04:29 EDT (Wed, 17 Apr 2013)
@@ -642,13 +642,6 @@
 
 // spatial query
 
-template <typename Iterator, typename Container>
-void spatial_query_iterator(Iterator first, Iterator last, Container & container)
-{
- for ( ; first != last ; ++first )
- container.push_back(*first);
-}
-
 template <typename Rtree, typename Value, typename Predicates>
 void spatial_query(Rtree & rtree, Predicates const& pred, std::vector<Value> const& expected_output)
 {
@@ -672,8 +665,7 @@
 
 #ifdef BOOST_GEOMETRY_INDEX_DETAIL_EXPERIMENTAL
     std::vector<Value> output3;
- //std::copy(rtree.qbegin(pred), rtree.qend(pred), std::back_inserter(output3));
- spatial_query_iterator(rtree.qbegin(pred), rtree.qend(pred), output3);
+ std::copy(rtree.qbegin(pred), rtree.qend(pred), std::back_inserter(output3));
 
     compare_outputs(rtree, output3, expected_output);
 #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