Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81802 - in sandbox-branches/geometry/index: boost/geometry/extensions/index/rtree/linear boost/geometry/extensions/index/rtree/node boost/geometry/extensions/index/rtree/quadratic boost/geometry/extensions/index/rtree/rstar boost/geometry/extensions/index/rtree/visitors test/rtree tests
From: adam.wulkiewicz_at_[hidden]
Date: 2012-12-08 18:47:54


Author: awulkiew
Date: 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
New Revision: 81802
URL: http://svn.boost.org/trac/boost/changeset/81802

Log:
Coding style improved (issues detected by Boost Inspect tool).
Text files modified:
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp | 26 +++---
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/dynamic_visitor.hpp | 8
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_d_mem_dynamic.hpp | 8
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_d_mem_static.hpp | 6
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_s_mem_dynamic.hpp | 22 ++--
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_s_mem_static.hpp | 8
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/static_visitor.hpp | 18 ++--
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp | 10 +-
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp | 170 ++++++++++++++++++++--------------------
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/insert.hpp | 2
   sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp | 2
   sandbox-branches/geometry/index/test/rtree/test_rtree.hpp | 4
   sandbox-branches/geometry/index/test/rtree/test_rtree_exceptions.hpp | 6
   sandbox-branches/geometry/index/tests/additional_glut_vis.cpp | 10 +-
   sandbox-branches/geometry/index/tests/additional_sizes_and_times.cpp | 10 +-
   sandbox-branches/geometry/index/tests/additional_speed.cpp | 9 ++
   sandbox-branches/geometry/index/tests/main.cpp | 10 +-
   sandbox-branches/geometry/index/tests/rtree_filters.hpp | 11 ++
   sandbox-branches/geometry/index/tests/rtree_function.hpp | 9 ++
   sandbox-branches/geometry/index/tests/t1.cpp | 9 ++
   sandbox-branches/geometry/index/tests/t2.cpp | 10 ++
   sandbox-branches/geometry/index/tests/translators.hpp | 35 +++++---
   22 files changed, 228 insertions(+), 175 deletions(-)

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/linear/redistribute_elements.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -54,9 +54,9 @@
                              size_t & seed1,
                              size_t & seed2)
     {
- const size_t elements_count = parameters.get_max_elements() + 1;
- BOOST_GEOMETRY_INDEX_ASSERT(elements.size() == elements_count, "unexpected number of elements");
- BOOST_GEOMETRY_INDEX_ASSERT(2 <= elements_count, "unexpected number of elements");
+ const size_t elements_count = parameters.get_max_elements() + 1;
+ BOOST_GEOMETRY_INDEX_ASSERT(elements.size() == elements_count, "unexpected number of elements");
+ BOOST_GEOMETRY_INDEX_ASSERT(2 <= elements_count, "unexpected number of elements");
 
         // find the lowest low, highest high
         coordinate_type lowest_low = index::get<min_corner, DimensionIndex>(rtree::element_indexable(elements[0], translator));
@@ -180,9 +180,9 @@
 
     static inline void apply(Elements const& elements,
                              Parameters const& parameters,
- Translator const& tr,
- size_t & seed1,
- size_t & seed2)
+ Translator const& tr,
+ size_t & seed1,
+ size_t & seed2)
     {
         coordinate_type separation = 0;
         pick_seeds_impl<Elements, Parameters, Translator, dimension>::apply(elements, parameters, tr, separation, seed1, seed2);
@@ -217,14 +217,14 @@
         typedef typename index::traits::coordinate_type<indexable_type>::type coordinate_type;
         typedef typename index::default_content_result<Box>::type content_type;
 
- elements_type & elements1 = rtree::elements(n);
- elements_type & elements2 = rtree::elements(second_node);
- const size_t elements1_count = parameters.get_max_elements() + 1;
+ elements_type & elements1 = rtree::elements(n);
+ elements_type & elements2 = rtree::elements(second_node);
+ const size_t elements1_count = parameters.get_max_elements() + 1;
 
- BOOST_GEOMETRY_INDEX_ASSERT(elements1.size() == elements1_count, "unexpected number of elements");
+ BOOST_GEOMETRY_INDEX_ASSERT(elements1.size() == elements1_count, "unexpected number of elements");
 
- // copy original elements
- elements_type elements_copy(elements1); // MAY THROW, STRONG (alloc, copy)
+ // copy original elements
+ elements_type elements_copy(elements1); // MAY THROW, STRONG (alloc, copy)
 
         // calculate initial seeds
         size_t seed1 = 0;
@@ -309,7 +309,7 @@
                         }
                     }
                 
