Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84749 - trunk/boost/geometry/index/detail/rtree/rstar
From: adam.wulkiewicz_at_[hidden]
Date: 2013-06-12 07:38:56


Author: awulkiew
Date: 2013-06-12 07:38:56 EDT (Wed, 12 Jun 2013)
New Revision: 84749
URL: http://svn.boost.org/trac/boost/changeset/84749

Log:
[geometry][index] sort replaced by partial_sort in R* choose_next_node.

Text files modified:
   trunk/boost/geometry/index/detail/rtree/rstar/choose_next_node.hpp | 7 ++++---
   1 files changed, 4 insertions(+), 3 deletions(-)

Modified: trunk/boost/geometry/index/detail/rtree/rstar/choose_next_node.hpp
==============================================================================
--- trunk/boost/geometry/index/detail/rtree/rstar/choose_next_node.hpp Wed Jun 12 06:11:02 2013 (r84748)
+++ trunk/boost/geometry/index/detail/rtree/rstar/choose_next_node.hpp 2013-06-12 07:38:56 EDT (Wed, 12 Jun 2013) (r84749)
@@ -148,10 +148,11 @@
             sorted_children[i] = boost::make_tuple(i, content_diff, content);
         }
 
- // sort by content_diff
- std::sort(sorted_children.begin(), sorted_children.end(), content_diff_less);
+ BOOST_GEOMETRY_INDEX_ASSERT(overlap_cost_threshold <= children_count, "there is not enough children");
 
- BOOST_GEOMETRY_INDEX_ASSERT(overlap_cost_threshold <= children_count, "there are not enough children");
+ // sort by content_diff
+ //std::sort(sorted_children.begin(), sorted_children.end(), content_diff_less);
+ std::partial_sort(sorted_children.begin(), sorted_children.begin() + overlap_cost_threshold, sorted_children.end(), content_diff_less);
 
         // for overlap_cost_threshold child nodes find the one with smallest overlap value
         size_t choosen_index = 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