boost::container::vector used in dynamic nodes. detail::static_vector renamed to detail::varray. Added Alloc parameter to varray. rtree::envelope() renamed to rtree::bounds(). Tests moddified. Docs tweaked.

[SVN r82766]
This commit is contained in:
Adam Wulkiewicz 2013-02-06 20:56:29 +00:00
parent ce4d807159
commit a90b56de26
26 changed files with 699 additions and 1020 deletions

View File

@ -70,7 +70,7 @@ The Translator translates from Value to Indexable each time r-tree requires it.
[[[#classboost_1_1geometry_1_1index_1_1rtree_1a9d35bc38fa697c6f600548fb5b38807d] `allocator_type`][The type of allocator used by the container. ]]
[[[#classboost_1_1geometry_1_1index_1_1rtree_1a5c1a657074c527ed65f858c1ab6b36e6] `size_type`][Unsigned integral type used by the container. ]]
[[[#classboost_1_1geometry_1_1index_1_1rtree_1ac011da09678f034a7fab487a9b973bfc] `indexable_type`][The Indexable type to which Value is translated. ]]
[[[#classboost_1_1geometry_1_1index_1_1rtree_1a2803990c71c40e6770744d29e5bbd093] `envelope_type`][The Box type used by the R-tree. ]]
[[[#classboost_1_1geometry_1_1index_1_1rtree_1a653555282525601512c3b1bed1e9590f] `bounds_type`][The Box type used by the R-tree. ]]
]
[heading Constructor(s) and destructor]
@ -89,31 +89,31 @@ The Translator translates from Value to Indexable each time r-tree requires it.
[heading Member(s)]
[table
[[Modifier][Function][Description]]
[[][[link classboost_1_1geometry_1_1index_1_1rtree_1ab823a214501cb0f9fd00ba12a1ade179 `operator=(const rtree &)`]][The assignment operator. ]]
[[][[link classboost_1_1geometry_1_1index_1_1rtree_1a44bd4edee49db92c18b6bbbba77b42be `operator=(rtree &&)`]][The moving assignment. ]]
[[][[link classboost_1_1geometry_1_1index_1_1rtree_1aad0285d25f96341a8dd6cc22feb3bd73 `swap(rtree &)`]][Swaps contents of two rtrees. ]]
[[][[link classboost_1_1geometry_1_1index_1_1rtree_1af6d5bd81e46cb4ff89277c753133664c `insert(value_type const &)`]][Insert a value to the index. ]]
[[][[link classboost_1_1geometry_1_1index_1_1rtree_1a5263a3faac7b4f0090d4ad1d44cc540d `insert(Iterator, Iterator)`]][Insert a range of values to the index. ]]
[[][[link classboost_1_1geometry_1_1index_1_1rtree_1abb624abd9268b41e815d40342b2634c2 `insert(Range const &)`]][Insert a range of values to the index. ]]
[[][[link classboost_1_1geometry_1_1index_1_1rtree_1af6ca6909354a997f89411ef40ea5688a `remove(value_type const &)`]][Remove a value from the container. ]]
[[][[link classboost_1_1geometry_1_1index_1_1rtree_1a6e9123114697d65b16ebc49cd5371fbd `remove(Iterator, Iterator)`]][Remove a range of values from the container. ]]
[[][[link classboost_1_1geometry_1_1index_1_1rtree_1a5a57bb93b0b2d7ea1c659e925f918e9c `remove(Range const &)`]][Remove a range of values from the container. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a25ce2ead0e8a2d270105f4958237e949 `query(Predicates const &, OutIter)`]][Finds values meeting passed predicates e.g. nearest to some Point and/or intersecting some Box. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1abd965047110c9f8ef6ff097e97487312 `query(Predicates const &, value_type &)`]][Finds value meeting passed predicates e.g. nearest to some Point and intersecting some Box. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a930bf17d595a91d8ae924383a0387920 `spatial_query(Predicates const &, OutIter)`]][Finds values meeting spatial predicates, e.g. intersecting some Box. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a788295b315bd0ddeb93b1cc050fdf909 `nearest_query(DistancesPredicates const &, value_type &)`]][Finds one value meeting distances predicates, e.g. nearest to some Point. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a6552331dca4d67647ef2a03bd0fbedcc `nearest_query(DistancesPredicates const &, Predicates const &, value_type &)`]][Finds one value meeting distances predicates and spatial predicates, e.g. nearest to some Point and intersecting some Box. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a3101652211c9f2d6ed8626dae6ff5f9d `nearest_query(DistancesPredicates const &, size_type, OutIter)`]][Finds k values meeting distances predicates, e.g. k nearest values to some Point. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a31c23b87b01f12282ef0df6404ab7301 `nearest_query(DistancesPredicates const &, size_type, Predicates const &, OutIter)`]][Finds k values meeting distances predicates and spatial predicates, e.g. k nearest values to some Point and intersecting some Box. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a89561a834563f2ed6fc782bad16143fd `size()`]][Returns the number of stored values. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1ae889567443b0ba0dbdb975564c55804c `empty()`]][Query if the container is empty. ]]
[[][[link classboost_1_1geometry_1_1index_1_1rtree_1ae6027e42d28a4bf93e74b055c79e6b09 `clear()`]][Removes all values stored in the container. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a131c273b6fc7e1c6d62cc5ebd015e77e `envelope()`]][Returns the box able to contain all values stored in the container. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a17fce1fac81f6460d2c3a5744f4963ee `count(ValueOrIndexable const &)`]][Count Values or Indexables stored in the container. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a18910715f67608ff010556ac41f51606 `parameters()`]][Returns parameters. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1afc7e9a4bd53a58552c17c1e7cb997258 `translator()`]][Returns the translator object. ]]
[[ `const`][[link classboost_1_1geometry_1_1index_1_1rtree_1a1eeb303253f4cabe3a89a82ed41247ff `get_allocator()`]][Returns allocator used by the rtree. ]]
[[Function][Description]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1ab823a214501cb0f9fd00ba12a1ade179 `operator=(const rtree &)`]][The assignment operator. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a44bd4edee49db92c18b6bbbba77b42be `operator=(rtree &&)`]][The moving assignment. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1aad0285d25f96341a8dd6cc22feb3bd73 `swap(rtree &)`]][Swaps contents of two rtrees. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1af6d5bd81e46cb4ff89277c753133664c `insert(value_type const &)`]][Insert a value to the index. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a5263a3faac7b4f0090d4ad1d44cc540d `insert(Iterator, Iterator)`]][Insert a range of values to the index. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1abb624abd9268b41e815d40342b2634c2 `insert(Range const &)`]][Insert a range of values to the index. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1af6ca6909354a997f89411ef40ea5688a `remove(value_type const &)`]][Remove a value from the container. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a6e9123114697d65b16ebc49cd5371fbd `remove(Iterator, Iterator)`]][Remove a range of values from the container. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a5a57bb93b0b2d7ea1c659e925f918e9c `remove(Range const &)`]][Remove a range of values from the container. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a25ce2ead0e8a2d270105f4958237e949 `query(Predicates const &, OutIter)`]][Finds values meeting passed predicates e.g. nearest to some Point and/or intersecting some Box. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1abd965047110c9f8ef6ff097e97487312 `query(Predicates const &, value_type &)`]][Finds value meeting passed predicates e.g. nearest to some Point and intersecting some Box. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a930bf17d595a91d8ae924383a0387920 `spatial_query(Predicates const &, OutIter)`]][Finds values meeting spatial predicates, e.g. intersecting some Box. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a788295b315bd0ddeb93b1cc050fdf909 `nearest_query(DistancesPredicates const &, value_type &)`]][Finds one value meeting distances predicates, e.g. nearest to some Point. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a6552331dca4d67647ef2a03bd0fbedcc `nearest_query(DistancesPredicates const &, Predicates const &, value_type &)`]][Finds one value meeting distances predicates and spatial predicates, e.g. nearest to some Point and intersecting some Box. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a3101652211c9f2d6ed8626dae6ff5f9d `nearest_query(DistancesPredicates const &, size_type, OutIter)`]][Finds k values meeting distances predicates, e.g. k nearest values to some Point. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a31c23b87b01f12282ef0df6404ab7301 `nearest_query(DistancesPredicates const &, size_type, Predicates const &, OutIter)`]][Finds k values meeting distances predicates and spatial predicates, e.g. k nearest values to some Point and intersecting some Box. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a89561a834563f2ed6fc782bad16143fd `size()`]][Returns the number of stored values. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1ae889567443b0ba0dbdb975564c55804c `empty()`]][Query if the container is empty. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1ae6027e42d28a4bf93e74b055c79e6b09 `clear()`]][Removes all values stored in the container. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1ace84997927e26d7cdb5aa67f14cdf6cc `bounds()`]][Returns the box able to contain all values stored in the container. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a17fce1fac81f6460d2c3a5744f4963ee `count(ValueOrIndexable const &)`]][Count Values or Indexables stored in the container. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a18910715f67608ff010556ac41f51606 `parameters()`]][Returns parameters. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1afc7e9a4bd53a58552c17c1e7cb997258 `translator()`]][Returns the translator object. ]]
[[[link classboost_1_1geometry_1_1index_1_1rtree_1a1eeb303253f4cabe3a89a82ed41247ff `get_allocator()`]][Returns allocator used by the rtree. ]]
]
[#classboost_1_1geometry_1_1index_1_1rtree_1afa64d1b825b06d196b1164aec27c2d7b]
@ -126,8 +126,7 @@ The constructor.
`rtree``(`[^[link classboost_1_1geometry_1_1index_1_1rtree_1af85d4e399a807b3e4e46d38a0b4ffc5a parameters_type]] `parameters` = [^[link classboost_1_1geometry_1_1index_1_1rtree_1af85d4e399a807b3e4e46d38a0b4ffc5a parameters_type]]`()``,` [^[link classboost_1_1geometry_1_1index_1_1rtree_1adbc30a1fa986e2e856e0662111ac2d91 translator_type]]` const &` `translator` = [^[link classboost_1_1geometry_1_1index_1_1rtree_1adbc30a1fa986e2e856e0662111ac2d91 translator_type]]`()``)`
]
[heading Modifier(s)]
``explicit ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[[^[link classboost_1_1geometry_1_1index_1_1rtree_1af85d4e399a807b3e4e46d38a0b4ffc5a parameters_type]]][ `parameters` ][The parameters object. ]]
@ -210,8 +209,7 @@ The constructor.
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a9d35bc38fa697c6f600548fb5b38807d allocator_type]] `allocator` = [^[link classboost_1_1geometry_1_1index_1_1rtree_1a9d35bc38fa697c6f600548fb5b38807d allocator_type]]`()``)`
]
[heading Modifier(s)]
``explicit ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[`Range const &`][ `rng` ][The range of Values. ]]
@ -659,8 +657,7 @@ A set of predicates may be generated by:
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a5c1a657074c527ed65f858c1ab6b36e6 size_type]] `query``(``Predicates const &` `predicates``,` `OutIter` `out_it``)`
]
[heading Modifier(s)]
``const ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[`Predicates const &`][ `predicates` ][Predicates. ]]
@ -738,8 +735,7 @@ A set of predicates may be generated by:
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a5c1a657074c527ed65f858c1ab6b36e6 size_type]] `query``(``Predicates const &` `predicates``,` [^[link classboost_1_1geometry_1_1index_1_1rtree_1a9979db9ef37591985256cb8ad31862bb value_type]]` &` `value``)`
]
[heading Modifier(s)]
``const ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[`Predicates const &`][ `predicates` ][Predicates. ]]
@ -790,8 +786,7 @@ Those predicates may be passed together in [^`std::pair`] or [^`boost::tuple`].[
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a5c1a657074c527ed65f858c1ab6b36e6 size_type]] `spatial_query``(``Predicates const &` `pred``,` `OutIter` `out_it``)`
]
[heading Modifier(s)]
``const ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[`Predicates const &`][ `pred` ][The spatial predicates or a Geometry. ]]
@ -843,8 +838,7 @@ MinRelation and MaxRelation describes bounds and can be generated by following f
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a5c1a657074c527ed65f858c1ab6b36e6 size_type]] `nearest_query``(``DistancesPredicates const &` `dpred``,` [^[link classboost_1_1geometry_1_1index_1_1rtree_1a9979db9ef37591985256cb8ad31862bb value_type]]` &` `v``)`
]
[heading Modifier(s)]
``const ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[`DistancesPredicates const &`][ `dpred` ][The distances predicates or a Point.]]
@ -910,8 +904,7 @@ Those predicates may be passed together in [^`std::pair`] or [^`boost::tuple`].[
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a9979db9ef37591985256cb8ad31862bb value_type]]` &` `v``)`
]
[heading Modifier(s)]
``const ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[`DistancesPredicates const &`][ `dpred` ][The distances predicates or a Point. ]]
@ -961,8 +954,7 @@ MinRelation and MaxRelation describes bounds and can be generated by following f
`OutIter` `out_it``)`
]
[heading Modifier(s)]
``const ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[`DistancesPredicates const &`][ `dpred` ][The distances predicates or a Point. ]]
@ -1032,8 +1024,7 @@ Those predicates may be passed together in [^`std::pair`] or [^`boost::tuple`].[
`OutIter` `out_it``)`
]
[heading Modifier(s)]
``const ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[`DistancesPredicates const &`][ `dpred` ][The distances predicates or a Point ]]
@ -1058,8 +1049,7 @@ Returns the number of stored values.
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a5c1a657074c527ed65f858c1ab6b36e6 size_type]] `size``()`
]
[heading Modifier(s)]
``const ``[heading Returns]
[heading Returns]
The number of stored values.
[heading Throws]
Nothing.
@ -1076,8 +1066,7 @@ Query if the container is empty.
`bool` `empty``()`
]
[heading Modifier(s)]
``const ``[heading Returns]
[heading Returns]
true if the container is empty.
[heading Throws]
Nothing.
@ -1099,19 +1088,18 @@ Nothing.
[endsect]
[#classboost_1_1geometry_1_1index_1_1rtree_1a131c273b6fc7e1c6d62cc5ebd015e77e]
[section envelope()]
[#classboost_1_1geometry_1_1index_1_1rtree_1ace84997927e26d7cdb5aa67f14cdf6cc]
[section bounds()]
Returns the box able to contain all values stored in the container.
[heading Description]
Returns the box able to contain all values stored in the container. If the container is empty the result of [^`geometry::assign_inverse()`] is returned.[heading Synopsis]
[pre
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a2803990c71c40e6770744d29e5bbd093 envelope_type]]` const &` `envelope``()`
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a653555282525601512c3b1bed1e9590f bounds_type]]` const &` `bounds``()`
]
[heading Modifier(s)]
``const ``[heading Returns]
[heading Returns]
The box able to contain all values stored in the container or an invalid box if there are no values in the container.
[heading Throws]
Nothing.
@ -1129,8 +1117,7 @@ For indexable_type it returns the number of values which indexables equals the p
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a5c1a657074c527ed65f858c1ab6b36e6 size_type]] `count``(``ValueOrIndexable const &` `vori``)`
]
[heading Modifier(s)]
``const ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[`ValueOrIndexable const &`][ `vori` ][The value or indexable which will be counted.]]
@ -1152,8 +1139,7 @@ Returns parameters.
[^[link classboost_1_1geometry_1_1index_1_1rtree_1af85d4e399a807b3e4e46d38a0b4ffc5a parameters_type]]` const &` `parameters``()`
]
[heading Modifier(s)]
``const ``[heading Returns]
[heading Returns]
The parameters object.
[heading Throws]
Nothing.
@ -1170,8 +1156,7 @@ Returns the translator object.
[^[link classboost_1_1geometry_1_1index_1_1rtree_1adbc30a1fa986e2e856e0662111ac2d91 translator_type]]` const &` `translator``()`
]
[heading Modifier(s)]
``const ``[heading Returns]
[heading Returns]
The translator object.
[heading Throws]
Nothing.
@ -1188,8 +1173,7 @@ Returns allocator used by the rtree.
[^[link classboost_1_1geometry_1_1index_1_1rtree_1a9d35bc38fa697c6f600548fb5b38807d allocator_type]] `get_allocator``()`
]
[heading Modifier(s)]
``const ``[heading Returns]
[heading Returns]
The allocator.
[heading Throws]
If allocator copy constructor throws.