- assert(0 < remaining);
+ BOOST_GEOMETRY_INDEX_ASSERT(0 < remaining, "unexpected value");
                     --remaining;
                 }
             }

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/dynamic_visitor.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/dynamic_visitor.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/dynamic_visitor.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -68,23 +68,23 @@
 template <typename Derived, typename Parameters, typename Value, typename Box, typename Allocators, typename Tag>
 inline Derived & get(dynamic_node<Value, Parameters, Box, Allocators, Tag> & n)
 {
- assert(dynamic_cast<Derived*>(&n));
+ BOOST_GEOMETRY_INDEX_ASSERT(dynamic_cast<Derived*>(&n), "can't cast to a Derived type");
     return static_cast<Derived&>(n);
 }
 
 template <typename Derived, typename Parameters, typename Value, typename Box, typename Allocators, typename Tag>
 inline Derived * get(dynamic_node<Value, Parameters, Box, Allocators, Tag> * n)
 {
- assert(dynamic_cast<Derived*>(n));
+ BOOST_GEOMETRY_INDEX_ASSERT(dynamic_cast<Derived*>(n), "can't cast to a Derived type");
     return static_cast<Derived*>(n);
 }
 
 // apply visitor
 
 template <typename Visitor, typename Visitable>
-inline void apply_visitor(Visitor &v, Visitable & n)
+inline void apply_visitor(Visitor & v, Visitable & n)
 {
- assert(&n);
+ BOOST_GEOMETRY_INDEX_ASSERT(&n, "null ptr");
     n.apply_visitor(v);
 }
 

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_d_mem_dynamic.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_d_mem_dynamic.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_d_mem_dynamic.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -108,7 +108,7 @@
 inline typename Translator::result_type
 element_indexable(Value const& el, Translator const& tr)
 {
- return tr(el);
+ return tr(el);
 }
 
 template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag, typename Translator>
@@ -125,21 +125,21 @@
 template <typename Node>
 struct elements_type
 {
- typedef typename Node::elements_type type;
+ typedef typename Node::elements_type type;
 };
 
 template <typename Node>
 inline typename elements_type<Node>::type &
 elements(Node & n)
 {
- return n.elements;
+ return n.elements;
 }
 
 template <typename Node>
 inline typename elements_type<Node>::type const&
 elements(Node const& n)
 {
- return n.elements;
+ return n.elements;
 }
 
 // elements derived type

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_d_mem_static.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_d_mem_static.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_d_mem_static.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -20,14 +20,14 @@
 
 template <typename Value, typename Parameters, typename Box, typename Allocators>
 struct dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
