A library for working with phylogenetic and population genetic data.
v0.27.0
IntervalTreeNode< DataType, NumericalType, IntervalKind > Class Template Reference

#include <genesis/utils/containers/interval_tree/fwd.hpp>

Detailed Description

template<typename DataType = EmptyIntervalData, typename NumericalType = DefaultIntervalNumericalType, typename IntervalKind = IntervalClosed>
class genesis::utils::IntervalTreeNode< DataType, NumericalType, IntervalKind >

Node in an IntervalTree.

The implementation is based on interval-tree, which is published under the CC0-1.0 License (Creative Commons Zero v1.0 Universal); see our Acknowledgements for further details, and see Interval, IntervalTreeIterator, and IntervalTree for the other classes based on the original code.

Definition at line 48 of file fwd.hpp.

Public Member Functions

 IntervalTreeNode (IntervalTreeNode &&)=default
 
 IntervalTreeNode (IntervalTreeNode *parent, interval_type &&interval)
 
 IntervalTreeNode (IntervalTreeNode *parent, interval_type const &interval)
 
 IntervalTreeNode (IntervalTreeNode const &)=default
 
 ~IntervalTreeNode ()=default
 
RedBackColor color () const
 
size_t height () const
 Return the height of the node in the tree. More...
 
numerical_type high () const
 Return the upper bound of the interval of this node. More...
 
interval_type const & interval () const
 
bool is_left () const noexcept
 
bool is_right () const noexcept
 
bool is_root () const noexcept
 
IntervalTreeNode const * left () const
 
numerical_type low () const
 Return the lower bound of the interval of this node. More...
 
numerical_type max () const
 
IntervalTreeNodeoperator= (IntervalTreeNode &&)=default
 
IntervalTreeNodeoperator= (IntervalTreeNode const &)=default
 
IntervalTreeNode const * parent () const
 
IntervalTreeNode const * right () const
 

Public Types

using data_type = DataType
 
using interval_kind = IntervalKind
 
using interval_type = Interval< DataType, NumericalType, IntervalKind >
 
using node_type = IntervalTreeNode< DataType, NumericalType, IntervalKind >
 
using numerical_type = NumericalType
 
using self_type = node_type
 
using tree_type = IntervalTree< DataType, NumericalType, IntervalKind >
 

Public Attributes

friend IntervalTree< DataType, NumericalType, IntervalKind >
 
friend IntervalTreeIterator< node_type, false >
 
friend IntervalTreeIterator< node_type, true >
 

Constructor & Destructor Documentation

◆ IntervalTreeNode() [1/4]

IntervalTreeNode ( IntervalTreeNode< DataType, NumericalType, IntervalKind > *  parent,
interval_type const &  interval 
)
inline

Definition at line 121 of file utils/containers/interval_tree/node.hpp.

◆ IntervalTreeNode() [2/4]

IntervalTreeNode ( IntervalTreeNode< DataType, NumericalType, IntervalKind > *  parent,
interval_type &&  interval 
)
inline

Definition at line 125 of file utils/containers/interval_tree/node.hpp.

◆ ~IntervalTreeNode()

~IntervalTreeNode ( )
default

◆ IntervalTreeNode() [3/4]

IntervalTreeNode ( IntervalTreeNode< DataType, NumericalType, IntervalKind > const &  )
default

◆ IntervalTreeNode() [4/4]

IntervalTreeNode ( IntervalTreeNode< DataType, NumericalType, IntervalKind > &&  )
default

Member Function Documentation

◆ color()

RedBackColor color ( ) const
inline

Return the color of the node.

Definition at line 174 of file utils/containers/interval_tree/node.hpp.

◆ height()

size_t height ( ) const
inline

Return the height of the node in the tree.

This is computed as height = how many parents does it have. The root has no parents and is therefor has height 0.

Definition at line 209 of file utils/containers/interval_tree/node.hpp.

◆ high()

numerical_type high ( ) const
inline

Return the upper bound of the interval of this node.

Definition at line 229 of file utils/containers/interval_tree/node.hpp.

◆ interval()

interval_type const& interval ( ) const
inline

Definition at line 146 of file utils/containers/interval_tree/node.hpp.

◆ is_left()

bool is_left ( ) const
inlinenoexcept

Definition at line 156 of file utils/containers/interval_tree/node.hpp.

◆ is_right()

bool is_right ( ) const
inlinenoexcept

Definition at line 161 of file utils/containers/interval_tree/node.hpp.

◆ is_root()

bool is_root ( ) const
inlinenoexcept

Definition at line 166 of file utils/containers/interval_tree/node.hpp.

◆ left()

IntervalTreeNode const* left ( ) const
inline

Return the left node (readonly).

Definition at line 190 of file utils/containers/interval_tree/node.hpp.

◆ low()

numerical_type low ( ) const
inline

Return the lower bound of the interval of this node.

Definition at line 221 of file utils/containers/interval_tree/node.hpp.

◆ max()

numerical_type max ( ) const
inline

Definition at line 151 of file utils/containers/interval_tree/node.hpp.

◆ operator=() [1/2]

IntervalTreeNode& operator= ( IntervalTreeNode< DataType, NumericalType, IntervalKind > &&  )
default

◆ operator=() [2/2]

IntervalTreeNode& operator= ( IntervalTreeNode< DataType, NumericalType, IntervalKind > const &  )
default

◆ parent()

IntervalTreeNode const* parent ( ) const
inline

Return the parent node up the tree.

Definition at line 182 of file utils/containers/interval_tree/node.hpp.

◆ right()

IntervalTreeNode const* right ( ) const
inline

Return the right node (readonly).

Definition at line 198 of file utils/containers/interval_tree/node.hpp.

Member Typedef Documentation

◆ data_type

using data_type = DataType

Definition at line 99 of file utils/containers/interval_tree/node.hpp.

◆ interval_kind

using interval_kind = IntervalKind

Definition at line 101 of file utils/containers/interval_tree/node.hpp.

◆ interval_type

using interval_type = Interval<DataType, NumericalType, IntervalKind>

Definition at line 103 of file utils/containers/interval_tree/node.hpp.

◆ node_type

using node_type = IntervalTreeNode<DataType, NumericalType, IntervalKind>

Definition at line 104 of file utils/containers/interval_tree/node.hpp.

◆ numerical_type

using numerical_type = NumericalType

Definition at line 100 of file utils/containers/interval_tree/node.hpp.

◆ self_type

Definition at line 108 of file utils/containers/interval_tree/node.hpp.

◆ tree_type

using tree_type = IntervalTree<DataType, NumericalType, IntervalKind>

Definition at line 105 of file utils/containers/interval_tree/node.hpp.

Member Data Documentation

◆ IntervalTree< DataType, NumericalType, IntervalKind >

friend IntervalTree< DataType, NumericalType, IntervalKind >

Definition at line 111 of file utils/containers/interval_tree/node.hpp.

◆ IntervalTreeIterator< node_type, false >

friend IntervalTreeIterator< node_type, false >

Definition at line 113 of file utils/containers/interval_tree/node.hpp.

◆ IntervalTreeIterator< node_type, true >

Definition at line 112 of file utils/containers/interval_tree/node.hpp.


The documentation for this class was generated from the following files: