mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-18 02:02:08 +00:00
Coding style improved (issues detected by Boost Inspect tool).
[SVN r81802]
This commit is contained in:
@@ -54,9 +54,9 @@ struct find_greatest_normalized_separation
|
||||
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 @@ struct pick_seeds
|
||||
|
||||
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 @@ struct redistribute_elements<Value, Options, Translator, Box, Allocators, linear
|
||||
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 @@ struct redistribute_elements<Value, Options, Translator, Box, Allocators, linear
|
||||
}
|
||||
}
|
||||
|
||||
assert(0 < remaining);
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(0 < remaining, "unexpected value");
|
||||
--remaining;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,23 +68,23 @@ struct dynamic_visitor<Value, Parameters, Box, Allocators, Tag, false>
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ template <typename Value, typename Translator>
|
||||
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 @@ element_indexable(
|
||||
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
|
||||
|
||||
@@ -20,14 +20,14 @@ namespace detail { namespace rtree {
|
||||
|
||||
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 @@ struct dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_stat
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -59,10 +59,10 @@ struct static_leaf
|
||||
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 @@ struct element_indexable_type<
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -54,10 +54,10 @@ struct static_leaf<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
|
||||
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>
|
||||
|
||||
@@ -51,22 +51,22 @@ inline V * get(
|
||||
|
||||
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
|
||||
|
||||
@@ -44,8 +44,8 @@ struct pick_seeds
|
||||
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 @@ struct pick_seeds
|
||||
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 @@ struct redistribute_elements<Value, Options, Translator, Box, Allocators, quadra
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,9 @@ class choose_next_node<Value, Options, Box, Allocators, choose_by_overlap_diff_t
|
||||
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 @@ public:
|
||||
|
||||
// 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 @@ private:
|
||||
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];
|
||||
// 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);
|
||||
// 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);
|
||||
// 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);
|
||||
}
|
||||
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);
|
||||
// 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");
|
||||
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 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]);
|
||||
// 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];
|
||||
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);
|
||||
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;
|
||||
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];
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
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;
|
||||
content_type overlap_diff = overlap_exp - overlap;
|
||||
|
||||
// update result
|
||||
if ( overlap_diff < smallest_overlap_diff )
|
||||
{
|
||||
smallest_overlap_diff = overlap_diff;
|
||||
choosen_index = child_index;
|
||||
}
|
||||
}
|
||||
// update result
|
||||
if ( overlap_diff < smallest_overlap_diff )
|
||||
{
|
||||
smallest_overlap_diff = overlap_diff;
|
||||
choosen_index = child_index;
|
||||
}
|
||||
}
|
||||
|
||||
return choosen_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));
|
||||
}
|
||||
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>
|
||||
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();
|
||||
|
||||
@@ -295,7 +295,7 @@ struct level_insert
|
||||
|
||||
inline void operator()(leaf &)
|
||||
{
|
||||
assert(false);
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(false, "this visitor can't be used for a leaf");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -449,7 +449,7 @@ public:
|
||||
|
||||
inline void operator()(leaf &)
|
||||
{
|
||||
assert(false);
|
||||
BOOST_GEOMETRY_INDEX_ASSERT(false, "this visitor can't be used for a leaf");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ struct generate_input<2>
|
||||
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 @@ struct generate_input<3>
|
||||
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 )
|
||||
{
|
||||
|
||||
@@ -73,14 +73,14 @@ namespace detail { namespace rtree {
|
||||
|
||||
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 @@ struct dynamic_internal_node<Value, Parameters, Box, Allocators, node_throwing_d
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
10
tests/t2.cpp
10
tests/t2.cpp
@@ -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 @@ int main()
|
||||
std::cout << "Total objects: " << rTree.size();
|
||||
std::cin.get();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 @@ struct tests_translators_val
|
||||
: i(ii)
|
||||
{}
|
||||
|
||||
Indexable const& get_box() const
|
||||
{
|
||||
return i;
|
||||
}
|
||||
Indexable const& get_box() const
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
||||
bool operator==(tests_translators_val const& v2)
|
||||
{
|
||||
return boost::geometry::equals(i, v2.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 @@ BOOST_AUTO_TEST_CASE(tests_translators)
|
||||
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_AUTO_TEST_CASE(tests_translators)
|
||||
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 =
|
||||
|
||||
Reference in New Issue
Block a user