- : public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
+ : public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
 {
     typedef index::pushable_array<
         std::pair<
             Box,
             dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag> *
>,
- Parameters::max_elements + 1
+ Parameters::max_elements + 1
> elements_type;
 
     template <typename Dummy>
@@ -41,7 +41,7 @@
 
 template <typename Value, typename Parameters, typename Box, typename Allocators>
 struct dynamic_leaf<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
- : public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
+ : public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag>
 {
     typedef index::pushable_array<Value, Parameters::max_elements + 1> elements_type;
 

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_s_mem_dynamic.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_s_mem_dynamic.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_s_mem_dynamic.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -59,10 +59,10 @@
 template <typename Value, typename Parameters, typename Box, typename Allocators>
 struct node<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag>
 {
- typedef boost::variant<
- static_leaf<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag>,
- static_internal_node<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag>
- > type;
+ typedef boost::variant<
+ static_leaf<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag>,
+ static_internal_node<Value, Parameters, Box, Allocators, node_s_mem_dynamic_tag>
+ > type;
 };
 
 template <typename Value, typename Parameters, typename Box, typename Allocators>
@@ -107,13 +107,13 @@
 template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag, typename Translator>
 inline Box const&
 element_indexable(std::pair<
- Box,
- boost::variant<
- static_leaf<Value, Parameters, Box, Allocators, Tag>,
- static_internal_node<Value, Parameters, Box, Allocators, Tag>
- > *
- > const& el,
- Translator const&)
+ Box,
+ boost::variant<
+ static_leaf<Value, Parameters, Box, Allocators, Tag>,
+ static_internal_node<Value, Parameters, Box, Allocators, Tag>
+ > *
+ > const& el,
+ Translator const&)
 {
     return el.first;
 }

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_s_mem_static.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_s_mem_static.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/node_s_mem_static.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -54,10 +54,10 @@
 template <typename Value, typename Parameters, typename Box, typename Allocators>
 struct node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
 {
- typedef boost::variant<
- static_leaf<Value, Parameters, Box, Allocators, node_s_mem_static_tag>,
- static_internal_node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
- > type;
+ typedef boost::variant<
+ static_leaf<Value, Parameters, Box, Allocators, node_s_mem_static_tag>,
+ static_internal_node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
+ > type;
 };
 
 template <typename Value, typename Parameters, typename Box, typename Allocators>

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/static_visitor.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/static_visitor.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/node/static_visitor.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -51,22 +51,22 @@
 
 template <typename Visitor, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
 inline void apply_visitor(Visitor & v,
- boost::variant<
- static_leaf<Value, Parameters, Box, Allocators, Tag>,
- static_internal_node<Value, Parameters, Box, Allocators, Tag>
- > & n)
+ boost::variant<
+ static_leaf<Value, Parameters, Box, Allocators, Tag>,
+ static_internal_node<Value, Parameters, Box, Allocators, Tag>
+ > & n)
 {
     boost::apply_visitor(v, n);
 }
 
 template <typename Visitor, typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
 inline void apply_visitor(Visitor & v,
- boost::variant<
- static_leaf<Value, Parameters, Box, Allocators, Tag>,
- static_internal_node<Value, Parameters, Box, Allocators, Tag>
- > const& n)
+ boost::variant<
+ static_leaf<Value, Parameters, Box, Allocators, Tag>,
+ static_internal_node<Value, Parameters, Box, Allocators, Tag>
+ > const& n)
 {
- boost::apply_visitor(v, n);
+ boost::apply_visitor(v, n);
 }
 
 }} // namespace detail::rtree

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/quadratic/redistribute_elements.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -44,8 +44,8 @@
                              size_t & seed2)
     {
         const size_t elements_count = parameters.get_max_elements() + 1;
- BOOST_GEOMETRY_INDEX_ASSERT(elements.size() == elements_count, "wrong number of elements");
- BOOST_GEOMETRY_INDEX_ASSERT(2 <= elements_count, "unexpected number of elements");
+ BOOST_GEOMETRY_INDEX_ASSERT(elements.size() == elements_count, "wrong number of elements");
+ BOOST_GEOMETRY_INDEX_ASSERT(2 <= elements_count, "unexpected number of elements");
 
         content_type greatest_free_content = 0;
         seed1 = 0;
@@ -80,7 +80,7 @@
 template <typename Value, typename Options, typename Translator, typename Box, typename Allocators>
 struct redistribute_elements<Value, Options, Translator, Box, Allocators, quadratic_tag>
 {
- typedef typename Options::parameters_type parameters_type;
+ typedef typename Options::parameters_type parameters_type;
 
     typedef typename rtree::node<Value, parameters_type, Box, Allocators, typename Options::node_tag>::type node;
     typedef typename rtree::internal_node<Value, parameters_type, Box, Allocators, typename Options::node_tag>::type internal_node;
@@ -216,12 +216,12 @@
                     content2 = index::content(box2);
                 }
 
- BOOST_GEOMETRY_INDEX_ASSERT(!elements_copy.empty(), "expected more elements");
+ BOOST_GEOMETRY_INDEX_ASSERT(!elements_copy.empty(), "expected more elements");
                 typename elements_type::iterator el_it_base = el_it.base();
                 rtree::copy_from_back(elements_copy, --el_it_base); // MAY THROW, STRONG (copy)
                 elements_copy.pop_back();
 
- BOOST_GEOMETRY_INDEX_ASSERT(0 < remaining, "expected more remaining elements");
+ BOOST_GEOMETRY_INDEX_ASSERT(0 < remaining, "expected more remaining elements");
                 --remaining;
             }
         }

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/choose_next_node.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -36,9 +36,9 @@
     typedef typename rtree::leaf<Value, typename Options::parameters_type, Box, Allocators, typename Options::node_tag>::type leaf;
 
     typedef typename rtree::elements_type<internal_node>::type children_type;
