Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72550 - in sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree: rstar visitors
From: adam.wulkiewicz_at_[hidden]
Date: 2011-06-12 07:23:32


Author: awulkiew
Date: 2011-06-12 07:23:31 EDT (Sun, 12 Jun 2011)
New Revision: 72550
URL: http://svn.boost.org/trac/boost/changeset/72550

Log:
dirty check of children nodes (is_leaf) removed from rstar* choose_next_node, replaced by passing additional parameter
Text files modified:
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp | 9 ++-------
   sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp | 4 ++--
   2 files changed, 4 insertions(+), 9 deletions(-)

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp 2011-06-12 07:23:31 EDT (Sun, 12 Jun 2011)
@@ -41,17 +41,12 @@
 
 public:
     template <typename Indexable>
- static inline size_t apply(internal_node & n, Indexable const& indexable)
+ static inline size_t apply(internal_node & n, Indexable const& indexable, size_t node_relative_level)
     {
         children_type & children = rtree::elements(n);
- assert(!children.empty());
         
- // check if children are leafs
- visitors::is_leaf<Value, Box, rstar_tag> ilv;
- rtree::apply_visitor(ilv, *children.front().second);
-
         // children are leafs
- if ( ilv.result )
+ if ( node_relative_level <= 1 )
             return choose_by_minimum_overlap_cost(children, indexable);
         // children are internal nodes
         else

Modified: sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp (original)
+++ sandbox-branches/geometry/index_080_new/boost/geometry/extensions/index/rtree/visitors/insert.hpp 2011-06-12 07:23:31 EDT (Sun, 12 Jun 2011)
@@ -33,7 +33,7 @@
     typedef typename index::default_area_result<Box>::type area_type;
 
     template <typename Indexable>
- static inline size_t apply(internal_node & n, Indexable const& indexable)
+ static inline size_t apply(internal_node & n, Indexable const& indexable, size_t /*node_relative_level*/)
     {
         children_type & children = rtree::elements(n);
 
@@ -178,7 +178,7 @@
     {
         // choose next node
         size_t choosen_node_index = detail::choose_next_node<Value, Box, Tag>::
- apply(n, rtree::element_indexable(m_element, m_tr));
+ apply(n, rtree::element_indexable(m_element, m_tr), m_leafs_level - m_current_level);
 
         // expand the node to contain value
         geometry::expand(


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