Rosetta
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
numeric::DietNode< T > Class Template Reference

#include <DiscreteIntervalEncodingTree.hh>

Inheritance diagram for numeric::DietNode< T >:
Inheritance graph
[legend]

Classes

struct  split_tuple
 

Public Types

typedef T Value
 
typedef utility::pointer::shared_ptr< DietNode< Value > > DietNodeOP
 
typedef std::list< std::pair< Value, Value > > RangeList
 

Public Member Functions

 DietNode (Value value)
 
bool member (Value val) const
 Return whether a particular value is contained by any of the ranges in the subtree rooted at this node. More...
 
split_tuple split_max (DietNodeOP parent)
 Return the tuple of the largest value of the left child and the node that is the parent of that largest value. More...
 
split_tuple split_min (DietNodeOP parent)
 Return the tuple of the smallest value of the right child and the node that is the parent of that smallest value. More...
 
void join_left (Value new_lower)
 Used in insert( val ) where val + 1 == lower_; this may reorder nodes in the tree. More...
 
void join_right (Value new_upper)
 
void insert (Value new_val)
 
int size () const
 
void inorder_range_list (RangeList &ranges) const
 
bool correct (RangeList &ranges) const
 
- Public Member Functions inherited from utility::VirtualBase
 VirtualBase ()=default
 Default constructor. More...
 
virtual ~VirtualBase ()=default
 The virtual destructor is one of the main reasons for the VirtualBase class. More...
 
 VirtualBase (VirtualBase const &)=default
 
 VirtualBase (VirtualBase &&)=default
 
VirtualBaseoperator= (VirtualBase const &)=default
 
VirtualBaseoperator= (VirtualBase &&)=default
 

Private Attributes

Value lower_
 
Value upper_
 
DietNodeOP left_
 
DietNodeOP right_
 

Member Typedef Documentation

◆ DietNodeOP

template<class T >
typedef utility::pointer::shared_ptr< DietNode< Value > > numeric::DietNode< T >::DietNodeOP

◆ RangeList

template<class T >
typedef std::list< std::pair< Value, Value > > numeric::DietNode< T >::RangeList

◆ Value

template<class T >
typedef T numeric::DietNode< T >::Value

Constructor & Destructor Documentation

◆ DietNode()

template<class T >
numeric::DietNode< T >::DietNode ( Value  value)
inline

Member Function Documentation

◆ correct()

template<class T >
bool numeric::DietNode< T >::correct ( RangeList ranges) const
inline

◆ inorder_range_list()

template<class T >
void numeric::DietNode< T >::inorder_range_list ( RangeList ranges) const
inline

◆ insert()

template<class T >
void numeric::DietNode< T >::insert ( Value  new_val)
inline

◆ join_left()

template<class T >
void numeric::DietNode< T >::join_left ( Value  new_lower)
inline

◆ join_right()

template<class T >
void numeric::DietNode< T >::join_right ( Value  new_upper)
inline

◆ member()

template<class T >
bool numeric::DietNode< T >::member ( Value  val) const
inline

Return whether a particular value is contained by any of the ranges in the subtree rooted at this node.

References numeric::DietNode< T >::left_, numeric::DietNode< T >::lower_, numeric::DietNode< T >::right_, and numeric::DietNode< T >::upper_.

◆ size()

template<class T >
int numeric::DietNode< T >::size ( ) const
inline

◆ split_max()

template<class T >
split_tuple numeric::DietNode< T >::split_max ( DietNodeOP  parent)
inline

Return the tuple of the largest value of the left child and the node that is the parent of that largest value.

References numeric::DietNode< T >::right_, and numeric::DietNode< T >::upper_.

◆ split_min()

template<class T >
split_tuple numeric::DietNode< T >::split_min ( DietNodeOP  parent)
inline

Return the tuple of the smallest value of the right child and the node that is the parent of that smallest value.

References numeric::DietNode< T >::left_, and numeric::DietNode< T >::lower_.

Member Data Documentation

◆ left_

template<class T >
DietNodeOP numeric::DietNode< T >::left_
private

◆ lower_

template<class T >
Value numeric::DietNode< T >::lower_
private

◆ right_

template<class T >
DietNodeOP numeric::DietNode< T >::right_
private

◆ upper_

template<class T >
Value numeric::DietNode< T >::upper_
private

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