- typedef typename children_type::value_type child_type;
+ typedef typename children_type::value_type child_type;
 
- typedef typename Options::parameters_type parameters_type;
+ typedef typename Options::parameters_type parameters_type;
 
     typedef typename index::default_content_result<Box>::type content_type;
 
@@ -53,13 +53,13 @@
         
         // children are leafs
         if ( node_relative_level <= 1 )
- {
- if ( 0 < parameters.get_overlap_cost_threshold() &&
- parameters.get_overlap_cost_threshold() < children.size() )
- return choose_by_nearly_minimum_overlap_cost(children, indexable, parameters.get_overlap_cost_threshold());
- else
- return choose_by_minimum_overlap_cost(children, indexable);
- }
+ {
+ if ( 0 < parameters.get_overlap_cost_threshold() &&
+ parameters.get_overlap_cost_threshold() < children.size() )
+ return choose_by_nearly_minimum_overlap_cost(children, indexable, parameters.get_overlap_cost_threshold());
+ else
+ return choose_by_minimum_overlap_cost(children, indexable);
+ }
         // children are internal nodes
         else
             return choose_by_minimum_content_cost(children, indexable);
@@ -123,86 +123,86 @@
         return choosen_index;
     }
 
- template <typename Indexable>
- static inline size_t choose_by_nearly_minimum_overlap_cost(children_type const& children,
+ template <typename Indexable>
+ static inline size_t choose_by_nearly_minimum_overlap_cost(children_type const& children,
                                                                Indexable const& indexable,
                                                                size_t overlap_cost_threshold)
- {
- const size_t children_count = children.size();
+ {
+ const size_t children_count = children.size();
+
+ // create container of children sorted by content enlargement needed to include the new value
+ std::vector< boost::tuple<size_t, content_type, content_type> > sorted_children(children_count);
+ for ( size_t i = 0 ; i < children_count ; ++i )
+ {
+ child_type const& ch_i = children[i];
+
+ // expanded child node's box
+ Box box_exp(ch_i.first);
+ geometry::expand(box_exp, indexable);
+
+ // areas difference
+ content_type content = index::content(box_exp);
+ content_type content_diff = content - index::content(ch_i.first);
+
+ 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 are not enough children");
+
+ // for overlap_cost_threshold child nodes find the one with smallest overlap value
+ size_t choosen_index = 0;
+ content_type smallest_overlap_diff = (std::numeric_limits<content_type>::max)();
+
+ // for each node
+ for (size_t i = 0 ; i < overlap_cost_threshold ; ++i )
+ {
+ size_t child_index = boost::get<0>(sorted_children[i]);
+
+ typedef typename children_type::value_type child_type;
+ child_type const& ch_i = children[child_index];
+
+ Box box_exp(ch_i.first);
+ // calculate expanded box of child node ch_i
+ geometry::expand(box_exp, indexable);
 
- // create container of children sorted by content enlargement needed to include the new value
- std::vector< boost::tuple<size_t, content_type, content_type> > sorted_children(children_count);
- for ( size_t i = 0 ; i < children_count ; ++i )
- {
- child_type const& ch_i = children[i];
-
- // expanded child node's box
- Box box_exp(ch_i.first);
- geometry::expand(box_exp, indexable);
-
- // areas difference
- content_type content = index::content(box_exp);
- content_type content_diff = content - index::content(ch_i.first);
-
- 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 are not enough children");
-
- // for overlap_cost_threshold child nodes find the one with smallest overlap value
- size_t choosen_index = 0;
- content_type smallest_overlap_diff = (std::numeric_limits<content_type>::max)();
-
- // for each node
- for (size_t i = 0 ; i < overlap_cost_threshold ; ++i )
- {
- size_t child_index = boost::get<0>(sorted_children[i]);
-
- typedef typename children_type::value_type child_type;
- child_type const& ch_i = children[child_index];
-
- Box box_exp(ch_i.first);
- // calculate expanded box of child node ch_i
- geometry::expand(box_exp, indexable);
-
- content_type overlap = 0;
- content_type overlap_exp = 0;
-
- // calculate overlap
- for ( size_t j = 0 ; j < children_count ; ++j )
- {
- if ( child_index != j )
- {
- child_type const& ch_j = children[j];
-
- overlap += index::intersection_content(ch_i.first, ch_j.first);
- overlap_exp += index::intersection_content(box_exp, ch_j.first);
- }
- }
-
- content_type overlap_diff = overlap_exp - overlap;
-
- // update result
- if ( overlap_diff < smallest_overlap_diff )
- {
- smallest_overlap_diff = overlap_diff;
- choosen_index = child_index;
- }
- }
-
- return choosen_index;
- }
-
- static inline bool content_diff_less(boost::tuple<size_t, content_type, content_type> const& p1, boost::tuple<size_t, content_type, content_type> const& p2)
- {
- return boost::get<1>(p1) < boost::get<1>(p2) ||
- (boost::get<1>(p1) == boost::get<1>(p2) && boost::get<2>(p1) < boost::get<2>(p2));
- }
+ content_type overlap = 0;
+ content_type overlap_exp = 0;
 
- template <typename Indexable>
+ // calculate overlap
+ for ( size_t j = 0 ; j < children_count ; ++j )
+ {
+ if ( child_index != j )
+ {
+ child_type const& ch_j = children[j];
+
+ overlap += index::intersection_content(ch_i.first, ch_j.first);
+ overlap_exp += index::intersection_content(box_exp, ch_j.first);
+ }
+ }
+
+ content_type overlap_diff = overlap_exp - overlap;
+
+ // update result
+ if ( overlap_diff < smallest_overlap_diff )
+ {
+ smallest_overlap_diff = overlap_diff;
+ choosen_index = child_index;
+ }
+ }
+
+ return choosen_index;
+ }
+
+ static inline bool content_diff_less(boost::tuple<size_t, content_type, content_type> const& p1, boost::tuple<size_t, content_type, content_type> const& p2)
+ {
+ return boost::get<1>(p1) < boost::get<1>(p2) ||
+ (boost::get<1>(p1) == boost::get<1>(p2) && boost::get<2>(p1) < boost::get<2>(p2));
+ }
+
+ template <typename Indexable>
     static inline size_t choose_by_minimum_content_cost(children_type const& children, Indexable const& indexable)
     {
         size_t children_count = children.size();

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/insert.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/rstar/insert.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -295,7 +295,7 @@
 
     inline void operator()(leaf &)
     {
- assert(false);
+ BOOST_GEOMETRY_INDEX_ASSERT(false, "this visitor can't be used for a leaf");
     }
 };
 

Modified: sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/extensions/index/rtree/visitors/insert.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -449,7 +449,7 @@
 
     inline void operator()(leaf &)
     {
- assert(false);
+ BOOST_GEOMETRY_INDEX_ASSERT(false, "this visitor can't be used for a leaf");
     }
 };
 

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 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -253,7 +253,7 @@
     template <typename Value, typename Box>
     static void apply(std::vector<Value> & input, Box & qbox, int size = 1)
     {
- assert(0 < size);
+ BOOST_GEOMETRY_INDEX_ASSERT(0 < size, "the value must be greather than 0");
 
         for ( int i = 0 ; i < 12 * size ; i += 3 )
         {
@@ -275,7 +275,7 @@
     template <typename Value, typename Box>
     static void apply(std::vector<Value> & input, Box & qbox, int size = 1)
     {
- assert(0 < size);
+ BOOST_GEOMETRY_INDEX_ASSERT(0 < size, "the value must be greather than 0");
 
         for ( int i = 0 ; i < 12 * size ; i += 3 )
         {

Modified: sandbox-branches/geometry/index/test/rtree/test_rtree_exceptions.hpp
==============================================================================
--- sandbox-branches/geometry/index/test/rtree/test_rtree_exceptions.hpp (original)
+++ sandbox-branches/geometry/index/test/rtree/test_rtree_exceptions.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -73,14 +73,14 @@
 
 template <typename Value, typename Parameters, typename Box, typename Allocators>
 struct dynamic_internal_node<Value, Parameters, Box, Allocators, node_throwing_d_mem_static_tag>
- : public dynamic_node<Value, Parameters, Box, Allocators, node_throwing_d_mem_static_tag>
+ : public dynamic_node<Value, Parameters, Box, Allocators, node_throwing_d_mem_static_tag>
 {
     typedef throwing_pushable_array<
         std::pair<
             Box,
             dynamic_node<Value, Parameters, Box, Allocators, node_throwing_d_mem_static_tag> *
>,
- Parameters::max_elements + 1
+ Parameters::max_elements + 1
> elements_type;
 
     template <typename Dummy>
@@ -94,7 +94,7 @@
 
 template <typename Value, typename Parameters, typename Box, typename Allocators>
 struct dynamic_leaf<Value, Parameters, Box, Allocators, node_throwing_d_mem_static_tag>
- : public dynamic_node<Value, Parameters, Box, Allocators, node_throwing_d_mem_static_tag>
+ : public dynamic_node<Value, Parameters, Box, Allocators, node_throwing_d_mem_static_tag>
 {
     typedef throwing_pushable_array<Value, Parameters::max_elements + 1> elements_type;
 

Modified: sandbox-branches/geometry/index/tests/additional_glut_vis.cpp
==============================================================================
--- sandbox-branches/geometry/index/tests/additional_glut_vis.cpp (original)
+++ sandbox-branches/geometry/index/tests/additional_glut_vis.cpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -1,8 +1,8 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - example
-//
-// Copyright 2011 Adam Wulkiewicz.
+// Boost.Geometry Index
+// Additional tests
+
+// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+
 // Use, modification and distribution is subject to the Boost Software License,
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)

Modified: sandbox-branches/geometry/index/tests/additional_sizes_and_times.cpp
==============================================================================
--- sandbox-branches/geometry/index/tests/additional_sizes_and_times.cpp (original)
+++ sandbox-branches/geometry/index/tests/additional_sizes_and_times.cpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -1,8 +1,8 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - example
-//
-// Copyright 2011 Adam Wulkiewicz.
+// Boost.Geometry Index
+// Additional tests
+
+// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+
 // Use, modification and distribution is subject to the Boost Software License,
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)

Modified: sandbox-branches/geometry/index/tests/additional_speed.cpp
==============================================================================
--- sandbox-branches/geometry/index/tests/additional_speed.cpp (original)
+++ sandbox-branches/geometry/index/tests/additional_speed.cpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -1,3 +1,12 @@
+// Boost.Geometry Index
+// Additional tests
+
+// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
 #include <iostream>
 #include <fstream>
 

Modified: sandbox-branches/geometry/index/tests/main.cpp
==============================================================================
--- sandbox-branches/geometry/index/tests/main.cpp (original)
+++ sandbox-branches/geometry/index/tests/main.cpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -1,8 +1,8 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-//
-// Boost.Index - unit tests
-//
-// Copyright 2011 Adam Wulkiewicz.
+// Boost.Geometry Index
+// Additional tests
+
+// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+
 // Use, modification and distribution is subject to the Boost Software License,
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)

Modified: sandbox-branches/geometry/index/tests/rtree_filters.hpp
==============================================================================
--- sandbox-branches/geometry/index/tests/rtree_filters.hpp (original)
+++ sandbox-branches/geometry/index/tests/rtree_filters.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -1,3 +1,12 @@
+// Boost.Geometry Index
+// Additional tests
+
+// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
 #ifndef TESTS_RTREE_FILTERS_HPP
 #define TESTS_RTREE_FILTERS_HPP
 
@@ -32,7 +41,7 @@
 BOOST_AUTO_TEST_CASE(tests_rtree_query_filter)
 {
 #ifdef TEST_PRINT_INFO
- std::cout << "tests/rtree_filters.hpp\n";
+ std::cout << "tests/rtree_filters.hpp\n";
 #endif
 
     typedef boost::geometry::model::point<float, 2, boost::geometry::cs::cartesian> P;

Modified: sandbox-branches/geometry/index/tests/rtree_function.hpp
==============================================================================
--- sandbox-branches/geometry/index/tests/rtree_function.hpp (original)
+++ sandbox-branches/geometry/index/tests/rtree_function.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -1,3 +1,12 @@
+// Boost.Geometry Index
+// Additional tests
+
+// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
 #ifndef TESTS_RTREE_FUNCTION_HPP
 #define TESTS_RTREE_FUNCTION_HPP
 

Modified: sandbox-branches/geometry/index/tests/t1.cpp
==============================================================================
--- sandbox-branches/geometry/index/tests/t1.cpp (original)
+++ sandbox-branches/geometry/index/tests/t1.cpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -1,3 +1,12 @@
+// Boost.Geometry Index
+// Additional tests
+
+// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
 #include <iostream>
 #include <fstream>
 

Modified: sandbox-branches/geometry/index/tests/t2.cpp
==============================================================================
--- sandbox-branches/geometry/index/tests/t2.cpp (original)
+++ sandbox-branches/geometry/index/tests/t2.cpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -1,3 +1,11 @@
+// Boost.Geometry Index
+// Additional tests
+
+// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
 
 #include <iostream>
 #include <deque>
@@ -63,4 +71,4 @@
   std::cout << "Total objects: " << rTree.size();
   std::cin.get();
   return 0;
-}
\ No newline at end of file
+}

Modified: sandbox-branches/geometry/index/tests/translators.hpp
==============================================================================
--- sandbox-branches/geometry/index/tests/translators.hpp (original)
+++ sandbox-branches/geometry/index/tests/translators.hpp 2012-12-08 18:47:52 EST (Sat, 08 Dec 2012)
@@ -1,3 +1,12 @@
+// Boost.Geometry Index
+// Additional tests
+
+// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
 #ifndef TESTS_TRANSLATORS_HPP
 #define TESTS_TRANSLATORS_HPP
 
@@ -19,17 +28,17 @@
         : i(ii)
     {}
 
- Indexable const& get_box() const
- {
- return i;
- }
-
- bool operator==(tests_translators_val const& v2)
- {
- return boost::geometry::equals(i, v2.i);
- }
+ Indexable const& get_box() const
+ {
+ return i;
+ }
+
+ bool operator==(tests_translators_val const& v2)
+ {
+ return boost::geometry::equals(i, v2.i);
+ }
 
- Indexable i;
+ Indexable i;
 };
 
 BOOST_AUTO_TEST_CASE(tests_translators)
@@ -43,7 +52,7 @@
     namespace bgi = bg::index;
     namespace bgit = bgi::translator;
 
- typedef bgm::point<float, 2, bg::cs::cartesian> P;
+ typedef bgm::point<float, 2, bg::cs::cartesian> P;
     typedef bgm::box<P> B;
 
     bgit::def< P > p;
@@ -81,8 +90,8 @@
     BOOST_CHECK( bg::equals(tmp_p, scpip(tmp_scpip)) );
     BOOST_CHECK( bg::equals(tmp_p, scppi(tmp_scppi)) );
     
- //bgit::def<int> d; // error
- //bgit::def< bgm::segment<P> > d; // error
+ //bgit::def<int> d; // error
+ //bgit::def< bgm::segment<P> > d; // error
 
     B tmp_b(P(2, 3), P(4, 5));
     std::pair<bgm::polygon<P>, B> tmp_ppb =


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