Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83289 - in sandbox-branches/geometry/index: boost/geometry/index test/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2013-03-03 20:06:58


Author: awulkiew
Date: 2013-03-03 20:06:58 EST (Sun, 03 Mar 2013)
New Revision: 83289
URL: http://svn.boost.org/trac/boost/changeset/83289

Log:
rtree: errors in indexable_get() and value_eq() fixed,
indexable_get() and value_eq() used in rtree tests instead of translator().

Text files modified:
   sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp | 4 +-
   sandbox-branches/geometry/index/test/rtree/test_rtree.hpp | 52 ++++++++++++++++-----------------------
   2 files changed, 23 insertions(+), 33 deletions(-)

Modified: sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/rtree.hpp 2013-03-03 20:06:58 EST (Sun, 03 Mar 2013)
@@ -810,7 +810,7 @@
     */
     indexable_getter indexable_get() const
     {
- return m_members.translator().indexable_get();
+ return m_members.indexable_getter();
     }
 
     /*!
@@ -823,7 +823,7 @@
     */
     value_equal value_eq() const
     {
- return m_members.translator().value_eq();
+ return m_members.equal_to();
     }
 
     /*!

Modified: sandbox-branches/geometry/index/test/rtree/test_rtree.hpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/test_rtree.hpp (original)
+++ sandbox-branches/geometry/index/test/rtree/test_rtree.hpp 2013-03-03 20:06:58 EST (Sun, 03 Mar 2013)
@@ -503,7 +503,7 @@
 Iter test_find(Rtree const& rtree, Iter first, Iter last, Value const& value)
 {
     for ( ; first != last ; ++first )
- if ( rtree.translator().equals(value, *first) )
+ if ( rtree.value_eq()(value, *first) )
             return first;
     return first;
 }
@@ -535,7 +535,7 @@
         typename Range2::const_iterator it2 = expected_output.begin();
         for ( ; it1 != output.end() && it2 != expected_output.end() ; ++it1, ++it2 )
         {
- if ( !rtree.translator().equals(*it1, *it2) )
+ if ( !rtree.value_eq()(*it1, *it2) )
             {
                 BOOST_CHECK(false && "rtree.translator().equals(*it1, *it2)");
                 break;
@@ -576,7 +576,7 @@
     std::vector<Value> expected_output;
 
     BOOST_FOREACH(Value const& v, input)
- if ( bg::intersects(tree.translator()(v), qbox) )
+ if ( bg::intersects(tree.indexable_get()(v), qbox) )
             expected_output.push_back(v);
 
     //test_spatial_query(tree, qbox, expected_output);
@@ -600,7 +600,7 @@
     std::vector<Value> expected_output;
 
     BOOST_FOREACH(Value const& v, input)
- if ( bg::disjoint(tree.translator()(v), qbox) )
+ if ( bg::disjoint(tree.indexable_get()(v), qbox) )
             expected_output.push_back(v);
 
     test_spatial_query(tree, bgi::disjoint(qbox), expected_output);
@@ -622,7 +622,7 @@
     std::vector<Value> expected_output;
 
     BOOST_FOREACH(Value const& v, input)
- if ( bg::covered_by(tree.translator()(v), qbox) )
+ if ( bg::covered_by(tree.indexable_get()(v), qbox) )
             expected_output.push_back(v);
 
     test_spatial_query(tree, bgi::covered_by(qbox), expected_output);
@@ -645,7 +645,7 @@
         std::vector<Value> expected_output;
 
         BOOST_FOREACH(Value const& v, input)
- if ( bg::overlaps(tree.translator()(v), qbox) )
+ if ( bg::overlaps(tree.indexable_get()(v), qbox) )
                 expected_output.push_back(v);
 
         test_spatial_query(tree, bgi::overlaps(qbox), expected_output);
@@ -717,7 +717,7 @@
     std::vector<Value> expected_output;
 
     BOOST_FOREACH(Value const& v, input)
- if ( bg::within(tree.translator()(v), qbox) )
+ if ( bg::within(tree.indexable_get()(v), qbox) )
             expected_output.push_back(v);
 
     test_spatial_query(tree, bgi::within(qbox), expected_output);
@@ -770,7 +770,7 @@
     // calculate test output - k closest values pairs
     BOOST_FOREACH(Value const& v, input)
     {
- D d = bgi::detail::comparable_distance_near(pt, rtree.translator()(v));
+ D d = bgi::detail::comparable_distance_near(pt, rtree.indexable_get()(v));
 
         if ( test_output.size() < k )
             test_output.push_back(std::make_pair(d, v));
@@ -808,7 +808,7 @@
 
             if ( test_find(rtree, expected_output.begin(), expected_output.end(), v) == expected_output.end() )
             {
- D d = bgi::detail::comparable_distance_near(pt, rtree.translator()(v));
+ D d = bgi::detail::comparable_distance_near(pt, rtree.indexable_get()(v));
                 BOOST_CHECK(d == biggest_d);
             }
         }
@@ -899,8 +899,7 @@
     t1.query(bgi::intersects(qbox), std::back_inserter(output));
     test_exactly_the_same_outputs(t1, output, expected_output);
 
- // TEMPORARILY USED translator()
- Rtree t2(tree.parameters(), tree.translator(), tree.translator(), tree.get_allocator());
+ Rtree t2(tree, tree.get_allocator());
     t2.swap(t1);
     BOOST_CHECK(tree.empty() == t2.empty());
     BOOST_CHECK(tree.size() == t2.size());
@@ -948,8 +947,7 @@
     tree.query(bgi::intersects(qbox), std::back_inserter(expected_output));
 
     {
- // TEMPORARILY USED translator()
- Rtree t(tree.parameters(), tree.translator(), tree.translator(), tree.get_allocator());
+ Rtree t(tree, tree.get_allocator());
         BOOST_FOREACH(Value const& v, input)
             t.insert(v);
         BOOST_CHECK(tree.size() == t.size());
@@ -958,8 +956,7 @@
         test_exactly_the_same_outputs(t, output, expected_output);
     }
     {
- // TEMPORARILY USED translator()
- Rtree t(tree.parameters(), tree.translator(), tree.translator(), tree.get_allocator());
+ Rtree t(tree, tree.get_allocator());
         std::copy(input.begin(), input.end(), bgi::inserter(t));
         BOOST_CHECK(tree.size() == t.size());
         std::vector<Value> output;
@@ -967,24 +964,21 @@
         test_exactly_the_same_outputs(t, output, expected_output);
     }
     {
- // TEMPORARILY USED translator()
- Rtree t(input.begin(), input.end(), tree.parameters(), tree.translator(), tree.translator(), tree.get_allocator());
+ Rtree t(input.begin(), input.end(), tree.parameters(), tree.indexable_get(), tree.value_eq(), tree.get_allocator());
         BOOST_CHECK(tree.size() == t.size());
         std::vector<Value> output;
         t.query(bgi::intersects(qbox), std::back_inserter(output));
         test_exactly_the_same_outputs(t, output, expected_output);
     }
     {
- // TEMPORARILY USED translator()
- Rtree t(input, tree.parameters(), tree.translator(), tree.translator(), tree.get_allocator());
+ Rtree t(input, tree.parameters(), tree.indexable_get(), tree.value_eq(), tree.get_allocator());
         BOOST_CHECK(tree.size() == t.size());
         std::vector<Value> output;
         t.query(bgi::intersects(qbox), std::back_inserter(output));
         test_exactly_the_same_outputs(t, output, expected_output);
     }
     {
- // TEMPORARILY USED translator()
- Rtree t(tree.parameters(), tree.translator(), tree.translator(), tree.get_allocator());
+ Rtree t(tree, tree.get_allocator());
         t.insert(input.begin(), input.end());
         BOOST_CHECK(tree.size() == t.size());
         std::vector<Value> output;
@@ -992,8 +986,7 @@
         test_exactly_the_same_outputs(t, output, expected_output);
     }
     {
- // TEMPORARILY USED translator()
- Rtree t(tree.parameters(), tree.translator(), tree.translator(), tree.get_allocator());
+ Rtree t(tree, tree.get_allocator());
         t.insert(input);
         BOOST_CHECK(tree.size() == t.size());
         std::vector<Value> output;
@@ -1002,8 +995,7 @@
     }
 
     {
- // TEMPORARILY USED translator()
- Rtree t(tree.parameters(), tree.translator(), tree.translator(), tree.get_allocator());
+ Rtree t(tree, tree.get_allocator());
         BOOST_FOREACH(Value const& v, input)
             bgi::insert(t, v);
         BOOST_CHECK(tree.size() == t.size());
@@ -1012,8 +1004,7 @@
         test_exactly_the_same_outputs(t, output, expected_output);
     }
     {
- // TEMPORARILY USED translator()
- Rtree t(tree.parameters(), tree.translator(), tree.translator(), tree.get_allocator());
+ Rtree t(tree, tree.get_allocator());
         bgi::insert(t, input.begin(), input.end());
         BOOST_CHECK(tree.size() == t.size());
         std::vector<Value> output;
@@ -1021,8 +1012,7 @@
         test_exactly_the_same_outputs(t, output, expected_output);
     }
     {
- // TEMPORARILY USED translator()
- Rtree t(tree.parameters(), tree.translator(), tree.translator(), tree.get_allocator());
+ Rtree t(tree, tree.get_allocator());
         bgi::insert(t, input);
         BOOST_CHECK(tree.size() == t.size());
         std::vector<Value> output;
@@ -1301,7 +1291,7 @@
     generate_rtree(t, input, qbox);
 
     BOOST_FOREACH(Value const& v, input)
- bg::expand(b, t.translator()(v));
+ bg::expand(b, t.indexable_get()(v));
 
     BOOST_CHECK(bg::equals(t.bounds(), b));
     BOOST_CHECK(bg::equals(t.bounds(), bgi::bounds(t)));
@@ -1315,7 +1305,7 @@
 
     bg::assign_inverse(b);
     BOOST_FOREACH(Value const& v, input)
- bg::expand(b, t.translator()(v));
+ bg::expand(b, t.indexable_get()(v));
 
     BOOST_CHECK(bg::equals(t.bounds(), b));
 


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