Segment_tree_d<Data, Window, Traits>::Data | |
container Data.
| |
Segment_tree_d<Data, Window, Traits>::Window | |
container Window.
| |
Segment_tree_d<Data, Window, Traits>::Traits | |
class Traits.
|
Segment_tree_d<Data, Window, Traits> s ( Tree_base<Data, Window> sublayer_tree); | |
A segment tree is defined, such that the subtree of each
vertex is of the same type prototype
sublayer_tree is. We assume that the dimension of the tree is d. This means, that sublayer_tree is a prototype of a d-1-dimensional tree. All data items of the d-dimensional segment tree have container type Data. The query window of the tree has container type Window. Traits provides access to the corresponding data slots of container Data and Window for the d-th dimension. The traits class Traits must at least provide all functions and type definitions described, for example, in the reference page for tree_point_traits. The template class described there is fully generic and should fulfill the most requirements one can have. In order to generate a one-dimensional segment tree instantiate Tree_anchor<Data, Window> sublayer_tree with the same template parameters Data and Window Segment_tree_d is defined. In order to construct a two-dimensional segment tree, create Segment_tree_d with a one-dimensional Segment_tree_d with the corresponding Traits of the first dimension. Precondition: Traits::Data==Data and Traits::Window==Window.
|
bool | s.make_tree ( In_it first, In_it last) | |
The tree is constructed according to the data items in the sequence between the element pointed by iterator first and iterator last. |
Precondition
This function can only be called once. If it is the first call the tree is build and true is returned. Otherwise, nothing is done but a CGAL warning is given and false returned.
Protected Operations
bool | s.is_inside ( Window win, Data object) | |
returns true, if the interval of object is contained in the interval of win. False otherwise. | ||
bool | s.is_anchor () | returns false. |
A d-dimensional segment tree is constructed in O(nlog nd) time. An inverse range query is performed in time O(k+log d n ), where k is the number of reported intervals. The tree uses O(nlog nd) storage.