View File

@ -20,7 +20,7 @@
[[[link group__rtree__functions_1ga0c65d7b29b1edf72f1d236ccf211f63c `clear(rtree<...> &)`]][Remove all values from the index. ]]
[[[link group__rtree__functions_1gaec0b88a9d8b408753e3069134f1598c7 `size(rtree<...> const &)`]][Get the number of values stored in the index. ]]
[[[link group__rtree__functions_1ga459e3d404fec7cbd66794714cbdd129e `empty(rtree<...> const &)`]][Query if there are no values stored in the index. ]]
[[[link group__rtree__functions_1ga73a9002187db81c57c71f9ec204d57e4 `envelope(rtree<...> const &)`]][Get the box containing all stored values or an invalid box if the index has no values. ]]
[[[link group__rtree__functions_1gae10fbc3d536235b89aa3cb3641768bca `bounds(rtree<...> const &)`]][Get the box containing all stored values or an invalid box if the index has no values. ]]
]
[#group__rtree__functions_1gac0ac9ed0e01f7494a5a3059e75d3c5cc]
@ -565,18 +565,18 @@ It calls [^[link classboost_1_1geometry_1_1index_1_1rtree_1ae889567443b0ba0dbdb9
true if there are no values in the index.
[endsect]
[#group__rtree__functions_1ga73a9002187db81c57c71f9ec204d57e4]
[section envelope(rtree<...> const &)]
[#group__rtree__functions_1gae10fbc3d536235b89aa3cb3641768bca]
[section bounds(rtree<...> const &)]
Get the box containing all stored values or an invalid box if the index has no values.
[heading Description]
It calls [^[link classboost_1_1geometry_1_1index_1_1rtree_1a131c273b6fc7e1c6d62cc5ebd015e77e rtree::envelope()]].[heading Synopsis]
It calls [^`rtree::envelope()`].[heading Synopsis]
[pre
`template<``typename Value``,`
`typename Options``,`
`typename Translator``,`
`typename Allocator``>`
`rtree<Value, Options, Translator, Allocator>::box_type const& boost::geometry::index::envelope``(``rtree< Value, Options, Translator, Allocator > const &` `tree``)`
`rtree<Value, Options, Translator, Allocator>::bounds_type const& boost::geometry::index::bounds``(``rtree< Value, Options, Translator, Allocator > const &` `tree``)`
]
[heading Parameter(s)]

View File

@ -43,8 +43,7 @@ The constructor.
`index``(``Container const &` `c``)`
]
[heading Modifier(s)]
``explicit ``[heading Parameter(s)]
[heading Parameter(s)]
[table
[[Type][Name][Description]]
[[`Container const &`][ `c` ][The container which stores indexed values. ]]

View File

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Introduction</title>
<link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Geometry Index">
<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Geometry Index">
<link rel="prev" href="../index.html" title="Chapter&#160;1.&#160;Geometry Index">

View File

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>R-tree</title>
<link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../index.html" title="Chapter&#160;1.&#160;Geometry Index">
<link rel="up" href="../index.html" title="Chapter&#160;1.&#160;Geometry Index">
<link rel="prev" href="introduction.html" title="Introduction">
@ -36,14 +36,14 @@
parameters</a></span></dt>
<dt><span class="section"><a href="r_tree/creation_and_modification.html#geometry_index.r_tree.creation_and_modification.values__indexables_and_default_translator">Values,
Indexables and default Translator</a></span></dt>
<dt><span class="section"><a href="r_tree/creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_splitting_algorithms__compile_time_">Inserting
and splitting algorithms (compile-time)</a></span></dt>
<dt><span class="section"><a href="r_tree/creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_splitting_algorithms__run_time_">Inserting
and splitting algorithms (run-time)</a></span></dt>
<dt><span class="section"><a href="r_tree/creation_and_modification.html#geometry_index.r_tree.creation_and_modification.balancing_algorithms__compile_time_">Balancing
algorithms (compile-time)</a></span></dt>
<dt><span class="section"><a href="r_tree/creation_and_modification.html#geometry_index.r_tree.creation_and_modification.balancing_algorithms__run_time_">Balancing
algorithms (run-time)</a></span></dt>
<dt><span class="section"><a href="r_tree/creation_and_modification.html#geometry_index.r_tree.creation_and_modification.copying__moving_and_swapping">Copying,
moving and swapping</a></span></dt>
<dt><span class="section"><a href="r_tree/creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_removing_of_values">Inserting
and removing of Values</a></span></dt>
<dt><span class="section"><a href="r_tree/creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_removing_values">Inserting
and removing Values</a></span></dt>
<dt><span class="section"><a href="r_tree/creation_and_modification.html#geometry_index.r_tree.creation_and_modification.additional_interface">Additional
interface</a></span></dt>
<dt><span class="section"><a href="r_tree/creation_and_modification.html#geometry_index.r_tree.creation_and_modification.insert_iterator">Insert

View File

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Creation and modification</title>
<link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Geometry Index">
<link rel="up" href="../r_tree.html" title="R-tree">
<link rel="prev" href="rtree_quickstart.html" title="Quick Start">
@ -32,14 +32,14 @@
parameters</a></span></dt>
<dt><span class="section"><a href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.values__indexables_and_default_translator">Values,
Indexables and default Translator</a></span></dt>
<dt><span class="section"><a href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_splitting_algorithms__compile_time_">Inserting
and splitting algorithms (compile-time)</a></span></dt>
<dt><span class="section"><a href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_splitting_algorithms__run_time_">Inserting
and splitting algorithms (run-time)</a></span></dt>
<dt><span class="section"><a href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.balancing_algorithms__compile_time_">Balancing
algorithms (compile-time)</a></span></dt>
<dt><span class="section"><a href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.balancing_algorithms__run_time_">Balancing
algorithms (run-time)</a></span></dt>
<dt><span class="section"><a href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.copying__moving_and_swapping">Copying,
moving and swapping</a></span></dt>
<dt><span class="section"><a href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_removing_of_values">Inserting
and removing of Values</a></span></dt>
<dt><span class="section"><a href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_removing_values">Inserting
and removing Values</a></span></dt>
<dt><span class="section"><a href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.additional_interface">Additional
interface</a></span></dt>
<dt><span class="section"><a href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.insert_iterator">Insert
@ -55,7 +55,7 @@
</p>
<pre class="programlisting"><span class="identifier">rtree</span><span class="special">&lt;</span><span class="identifier">Value</span><span class="special">,</span> <span class="identifier">Parameters</span><span class="special">,</span> <span class="identifier">Translator</span> <span class="special">=</span> <span class="identifier">translator</span><span class="special">::</span><span class="identifier">def</span><span class="special">&lt;</span><span class="identifier">Value</span><span class="special">&gt;,</span> <span class="identifier">Allocator</span><span class="special">&gt;</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span><span class="identifier">Value</span><span class="special">&gt;</span> <span class="special">&gt;</span>
</pre>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
<code class="computeroutput">Value</code> - type of object which will be stored in the container,
</li>
@ -90,7 +90,7 @@
be handled by the default <code class="computeroutput">Translator</code> - <code class="computeroutput"><span class="identifier">index</span><span class="special">::</span><span class="identifier">translator</span><span class="special">::</span><span class="identifier">def</span><span class="special">&lt;</span>Value<span class="special">&gt;</span></code>
are defined as follows:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
<code class="computeroutput">Indexable <span class="special">=</span> <a href="http://www.boost.org/libs/geometry/doc/html/geometry/reference/concepts/concept_point.html" target="_top">Point</a>
<span class="special">|</span> <a href="http://www.boost.org/libs/geometry/doc/html/geometry/reference/concepts/concept_box.html" target="_top">Box</a></code>
@ -116,7 +116,7 @@
A <code class="computeroutput">Translator</code> is a type which knows how to handle <code class="computeroutput">Value</code>s.
It has two purposes:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
it translates <code class="computeroutput">Value</code> to a more suitable <code class="computeroutput">Indexable</code>
type which is needed by most of operations,
@ -134,7 +134,7 @@
<p>
If comparison of two <code class="computeroutput">Value</code>s is required, the default translator:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
for <code class="computeroutput"><a href="http://www.boost.org/libs/geometry/doc/html/geometry/reference/concepts/concept_point.html" target="_top">Point</a></code>
and <code class="computeroutput"><a href="http://www.boost.org/libs/geometry/doc/html/geometry/reference/concepts/concept_box.html" target="_top">Box</a></code>
@ -156,38 +156,38 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="geometry_index.r_tree.creation_and_modification.inserting_and_splitting_algorithms__compile_time_"></a><a class="link" href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_splitting_algorithms__compile_time_" title="Inserting and splitting algorithms (compile-time)">Inserting
and splitting algorithms (compile-time)</a>
<a name="geometry_index.r_tree.creation_and_modification.balancing_algorithms__compile_time_"></a><a class="link" href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.balancing_algorithms__compile_time_" title="Balancing algorithms (compile-time)">Balancing
algorithms (compile-time)</a>
</h4></div></div></div>
<p>
<code class="computeroutput">Value</code>s may be inserted to the R-tree in many various ways.
Final internal structure of the R-tree depends on algorithms used in the
insertion process and parameters. The most important is nodes' splitting
insertion process and parameters. The most important is nodes' balancing
algorithm. Currently, three well-known types of R-trees may be created.
</p>
<p>
Linear - classic R-tree using splitting algorithm of linear complexity
Linear - classic R-tree using balancing algorithm of linear complexity
</p>
<pre class="programlisting"><span class="identifier">index</span><span class="special">::</span><span class="identifier">rtree</span><span class="special">&lt;</span> Value<span class="special">,</span> <span class="identifier">index</span><span class="special">::</span><span class="identifier">linear</span><span class="special">&lt;</span><span class="number">32</span><span class="special">,</span> <span class="number">8</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">rt</span><span class="special">;</span>
</pre>
<p>
Quadratic - classic R-tree using splitting algorithm of quadratic complexity
Quadratic - classic R-tree using balancing algorithm of quadratic complexity
</p>
<pre class="programlisting"><span class="identifier">index</span><span class="special">::</span><span class="identifier">rtree</span><span class="special">&lt;</span> Value<span class="special">,</span> <span class="identifier">index</span><span class="special">::</span><span class="identifier">quadratic</span><span class="special">&lt;</span><span class="number">32</span><span class="special">,</span> <span class="number">8</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">rt</span><span class="special">;</span>
</pre>
<p>
R*-tree - splitting algorithm minimizing nodes' overlap with forced reinsertions
R*-tree - balancing algorithm minimizing nodes' overlap with forced reinsertions
</p>
<pre class="programlisting"><span class="identifier">index</span><span class="special">::</span><span class="identifier">rtree</span><span class="special">&lt;</span> Value<span class="special">,</span> <span class="identifier">index</span><span class="special">::</span><span class="identifier">rstar</span><span class="special">&lt;</span><span class="number">32</span><span class="special">,</span> <span class="number">8</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">rt</span><span class="special">;</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="geometry_index.r_tree.creation_and_modification.inserting_and_splitting_algorithms__run_time_"></a><a class="link" href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_splitting_algorithms__run_time_" title="Inserting and splitting algorithms (run-time)">Inserting
and splitting algorithms (run-time)</a>
<a name="geometry_index.r_tree.creation_and_modification.balancing_algorithms__run_time_"></a><a class="link" href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.balancing_algorithms__run_time_" title="Balancing algorithms (run-time)">Balancing
algorithms (run-time)</a>
</h4></div></div></div>
<p>
Splitting algorithm parameters may be passed to the R-tree in run time.
Balancing algorithm parameters may be passed to the R-tree in run time.
To use run-time versions of the R-tree one may pass parameters defined
in index::runtime namespace.
</p>
@ -235,11 +235,11 @@
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="geometry_index.r_tree.creation_and_modification.inserting_and_removing_of_values"></a><a class="link" href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_removing_of_values" title="Inserting and removing of Values">Inserting
and removing of Values</a>
<a name="geometry_index.r_tree.creation_and_modification.inserting_and_removing_values"></a><a class="link" href="creation_and_modification.html#geometry_index.r_tree.creation_and_modification.inserting_and_removing_values" title="Inserting and removing Values">Inserting
and removing Values</a>
</h4></div></div></div>
<p>
The following code creates an R-tree using quadratic algorithm.
The following code creates an R-tree using quadratic balancing algorithm.
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Box</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;</span> Value<span class="special">;</span>

View File

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Introduction</title>
<link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Geometry Index">
<link rel="up" href="../r_tree.html" title="R-tree">
<link rel="prev" href="../r_tree.html" title="R-tree">
@ -28,10 +28,10 @@
</h3></div></div></div>
<p>
R-tree is a tree data structure used for spatial searching. It was proposed
by Antonin Guttman in 1984 <a href="#ftn.geometry_index.r_tree.introduction.f0" class="footnote"><sup class="footnote"><a name="geometry_index.r_tree.introduction.f0"></a>[1]</sup></a> as an expansion of B-tree for multi-dimensional data. It may
by Antonin Guttman in 1984 <sup>[<a name="geometry_index.r_tree.introduction.f0" href="#ftn.geometry_index.r_tree.introduction.f0" class="footnote">1</a>]</sup> as an expansion of B-tree for multi-dimensional data. It may
be used to store points or volumetric data in order to perform a spatial
query later. This query may return objects that are inside some area or are
close to some point in space <a href="#ftn.geometry_index.r_tree.introduction.f1" class="footnote"><sup class="footnote"><a name="geometry_index.r_tree.introduction.f1"></a>[2]</sup></a>.
close to some point in space <sup>[<a name="geometry_index.r_tree.introduction.f1" href="#ftn.geometry_index.r_tree.introduction.f1" class="footnote">2</a>]</sup>.
</p>
<p>
The R-tree structure is presented on the image below. Each R-tree's node
@ -51,7 +51,7 @@
</p>
<p>
The R-tree is a self-balanced data structure. The key part of balancing algorithm
is node splitting algorithm <a href="#ftn.geometry_index.r_tree.introduction.f2" class="footnote"><sup class="footnote"><a name="geometry_index.r_tree.introduction.f2"></a>[3]</sup></a> <a href="#ftn.geometry_index.r_tree.introduction.f3" class="footnote"><sup class="footnote"><a name="geometry_index.r_tree.introduction.f3"></a>[4]</sup></a>. Each algorithm produces different splits so the internal structure
is node splitting algorithm <sup>[<a name="geometry_index.r_tree.introduction.f2" href="#ftn.geometry_index.r_tree.introduction.f2" class="footnote">3</a>]</sup> <sup>[<a name="geometry_index.r_tree.introduction.f3" href="#ftn.geometry_index.r_tree.introduction.f3" class="footnote">4</a>]</sup>. Each algorithm produces different splits so the internal structure
of a tree may be different for each one of them. In general more complex
algorithms analyses elements better and produces less overlapping nodes.
In the searching process less nodes must be traversed in order to find desired
@ -179,13 +179,13 @@
</table></div>
<h5>
<a name="geometry_index.r_tree.introduction.h0"></a>
<span class="phrase"><a name="geometry_index.r_tree.introduction.implementation_details"></a></span><a class="link" href="introduction.html#geometry_index.r_tree.introduction.implementation_details">Implementation
<span><a name="geometry_index.r_tree.introduction.implementation_details"></a></span><a class="link" href="introduction.html#geometry_index.r_tree.introduction.implementation_details">Implementation
details</a>
</h5>
<p>
Key features of this implementation of the R-tree are:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
capable to store arbitrary Value type,
</li>
@ -207,15 +207,22 @@
</ul></div>
<h5>
<a name="geometry_index.r_tree.introduction.h1"></a>
<span class="phrase"><a name="geometry_index.r_tree.introduction.contributors"></a></span><a class="link" href="introduction.html#geometry_index.r_tree.introduction.contributors">Contributors</a>
<span><a name="geometry_index.r_tree.introduction.dependencies"></a></span><a class="link" href="introduction.html#geometry_index.r_tree.introduction.dependencies">Dependencies</a>
</h5>
<p>
R-tree depends on <span class="bold"><strong>Boost.Move</strong></span>, <span class="bold"><strong>Boost.Container</strong></span>, <span class="bold"><strong>Boost.Tuple</strong></span>.
</p>
<h5>
<a name="geometry_index.r_tree.introduction.h2"></a>
<span><a name="geometry_index.r_tree.introduction.contributors"></a></span><a class="link" href="introduction.html#geometry_index.r_tree.introduction.contributors">Contributors</a>
</h5>
<p>
The spatial index was originally started by Federico J. Fernandez during
the Google-Of-Summer project 2008, mentored by Hartmut Kaiser.
</p>
<h5>
<a name="geometry_index.r_tree.introduction.h2"></a>
<span class="phrase"><a name="geometry_index.r_tree.introduction.spatial_thanks"></a></span><a class="link" href="introduction.html#geometry_index.r_tree.introduction.spatial_thanks">Spatial
<a name="geometry_index.r_tree.introduction.h3"></a>
<span><a name="geometry_index.r_tree.introduction.spatial_thanks"></a></span><a class="link" href="introduction.html#geometry_index.r_tree.introduction.spatial_thanks">Spatial
thanks</a>
</h5>
<p>
@ -224,20 +231,20 @@
list for their help.
</p>
<div class="footnotes">
<br><hr style="width:100; align:left;">
<div id="ftn.geometry_index.r_tree.introduction.f0" class="footnote"><p><a href="#geometry_index.r_tree.introduction.f0" class="para"><sup class="para">[1] </sup></a>
<br><hr width="100" align="left">
<div class="footnote"><p><sup>[<a id="ftn.geometry_index.r_tree.introduction.f0" href="#geometry_index.r_tree.introduction.f0" class="para">1</a>] </sup>
Guttman, A. (1984). <span class="emphasis"><em>R-Trees: A Dynamic Index Structure for Spatial
Searching</em></span>
</p></div>
<div id="ftn.geometry_index.r_tree.introduction.f1" class="footnote"><p><a href="#geometry_index.r_tree.introduction.f1" class="para"><sup class="para">[2] </sup></a>
<div class="footnote"><p><sup>[<a id="ftn.geometry_index.r_tree.introduction.f1" href="#geometry_index.r_tree.introduction.f1" class="para">2</a>] </sup>
Cheung, K.; Fu, A. (1998). <span class="emphasis"><em>Enhanced Nearest Neighbour Search
on the R-tree</em></span>
</p></div>
<div id="ftn.geometry_index.r_tree.introduction.f2" class="footnote"><p><a href="#geometry_index.r_tree.introduction.f2" class="para"><sup class="para">[3] </sup></a>
<div class="footnote"><p><sup>[<a id="ftn.geometry_index.r_tree.introduction.f2" href="#geometry_index.r_tree.introduction.f2" class="para">3</a>] </sup>
Greene, D. (1989). <span class="emphasis"><em>An implementation and performance analysis
of spatial data access methods</em></span>
</p></div>
<div id="ftn.geometry_index.r_tree.introduction.f3" class="footnote"><p><a href="#geometry_index.r_tree.introduction.f3" class="para"><sup class="para">[4] </sup></a>
<div class="footnote"><p><sup>[<a id="ftn.geometry_index.r_tree.introduction.f3" href="#geometry_index.r_tree.introduction.f3" class="para">4</a>] </sup>
Beckmann, N.; Kriegel, H. P.; Schneider, R.; Seeger, B. (1990). <span class="emphasis"><em>The
R*-tree: an efficient and robust access method for points and rectangles</em></span>
</p></div>

View File

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Queries</title>
<link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Geometry Index">
<link rel="up" href="../r_tree.html" title="R-tree">
<link rel="prev" href="creation_and_modification.html" title="Creation and modification">
@ -41,10 +41,10 @@
query results into the other R-tree</a></span></dt>
</dl></div>
<p>
Queries returns <code class="computeroutput"><span class="identifier">Value</span></code>s which
meets some predicates. Currently supported are three types of predicates:
Queries returns <code class="computeroutput">Value</code>s which meets some predicates. Currently
supported are three types of predicates:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
spatial predicates - defining relationship between stored Values and
some Geometry,
@ -60,7 +60,7 @@
<p>
For example queries may be used to retrieve Values:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
intersecting some area but not within other area,
</li>
@ -81,7 +81,7 @@
is used as the predicate, this is a default spatial predicate described
in the following section. Following queries returns <code class="computeroutput">Value</code>s
intersecting some region defined as a <code class="computeroutput"><a href="http://www.boost.org/libs/geometry/doc/html/geometry/reference/concepts/concept_box.html" target="_top">Box</a></code>.
These three methods are:
These three ways are:
</p>
<p>
Method call
@ -111,9 +111,9 @@
queries</a>
</h4></div></div></div>
<p>
Spatial query returns Values which are related somehow to a geometry or
some number of geometries. Names of spatial predicates corresponds to names
of <a href="http://www.boost.org/libs/geometry/doc/html/index.html" target="_top">Boost.Geometry</a>
Spatial query returns <code class="computeroutput">Value</code>s which are related somehow to
a geometry or some number of geometries. Names of spatial predicates corresponds
to names of <a href="http://www.boost.org/libs/geometry/doc/html/index.html" target="_top">Boost.Geometry</a>
algorithms. Examples of some basic queries may be found in tables below.
The query region and result <code class="computeroutput"><span class="identifier">Value</span></code>s
are orange.
@ -248,11 +248,12 @@
neighbours queries</a>
</h4></div></div></div>
<p>
Nearest neighbours queries returns <code class="computeroutput"><span class="identifier">Value</span></code>s
which are closest to some point in space. Additionally it is possible to
pass distance predicates in order to define how the distance to the <code class="computeroutput"><span class="identifier">Value</span></code> should be calculated or minimal
and maximal distances. The examples of some knn queries may be found in
the table below. All queries returns 5 closest <code class="computeroutput"><span class="identifier">Values</span></code>.
Nearest neighbours queries returns <code class="computeroutput">Value</code>s which are closest
to some point in space. Additionally it is possible to pass define how
the distance to the <code class="computeroutput"><span class="identifier">Value</span></code>
should be calculated or distance predicates defining minimal and maximal
distances. The examples of some knn queries may be found in the table below.
All queries returns 5 closest <code class="computeroutput"><span class="identifier">Values</span></code>.
The query point, region and result Values are orange.
</p>
<div class="informaltable"><table class="table">
@ -305,7 +306,8 @@
</h5></div></div></div>
<p>
There are three ways of performing knn queries. Following queries returns
k <code class="computeroutput">Value</code>s closest to some point in space. For <code class="computeroutput"><a href="http://www.boost.org/libs/geometry/doc/html/geometry/reference/concepts/concept_box.html" target="_top">Box</a></code>es
<code class="computeroutput"><span class="identifier">k</span></code> <code class="computeroutput">Value</code>s
closest to some point in space. For <code class="computeroutput"><a href="http://www.boost.org/libs/geometry/doc/html/geometry/reference/concepts/concept_box.html" target="_top">Box</a></code>es
<code class="computeroutput">Indexable</code>s the distance to the nearest point is calculated
by default.
</p>
@ -440,7 +442,7 @@ must be greater than 10 */</span>
<p>
It's possible to use some number of predicates in one query by passing:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem">
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">Pred1</span><span class="special">,</span>
<span class="identifier">Pred2</span><span class="special">&gt;</span></code>,

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Quick Start</title>
<link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Geometry Index">
<link rel="up" href="../r_tree.html" title="R-tree">
<link rel="prev" href="introduction.html" title="Introduction">
@ -150,7 +150,7 @@
</p>
<h4>
<a name="geometry_index.r_tree.rtree_quickstart.h0"></a>
<span class="phrase"><a name="geometry_index.r_tree.rtree_quickstart.more"></a></span><a class="link" href="rtree_quickstart.html#geometry_index.r_tree.rtree_quickstart.more">More</a>
<span><a name="geometry_index.r_tree.rtree_quickstart.more"></a></span><a class="link" href="rtree_quickstart.html#geometry_index.r_tree.rtree_quickstart.more">More</a>
</h4>
<p>
More information about the R-tree implementation, other algorithms and queries

View File

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Chapter&#160;1.&#160;Geometry Index</title>
<link rel="stylesheet" href="http://www.boost.org/doc/libs/release/doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="Chapter&#160;1.&#160;Geometry Index">
<link rel="next" href="geometry_index/introduction.html" title="Introduction">
</head>
@ -50,7 +50,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: January 26, 2013 at 01:20:57 GMT</small></p></td>
<td align="left"><p><small>Last revised: February 06, 2013 at 16:48:24 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>

View File

@ -61,29 +61,29 @@ If comparison of two `__value__`s is required, the default translator:
[endsect]
[section Inserting and splitting algorithms (compile-time)]
[section Balancing algorithms (compile-time)]
`__value__`s may be inserted to the __rtree__ in many various ways. Final internal structure
of the __rtree__ depends on algorithms used in the insertion process and parameters. The most important is
nodes' splitting algorithm. Currently, three well-known types of R-trees may be created.
nodes' balancing algorithm. Currently, three well-known types of R-trees may be created.
Linear - classic __rtree__ using splitting algorithm of linear complexity
Linear - classic __rtree__ using balancing algorithm of linear complexity
index::rtree< __value__, index::linear<32, 8> > rt;
Quadratic - classic __rtree__ using splitting algorithm of quadratic complexity
Quadratic - classic __rtree__ using balancing algorithm of quadratic complexity
index::rtree< __value__, index::quadratic<32, 8> > rt;
R*-tree - splitting algorithm minimizing nodes' overlap with forced reinsertions
R*-tree - balancing algorithm minimizing nodes' overlap with forced reinsertions
index::rtree< __value__, index::rstar<32, 8> > rt;
[endsect]
[section Inserting and splitting algorithms (run-time)]
[section Balancing algorithms (run-time)]
Splitting algorithm parameters may be passed to the __rtree__ in run time.
Balancing algorithm parameters may be passed to the __rtree__ in run time.
To use run-time versions of the __rtree__ one may pass parameters defined in index::runtime
namespace.
@ -125,9 +125,9 @@ which also supports compilers not supporting rvalue references.
[endsect]
[section Inserting and removing of Values]
[section Inserting and removing Values]
The following code creates an __rtree__ using quadratic algorithm.
The following code creates an __rtree__ using quadratic balancing algorithm.
using namespace boost::geometry;
typedef std::pair<Box, int> __value__;

View File

@ -52,6 +52,10 @@ Key features of this implementation of the __rtree__ are:
* parameters (including maximal and minimal number of elements) may be passed as compile- or run-time parameters - compile-time version is faster,
* advanced queries - e.g. search for 5 nearest values further than some minimal distance and intersecting some region but not within the other one.
[heading Dependencies]
R-tree depends on *Boost.Move*, *Boost.Container*, *Boost.Tuple*.
[heading Contributors]
The spatial index was originally started by Federico J. Fernandez during the Google-Of-Summer project 2008, mentored by Hartmut Kaiser.

View File

@ -10,10 +10,10 @@
[section Queries]
Queries returns `Value`s which meets some predicates. Currently supported are three types of predicates:
Queries returns `__value__`s which meets some predicates. Currently supported are three types of predicates:
* spatial predicates - defining relationship between stored Values and some Geometry,
* nearest predicates - defining relationship between stored Values and some Point,
* nearest predicates - defining relationship between stored Values and some Point,
* value predicate - passing user-defined functor to the query.
For example queries may be used to retrieve Values:
@ -27,7 +27,7 @@ For example queries may be used to retrieve Values:
There are three ways to perform a query. In the following example `__box__` is used as
the predicate, this is a default spatial predicate described in the following section.
Following queries returns `__value__`s intersecting some region defined as a `__box__`.
These three methods are:
These three ways are:
Method call
@ -51,7 +51,7 @@ Use of pipe operator generating a range
[section Spatial queries]
Spatial query returns Values which are related somehow to a geometry or some number of geometries.
Spatial query returns `__value__`s which are related somehow to a geometry or some number of geometries.
Names of spatial predicates corresponds to names of __boost_geometry__ algorithms. Examples of some
basic queries may be found in tables below. The query region and result `Value`s are orange.
@ -85,9 +85,9 @@ All predicates may be negated, e.g.:
[section Nearest neighbours queries]
Nearest neighbours queries returns `Value`s which are closest to some point in space.
Additionally it is possible to pass distance predicates in order to define how the distance
to the `Value` should be calculated or minimal and maximal distances. The examples of some knn
Nearest neighbours queries returns `__value__`s which are closest to some point in space.
Additionally it is possible to pass define how the distance to the `Value` should be calculated
or distance predicates defining minimal and maximal distances. The examples of some knn
queries may be found in the table below. All queries returns 5 closest `Values`.
The query point, region and result Values are orange.
@ -99,7 +99,7 @@ The query point, region and result Values are orange.
[section k nearest neighbours]
There are three ways of performing knn queries. Following queries returns
k `__value__`s closest to some point in space. For `__box__`es
`k` `__value__`s closest to some point in space. For `__box__`es
`__indexable__`s the distance to the nearest point is calculated by default.
Method call

View File

@ -11,7 +11,7 @@
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_NODE_DEFAULT_HPP
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_NODE_DEFAULT_HPP
#include <vector>
#include <boost/container/vector.hpp>
#include <boost/geometry/index/detail/rtree/node/dynamic_visitor.hpp>
@ -23,7 +23,7 @@ template <typename Value, typename Parameters, typename Box, typename Allocators
struct dynamic_internal_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
: public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
{
typedef std::vector<
typedef boost::container::vector<
std::pair<Box, dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag> *>,
typename Allocators::internal_node_elements_allocator_type
> elements_type;
@ -42,7 +42,7 @@ template <typename Value, typename Parameters, typename Box, typename Allocators
struct dynamic_leaf<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
: public dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_dynamic_tag>
{
typedef std::vector<
typedef boost::container::vector<
Value,
typename Allocators::leaf_elements_allocator_type
> elements_type;
@ -146,7 +146,7 @@ elements(Node const& n)
template <typename Elements, typename NewValue>
struct container_from_elements_type
{
typedef std::vector<NewValue> type;
typedef boost::container::vector<NewValue> type;
};
// allocators

View File

@ -12,7 +12,7 @@
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_NODE_DEFAULT_STATIC_HPP
#include <boost/geometry/index/detail/rtree/node/dynamic_visitor.hpp>
#include <boost/geometry/index/detail/static_vector.hpp>
#include <boost/geometry/index/detail/varray.hpp>
namespace boost { namespace geometry { namespace index {
@ -22,12 +22,13 @@ 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>
{
typedef detail::static_vector<
typedef detail::varray<
std::pair<
Box,
dynamic_node<Value, Parameters, Box, Allocators, node_d_mem_static_tag> *
>,
Parameters::max_elements + 1
Parameters::max_elements + 1,
typename Allocators::internal_node_elements_allocator_type
> elements_type;
template <typename Dummy>
@ -43,7 +44,11 @@ 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>
{
typedef detail::static_vector<Value, Parameters::max_elements + 1> elements_type;
typedef detail::varray<
Value,
Parameters::max_elements + 1,
typename Allocators::leaf_elements_allocator_type
> elements_type;
template <typename Dummy>
inline dynamic_leaf(Dummy) {}
@ -81,10 +86,10 @@ struct visitor<Value, Parameters, Box, Allocators, node_d_mem_static_tag, IsVisi
};
// elements derived type
template <typename OldValue, size_t N, typename NewValue>
struct container_from_elements_type<detail::static_vector<OldValue, N>, NewValue>
template <typename OldValue, size_t N, typename A, typename NewValue>
struct container_from_elements_type<detail::varray<OldValue, N, A>, NewValue>
{
typedef detail::static_vector<NewValue, N> type;
typedef detail::varray<NewValue, N> type;
};
// allocators
@ -107,6 +112,14 @@ public:
typename leaf<Value, Parameters, Box, allocators, node_d_mem_static_tag>::type
>::other leaf_allocator_type;
typedef typename allocator_type::template rebind<
std::pair<Box, typename node<Value, Parameters, Box, allocators, node_d_mem_static_tag>::type *>
>::other internal_node_elements_allocator_type;
typedef typename allocator_type::template rebind<
Value
>::other leaf_elements_allocator_type;
inline allocators()
: allocator()
, internal_node_allocator()

View File

@ -11,7 +11,7 @@
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_NODE_DEFAULT_VARIANT_HPP
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_NODE_DEFAULT_VARIANT_HPP
#include <vector>
#include <boost/container/vector.hpp>
#include <boost/geometry/index/detail/rtree/node/static_visitor.hpp>
@ -24,7 +24,7 @@ namespace detail { namespace rtree {
template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
struct static_internal_node
{
typedef std::vector<
typedef boost::container::vector<
std::pair<
Box,
typename node<Value, Parameters, Box, Allocators, Tag>::type *
@ -42,7 +42,7 @@ struct static_internal_node
template <typename Value, typename Parameters, typename Box, typename Allocators, typename Tag>
struct static_leaf
{
typedef std::vector<
typedef boost::container::vector<
Value,
typename Allocators::leaf_elements_allocator_type
> elements_type;

View File

@ -11,7 +11,7 @@
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_NODE_DEFAULT_STATIC_VARIANT_HPP
#define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_NODE_DEFAULT_STATIC_VARIANT_HPP
#include <boost/geometry/index/detail/static_vector.hpp>
#include <boost/geometry/index/detail/varray.hpp>
#include <boost/geometry/index/detail/rtree/node/static_visitor.hpp>
@ -24,12 +24,13 @@ namespace detail { namespace rtree {
template <typename Value, typename Parameters, typename Box, typename Allocators>
struct static_internal_node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
{
typedef detail::static_vector<
typedef detail::varray<
std::pair<
Box,
typename node<Value, Parameters, Box, Allocators, node_s_mem_static_tag>::type *
>,
Parameters::max_elements + 1
Parameters::max_elements + 1,
typename Allocators::internal_node_elements_allocator_type
> elements_type;
template <typename Dummy>
@ -41,7 +42,11 @@ struct static_internal_node<Value, Parameters, Box, Allocators, node_s_mem_stati
template <typename Value, typename Parameters, typename Box, typename Allocators>
struct static_leaf<Value, Parameters, Box, Allocators, node_s_mem_static_tag>
{
typedef detail::static_vector<Value, Parameters::max_elements + 1> elements_type;
typedef detail::varray<
Value,
Parameters::max_elements + 1,
typename Allocators::leaf_elements_allocator_type
> elements_type;
template <typename Dummy>
inline static_leaf(Dummy) {}

View File

@ -120,7 +120,7 @@ protected:
typedef rtree::node_auto_ptr<Value, Options, Translator, Box, Allocators> node_auto_ptr;
public:
typedef index::detail::static_vector<std::pair<Box, node*>, 1> nodes_container_type;
typedef index::detail::varray<std::pair<Box, node*>, 1> nodes_container_type;
template <typename Node>
static inline void apply(nodes_container_type & additional_nodes,

View File

@ -6,8 +6,8 @@
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_STATIC_VECTOR_HPP
#define BOOST_GEOMETRY_INDEX_DETAIL_STATIC_VECTOR_HPP
#ifndef BOOST_GEOMETRY_INDEX_DETAIL_VARRAY_HPP
#define BOOST_GEOMETRY_INDEX_DETAIL_VARRAY_HPP
#include <cstddef>
#include <stdexcept>
@ -32,56 +32,65 @@
namespace boost { namespace geometry { namespace index { namespace detail {
template <typename Value, size_t Capacity>
class static_vector
template <typename V>
struct varray_default_alloc
{
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef V * pointer;
typedef const V * const_pointer;
};
template <typename Value, size_t Capacity, typename Al = varray_default_alloc<Value> >
class varray
{
BOOST_MPL_ASSERT_MSG(
(0 < Capacity),
INVALID_CAPACITY,
(static_vector));
(varray));
public:
typedef Value value_type;
typedef std::size_t size_type;
typedef Value& reference;
typedef Value const& const_reference;
typedef Value * pointer;
typedef const Value* const_pointer;
typedef Value* iterator;
typedef const Value * const_iterator;
typedef typename Al::size_type size_type;
typedef typename Al::difference_type difference_type;
typedef typename Al::pointer pointer;
typedef typename Al::const_pointer const_pointer;
typedef pointer iterator;
typedef const_pointer const_iterator;
typedef boost::reverse_iterator<iterator> reverse_iterator;
typedef boost::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename boost::iterator_difference<iterator>::type difference_type;
// nothrow
static_vector()
varray()
: m_size(0)
{}
// strong
explicit static_vector(size_type count)
explicit varray(size_type count)
: m_size(0)
{
resize(count); // may throw
}
// strong
static_vector(size_type count, value_type const& value)
varray(size_type count, value_type const& value)
: m_size(0)
{
resize(count, value); // may throw
}
// strong
static_vector(static_vector const& other)
varray(varray const& other)
: m_size(other.m_size)
{
this->uninitialized_copy(other.begin(), other.end(), this->begin()); // may throw
}
// strong
template <size_t C>
static_vector(static_vector<value_type, C> const& other)
template <size_t C, typename A>
varray(varray<value_type, C, A> const& other)
: m_size(other.m_size)
{
check_capacity(other.m_size);
@ -91,14 +100,14 @@ public:
// strong
template <typename Iterator>
static_vector(Iterator first, Iterator last)
varray(Iterator first, Iterator last)
: m_size(0)
{
assign(first, last); // may throw
}
// basic
static_vector & operator=(static_vector const& other)
varray & operator=(varray const& other)
{
assign(other.begin(), other.end()); // may throw
@ -106,8 +115,8 @@ public:
}
// basic
template <size_t C>
static_vector & operator=(static_vector<value_type, C> const& other)
template <size_t C, typename A>
varray & operator=(varray<value_type, C, A> const& other)
{
assign(other.begin(), other.end()); // may throw
@ -115,7 +124,7 @@ public:
}
// nothrow
~static_vector()
~varray()
{
this->destroy(this->begin(), this->end());
}
@ -380,8 +389,8 @@ public:
const_reverse_iterator crend() const { return reverse_iterator(this->begin()); }
// nothrow
size_type capacity() const { return Capacity; }
size_type max_size() const { return Capacity; }
static size_type capacity() { return Capacity; }
static size_type max_size() { return Capacity; }
size_type size() const { return m_size; }
bool empty() const { return 0 == m_size; }
@ -787,14 +796,14 @@ private:
);*/
}
Value * ptr()
pointer ptr()
{
return (reinterpret_cast<Value*>(m_storage.address()));
return pointer(m_storage.address());
}
const Value * ptr() const
const_pointer ptr() const
{
return (reinterpret_cast<const Value*>(m_storage.address()));
return const_pointer(m_storage.address());
}
boost::aligned_storage<sizeof(Value[Capacity]), boost::alignment_of<Value[Capacity]>::value> m_storage;
@ -803,4 +812,4 @@ private:
}}}} // namespace boost::geometry::index::detail
#endif // BOOST_GEOMETRY_INDEX_DETAIL_STATIC_VECTOR_HPP
#endif // BOOST_GEOMETRY_INDEX_DETAIL_VARRAY_HPP

View File

@ -116,12 +116,12 @@ public:
/*! \brief The Indexable type to which Value is translated. */
typedef typename translator::indexable_type<Translator>::type indexable_type;
/*! \brief The Box type used by the R-tree. */
typedef typename index::detail::default_box_type<indexable_type>::type envelope_type;
typedef typename index::detail::default_box_type<indexable_type>::type bounds_type;
#if !defined(BOOST_GEOMETRY_INDEX_ENABLE_DEBUG_INTERFACE)
private:
#endif
typedef envelope_type box_type;
typedef bounds_type box_type;
typedef typename detail::rtree::options_type<Parameters>::type options_type;
typedef typename options_type::node_tag node_tag;
typedef detail::rtree::allocators<allocator_type, value_type, typename options_type::parameters_type, box_type, node_tag> allocators_type;
@ -1113,7 +1113,7 @@ public:
\par Throws
Nothing.
*/
inline envelope_type const& envelope() const
inline bounds_type const& bounds() const
{
return m_box;
}
@ -1878,7 +1878,7 @@ It calls \c rtree::empty().
template <typename Value, typename Options, typename Translator, typename Allocator>
inline bool empty(rtree<Value, Options, Translator, Allocator> const& tree)
{
return tree.empty();
return tree.bounds();
}
/*!
@ -1893,82 +1893,12 @@ It calls \c rtree::envelope().
\return The box containing all stored values or an invalid box.
*/
template <typename Value, typename Options, typename Translator, typename Allocator>
inline typename rtree<Value, Options, Translator, Allocator>::box_type const&
envelope(rtree<Value, Options, Translator, Allocator> const& tree)
inline typename rtree<Value, Options, Translator, Allocator>::bounds_type const&
bounds(rtree<Value, Options, Translator, Allocator> const& tree)
{
return tree.envelope();
return tree.bounds();
}
}}} // namespace boost::geometry::index
// Rtree adaptation to Box concept
namespace boost { namespace geometry {
// Traits specializations for box above
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
namespace traits
{
template <typename Value, typename Parameters, typename Translator, typename Allocator>
struct tag< index::rtree<Value, Parameters, Translator, Allocator> >
{
typedef box_tag type;
};
template <typename Value, typename Parameters, typename Translator, typename Allocator>
struct point_type< index::rtree<Value, Parameters, Translator, Allocator> >
{
typedef typename geometry::point_type<
typename index::rtree<Value, Parameters, Translator, Allocator>::box_type
>::type type;
};
template <typename Value, typename Parameters, typename Translator, typename Allocator, std::size_t Dimension>
struct indexed_access<index::rtree<Value, Parameters, Translator, Allocator>, min_corner, Dimension>
{
typedef typename geometry::coordinate_type<
typename geometry::point_type<
index::rtree<Value, Parameters, Translator, Allocator>
>::type
>::type coordinate_type;
static inline coordinate_type get(index::rtree<Value, Parameters, Translator, Allocator> const& tree)
{
return geometry::get<min_corner, Dimension>(tree.envelope());
}
static inline void set(index::rtree<Value, Parameters, Translator, Allocator> & tree,
coordinate_type const& value)
{
return geometry::set<min_corner, Dimension>(tree.envelope(), value);
}
};
template <typename Value, typename Parameters, typename Translator, typename Allocator, std::size_t Dimension>
struct indexed_access<index::rtree<Value, Parameters, Translator, Allocator>, max_corner, Dimension>
{
typedef typename geometry::coordinate_type<
typename geometry::point_type<
index::rtree<Value, Parameters, Translator, Allocator>
>::type
>::type coordinate_type;
static inline coordinate_type get(index::rtree<Value, Parameters, Translator, Allocator> const& tree)
{
return geometry::get<max_corner, Dimension>(tree.envelope());
}
static inline void set(index::rtree<Value, Parameters, Translator, Allocator> & tree,
coordinate_type const& value)
{
return geometry::set<max_corner, Dimension>(tree.envelope(), value);
}
};
} // namespace traits
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
}} //namespace boost::geometry
#endif // BOOST_GEOMETRY_INDEX_RTREE_HPP

View File

@ -104,61 +104,61 @@ void test_rtree_elements_exceptions(Parameters const& parameters = Parameters())
for ( size_t i = 0 ; i < 100 ; i += 2 )
{
throwing_static_vector_settings::reset_calls_counter();
throwing_static_vector_settings::set_max_calls(10000);
throwing_varray_settings::reset_calls_counter();
throwing_varray_settings::set_max_calls(10000);
Tree tree(parameters);
throwing_static_vector_settings::reset_calls_counter();
throwing_static_vector_settings::set_max_calls(i);
throwing_varray_settings::reset_calls_counter();
throwing_varray_settings::set_max_calls(i);
BOOST_CHECK_THROW( tree.insert(input.begin(), input.end()), throwing_static_vector_exception );
BOOST_CHECK_THROW( tree.insert(input.begin(), input.end()), throwing_varray_exception );
}
for ( size_t i = 0 ; i < 50 ; i += 2 )
{
throwing_static_vector_settings::reset_calls_counter();
throwing_static_vector_settings::set_max_calls(10000);
throwing_varray_settings::reset_calls_counter();
throwing_varray_settings::set_max_calls(10000);
Tree tree(parameters);
tree.insert(input.begin(), input.end());
throwing_static_vector_settings::reset_calls_counter();
throwing_static_vector_settings::set_max_calls(i);
throwing_varray_settings::reset_calls_counter();
throwing_varray_settings::set_max_calls(i);
BOOST_CHECK_THROW( tree.remove(input.begin(), input.end()), throwing_static_vector_exception );
BOOST_CHECK_THROW( tree.remove(input.begin(), input.end()), throwing_varray_exception );
}
for ( size_t i = 0 ; i < 50 ; i += 2 )
{
throwing_static_vector_settings::reset_calls_counter();
throwing_static_vector_settings::set_max_calls(10000);
throwing_varray_settings::reset_calls_counter();
throwing_varray_settings::set_max_calls(10000);
Tree tree(parameters);
tree.insert(input.begin(), input.end());
throwing_static_vector_settings::reset_calls_counter();
throwing_static_vector_settings::set_max_calls(i);
throwing_varray_settings::reset_calls_counter();
throwing_varray_settings::set_max_calls(i);
BOOST_CHECK_THROW( Tree tree2(tree), throwing_static_vector_exception );
BOOST_CHECK_THROW( Tree tree2(tree), throwing_varray_exception );
}
for ( size_t i = 0 ; i < 50 ; i += 2 )
{
throwing_static_vector_settings::reset_calls_counter();
throwing_static_vector_settings::set_max_calls(10000);
throwing_varray_settings::reset_calls_counter();
throwing_varray_settings::set_max_calls(10000);
Tree tree(parameters);
Tree tree2(parameters);
tree.insert(input.begin(), input.end());
throwing_static_vector_settings::reset_calls_counter();
throwing_static_vector_settings::set_max_calls(i);
throwing_varray_settings::reset_calls_counter();
throwing_varray_settings::set_max_calls(i);
BOOST_CHECK_THROW(tree2 = tree, throwing_static_vector_exception );
BOOST_CHECK_THROW(tree2 = tree, throwing_varray_exception );
}
}

View File

@ -1293,26 +1293,8 @@ void test_rtree_count(Parameters const& parameters)
// test rtree box
template <size_t Dimention>
struct test_geometry_algorithms
{
template <typename Rtree, typename Box>
static void apply(Rtree const& , Box const& ) {}
};
template <>
struct test_geometry_algorithms<2>
{
template <typename Rtree, typename Box>
static void apply(Rtree const& t, Box const& b)
{
BOOST_CHECK(bg::area(t) == bg::area(b));
BOOST_CHECK(bg::perimeter(t) == bg::perimeter(b));
}
};
template <typename Value, typename Parameters>
void test_rtree_envelope(Parameters const& parameters)
void test_rtree_bounds(Parameters const& parameters)
{
typedef bgi::rtree<Value, Parameters> Tree;
typedef typename Tree::box_type B;
@ -1325,24 +1307,15 @@ void test_rtree_envelope(Parameters const& parameters)
std::vector<Value> input;
B qbox;
BOOST_CHECK(bg::equals(t.envelope(), b));
BOOST_CHECK(bg::equals(t.bounds(), b));
generate_rtree(t, input, qbox);
BOOST_FOREACH(Value const& v, input)
bg::expand(b, t.translator()(v));
BOOST_CHECK(bg::equals(t.envelope(), b));
{
using namespace bg;
B temp_b;
envelope(t, temp_b);
BOOST_CHECK(equals(temp_b, b));
}
BOOST_CHECK(bg::equals(bg::return_envelope<B>(t), b));
BOOST_CHECK(bg::equals(bg::return_centroid<P>(t), bg::return_centroid<P>(b)));
test_geometry_algorithms<bg::traits::dimension<P>::value>::apply(t, b);
BOOST_CHECK(bg::equals(t.bounds(), b));
BOOST_CHECK(bg::equals(t.bounds(), bgi::bounds(t)));
size_t s = input.size();
while ( s/2 < input.size() && !input.empty() )
@ -1355,21 +1328,21 @@ void test_rtree_envelope(Parameters const& parameters)
BOOST_FOREACH(Value const& v, input)
bg::expand(b, t.translator()(v));
BOOST_CHECK(bg::equals(t.envelope(), b));
BOOST_CHECK(bg::equals(t.bounds(), b));
Tree t2(t);
BOOST_CHECK(bg::equals(t2.envelope(), b));
BOOST_CHECK(bg::equals(t2.bounds(), b));
t2.clear();
t2 = t;
BOOST_CHECK(bg::equals(t2.envelope(), b));
BOOST_CHECK(bg::equals(t2.bounds(), b));
t2.clear();
t2 = boost::move(t);
BOOST_CHECK(bg::equals(t2.envelope(), b));
BOOST_CHECK(bg::equals(t2.bounds(), b));
t.clear();
bg::assign_inverse(b);
BOOST_CHECK(bg::equals(t.envelope(), b));
BOOST_CHECK(bg::equals(t.bounds(), b));
}
// run all tests for one Algorithm for some number of rtrees
@ -1393,7 +1366,7 @@ void test_rtree_for_point(Parameters const& parameters = Parameters())
test_count_rtree_values<Point>(parameters);
test_rtree_count<Point>(parameters);
test_rtree_envelope<Point>(parameters);
test_rtree_bounds<Point>(parameters);
}
template<typename Point, typename Parameters>
@ -1413,7 +1386,7 @@ void test_rtree_for_box(Parameters const& parameters = Parameters())
test_count_rtree_values<Box>(parameters);
test_rtree_count<Box>(parameters);
test_rtree_envelope<Box>(parameters);
test_rtree_bounds<Box>(parameters);
}
#endif

View File

@ -75,7 +75,7 @@ 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>
{
typedef throwing_static_vector<
typedef throwing_varray<
std::pair<
Box,
dynamic_node<Value, Parameters, Box, Allocators, node_throwing_d_mem_static_tag> *
@ -96,7 +96,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>
{
typedef throwing_static_vector<Value, Parameters::max_elements + 1> elements_type;
typedef throwing_varray<Value, Parameters::max_elements + 1> elements_type;
template <typename Dummy>
inline dynamic_leaf(Dummy) {}
@ -109,9 +109,9 @@ struct dynamic_leaf<Value, Parameters, Box, Allocators, node_throwing_d_mem_stat
// elements derived type
template <typename OldValue, size_t N, typename NewValue>
struct container_from_elements_type<throwing_static_vector<OldValue, N>, NewValue>
struct container_from_elements_type<throwing_varray<OldValue, N>, NewValue>
{
typedef throwing_static_vector<NewValue, N> type;
typedef throwing_varray<NewValue, N> type;
};
// nodes traits

View File

@ -141,20 +141,20 @@ struct generate_value< std::pair<bg::model::point<T, 2, C>, throwing_value> >
//
//}}} // namespace boost::geometry::index
#include <boost/geometry/index/detail/static_vector.hpp>
#include <boost/geometry/index/detail/varray.hpp>
struct throwing_static_vector_exception : public std::exception
struct throwing_varray_exception : public std::exception
{
const char * what() const throw() { return "static vector exception."; }
};
struct throwing_static_vector_settings
struct throwing_varray_settings
{
static void throw_if_required()
{
// throw if counter meets max count
if ( get_max_calls_ref() <= get_calls_counter_ref() )
throw throwing_static_vector_exception();
throw throwing_varray_exception();
else
++get_calls_counter_ref();
}
@ -167,10 +167,10 @@ struct throwing_static_vector_settings
};
template <typename Element, size_t Capacity>
class throwing_static_vector
: public boost::geometry::index::detail::static_vector<Element, Capacity>
class throwing_varray
: public boost::geometry::index::detail::varray<Element, Capacity>
{
typedef boost::geometry::index::detail::static_vector<Element, Capacity> container;
typedef boost::geometry::index::detail::varray<Element, Capacity> container;
public:
typedef typename container::value_type value_type;
@ -184,13 +184,13 @@ public:
inline void resize(size_type s)
{
throwing_static_vector_settings::throw_if_required();
throwing_varray_settings::throw_if_required();
container::resize(s);
}
void push_back(Element const& v)
{
throwing_static_vector_settings::throw_if_required();
throwing_varray_settings::throw_if_required();
container::push_back(v);
}
};

View File

@ -55,7 +55,7 @@ int main()
typedef bgi::rtree<B, bgi::linear<32, 8> > RT;
//typedef bgi::rtree<B, bgi::runtime::linear > RT;
//typedef bgi::rtree<B, bgi::quadratic<32, 8> > RT;
// typedef bgi::rtree<B, bgi::runtime::quadratic > RT;
//typedef bgi::rtree<B, bgi::runtime::quadratic > RT;
//typedef bgi::rtree<B, bgi::rstar<32, 8> > RT;
//typedef bgi::rtree<B, bgi::runtime::rstar > RT;