|
Boost-Commit : |
From: mariano.consoni_at_[hidden]
Date: 2008-06-19 11:10:17
Author: mconsoni
Date: 2008-06-19 11:10:16 EDT (Thu, 19 Jun 2008)
New Revision: 46516
URL: http://svn.boost.org/trac/boost/changeset/46516
Log:
- simple test working :D
Text files modified:
sandbox/SOC/2008/spacial_indexing/boost/spatial_index/rtree.hpp | 18 ++++++++----------
sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/simple_test_rtree.cpp | 6 ------
2 files changed, 8 insertions(+), 16 deletions(-)
Modified: sandbox/SOC/2008/spacial_indexing/boost/spatial_index/rtree.hpp
==============================================================================
--- sandbox/SOC/2008/spacial_indexing/boost/spatial_index/rtree.hpp (original)
+++ sandbox/SOC/2008/spacial_indexing/boost/spatial_index/rtree.hpp 2008-06-19 11:10:16 EDT (Thu, 19 Jun 2008)
@@ -58,12 +58,10 @@
typename rtree_node<Point,Value>::node_map q_nodes;
condense_tree(l, q_nodes);
+
std::vector<std::pair<geometry::box<Point>, Value> > s;
for(typename rtree_node<Point,Value>::node_map::const_iterator it = q_nodes.begin(); it != q_nodes.end(); ++it) {
typename rtree_leaf<Point,Value>::leaves_map leaves = it->second->get_leaves();
- std::cerr << "Leaves to reinsert: " << leaves.size() << std::endl;
- it->second->print();
- std::cerr << "--------------------------->>"<<std::endl;
// reinserting leaves from nodes
for(typename rtree_leaf<Point,Value>::leaves_map::const_iterator itl = leaves.begin(); itl != leaves.end(); ++itl) {
@@ -203,6 +201,11 @@
parent->adjust_box(l);
if(parent->elements() < m_) {
+ if(parent->is_root()) {
+ // if the parent is underfull and it's the root we just exit
+ return;
+ }
+
std::cerr << "condense_node: underfull node (" << parent.get() << ")" << std::endl;
typename rtree_node<Point,Value>::node_map this_nodes = parent->get_nodes();
@@ -211,13 +214,8 @@
q_nodes.push_back(*it);
}
- if(parent->is_root()) {
- std::cerr << "The underfull node is the root, returning." << std::endl;
- return;
- } else {
- // we remove the node in the parent node because now it should be re inserted
- parent->get_parent()->remove(parent->get_parent()->get_box(parent));
- }
+ // we remove the node in the parent node because now it should be re inserted
+ parent->get_parent()->remove(parent->get_parent()->get_box(parent));
}
condense_tree(parent, q_nodes);
Modified: sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/simple_test_rtree.cpp
==============================================================================
--- sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/simple_test_rtree.cpp (original)
+++ sandbox/SOC/2008/spacial_indexing/libs/spatial_index/test/simple_test_rtree.cpp 2008-06-19 11:10:16 EDT (Thu, 19 Jun 2008)
@@ -183,19 +183,13 @@
// remove test
std::cerr << " --> remove" << std::endl;
- q->print();
q->remove(geometry::box<geometry::point_xy<double> >(geometry::point_xy<double>(10.0,10.0), geometry::point_xy<double>(12.0,13.0)));
- q->print();
-
- return 0;
std::cerr << " --> remove" << std::endl;
q->remove(geometry::box<geometry::point_xy<double> >(geometry::point_xy<double>(7.0,4.0), geometry::point_xy<double>(12.0,7.0)));
- q->print();
std::cerr << " --> remove" << std::endl;
q->remove(geometry::box<geometry::point_xy<double> >(geometry::point_xy<double>(10.0,12.0), geometry::point_xy<double>(13.0,13.0)));
- q->print();
std::cerr << " --> remove" << std::endl;
q->remove(geometry::box<geometry::point_xy<double> >(geometry::point_xy<double>(10.0,10.0), geometry::point_xy<double>(11.0,11.0)));
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