Base Class for SegmentSet and SegmentMap.
More...
#include <yat/utility/SegmentTree.h>
template<class Container, class Compare, class Value2Key>
class theplu::yat::utility::SegmentTree< Container, Compare, Value2Key >
Base Class for SegmentSet and SegmentMap.
- Container: underlying container (set or map)
- Compare: functor comparing elements (same as in Segment)
- Value2Key: functor translating a
const_reference
to key_type
(or const&
)
template<class Container, class Compare, class Value2Key>
element type is same as key_type
's value_type.
If the key held is Segment<T>
, value_type
is T
.
template<class Container, class Compare, class Value2Key>
key type is same as Container
's key_type
.
Typically Segment<element_type>.
template<class Container, class Compare, class Value2Key>
value type is same as Container
's value_type
.
Typically a Segment<element_type> or pair<const Segment<element_type>, Data>.
template<class Container, class Compare, class Value2Key>
- Returns
- const iterator pointing to beginning of container
template<class Container, class Compare, class Value2Key>
- Returns
- iterator pointing to beginning of container
template<class Container , class Compare , class Value2Key >
- Returns
- 1 if there is a Segment that overlaps with element
template<class Container, class Compare, class Value2Key>
- Returns
true
if size is zero
template<class Container, class Compare, class Value2Key>
- Returns
- a const_iterator pointing to the end of container
template<class Container, class Compare, class Value2Key>
template<class Container, class Compare, class Value2Key>
erase values in range [first, last)
- Since
- New in yat 0.8
template<class Container, class Compare, class Value2Key>
erase value pointed to by pos
- Since
- New in yat 0.8
template<class Container , class Compare , class Value2Key >
- Returns
- iterator pointing to value containing element
If no value contains element, end() is returned.
template<class Container , class Compare , class Value2Key >
- Returns
- const iterator pointing to value containing element
If no value contains element, end() is returned.
- Returns
- an iterator pointing to the Segment that contains element. If no Segment contains element, end() is returned.
template<typename T , class Compare , class Value2Key >
insert value
if value does not overlap with container, insert segment; otherwise do nothing.
- Returns
- a pair where pair.first points to the inserted value or if value was not inserted it points to a value in container that overlaps with value; pair.second is true if value was inserted.
template<class Container, class Compare, class Value2Key>
- Returns
- Comparison functor to compare two keys (Segment)
template<typename T , class Compare , class Value2Key >
similar to lower_bound in std::set and std::map
- Returns
- iterator pointing to first value whose key overlaps with element or is greater than element.
template<typename T , class Compare , class Value2Key >
similar to lower_bound in std::set and std::map
- Returns
- const iterator pointing to first value whose key overlaps with element or is greater than element.
template<class Container, class Compare, class Value2Key>
pair.first first (smallest) segment that overlaps with segment and pair.second first (smallest) segment that does not overlap with segment.
template<class Container, class Compare, class Value2Key>
- Returns
- number of values in container
template<typename T , class Compare , class Value2Key >
- Returns
- iterator pointing to first segment that is greater than segment.
template<typename T , class Compare , class Value2Key >
similar to upper_bound in std::set and std::map
- Returns
- iterator pointing to first value whose key is greater than element.
template<class Container, class Compare, class Value2Key>
- Returns
- the
value_compare
object used by the class to sort values
The documentation for this class was generated from the following file: