|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_UTILS_CONTAINERS_INTERVAL_TREE_NODE_H_
2 #define GENESIS_UTILS_CONTAINERS_INTERVAL_TREE_NODE_H_
47 #include <type_traits>
87 typename DataType = EmptyIntervalData,
89 typename IntervalKind = IntervalClosed
91 class IntervalTreeNode
158 return this == parent_->left_;
163 return this == parent_->right_;
212 for(
auto* p = parent_; p !=
nullptr; p = p->parent_ ) {
223 return interval_.
low();
231 return interval_.
high();
243 interval_ = std::move( ival );
280 #endif // include guard
Type to store an interval (range) between two numbers, as used in the IntervalTree.
int DefaultIntervalNumericalType
Default numerical type to use in an Interval.
IntervalTreeNode< DataType, NumericalType, IntervalKind > node_type
bool is_right() const noexcept
Iterate the Intervals stored in an IntervalTree.
bool is_left() const noexcept
numerical_type high() const
Return the upper bound of the interval.
interval_type const & interval() const
~IntervalTreeNode()=default
numerical_type low() const
Return the lower bound of the interval.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
IntervalTreeNode const * right() const
numerical_type low() const
Return the lower bound of the interval of this node.
RedBackColor
Definition for Red-Black Tree coloring.
Interval< DataType, NumericalType, IntervalKind > interval_type
IntervalTreeNode const * left() const
IntervalTreeNode(IntervalTreeNode *parent, interval_type &&interval)
IntervalTreeNode const * parent() const
IntervalTreeNode(IntervalTreeNode *parent, interval_type const &interval)
numerical_type high() const
Return the upper bound of the interval of this node.
size_t height() const
Return the height of the node in the tree.
NumericalType numerical_type
IntervalKind interval_kind
Interval tree that enables storing and querying intervals, each containing some data.
RedBackColor color() const
bool is_root() const noexcept
IntervalTreeNode & operator=(IntervalTreeNode const &)=default
numerical_type max() const