HLIBpro  2.3.1
Public Member Functions | List of all members
TCluster Class Reference

Represents a node in a cluster tree with an arbitrary number of sons. More...

#include <TCluster.hh>

Inheritance diagram for TCluster:
TIndexSet TTypeInfo TGeomCluster

Public Member Functions

 TCluster ()
 construct node with empty index set
 
 TCluster (const TIndexSet &is)
 construct node with index set is
 
 TCluster (const idx_t first_idx, const idx_t last_idx)
 construct node with index set [first_idx, last_idx]
 
virtual ~TCluster ()
 dtor
 
bool is_domain () const
 return true if node is domain cluster
 
void set_domain (const bool b)
 set domain status of node
 
virtual size_t nsons () const
 return number of sons
 
virtual void set_nsons (const size_t n)
 set number of sons
 
virtual TClusterson (const size_t i)
 return i'th son
 
virtual const TClusterson (const size_t i) const
 return i'th son
 
virtual void set_son (const size_t i, TCluster *son)
 set i'th son
 
virtual void add_son (TCluster *son, const bool inc_nsons=false)
 
virtual void clear_sons ()
 remove references to sons, no deletion
 
virtual bool is_leaf () const
 return true if node is leaf
 
virtual size_t nnodes () const
 return no of nodes
 
virtual size_t depth () const
 return depth of tree
 
virtual void collect_leaves (std::list< TCluster * > &leaves, const int depth=-1, const int level=0) const
 collect leaves (or nodes with depth depth) in list
 
virtual TClustercreate () const
 return object of same type
 
virtual TClustercopy () const
 return copy of node/subtree
 
virtual typeid_t type () const
 return type ID of object
 
virtual void print (const uint ofs=0) const
 stream output
 
virtual size_t byte_size () const
 return size in bytes used by this object
 
- Public Member Functions inherited from TIndexSet
 TIndexSet () noexcept
 construct empty index set
 
 TIndexSet (const size_t n) noexcept
 construct indexset if size n
 
 TIndexSet (const idx_t afirst, const idx_t alast) noexcept
 construct indexset by first and last index
 
 TIndexSet (const TIndexSet &is) noexcept
 copy constructor
 
idx_t first () const noexcept
 return first index in set
 
idx_t last () const noexcept
 return last index in set
 
size_t size () const noexcept
 return last index in set
 
void set_first_last (const idx_t afirst, const idx_t alast) noexcept
 set indexset by first and last index
 
void set_first_size (const idx_t afirstf, const size_t asize) noexcept
 set indexset by first and size
 
bool is_in (const idx_t idx) const noexcept
 return true if given index is part of indexset and false otherwise
 
bool is_sub (const TIndexSet &is) const noexcept
 return true if given indexset is subset
 
TIndexSetoperator= (const TIndexSet &is) noexcept
 copy operator
 
bool operator== (const TIndexSet &is) const noexcept
 equality operator
 
bool operator!= (const TIndexSet &is) const noexcept
 inequality operator
 
bool is_strictly_left_of (const TIndexSet &is) const noexcept
 this is strictly left of is iff ∀ i ∈ this, j ∈ is : i < j
 
bool is_left_or_equal_to (const TIndexSet &is) const noexcept
 this is left or equal to is iff this ∖ is < is
 
bool is_strictly_right_of (const TIndexSet &is) const noexcept
 this is strictly right of is iff ∀ i ∈ this, j ∈ is : i > j
 
bool is_right_or_equal_to (const TIndexSet &is) const noexcept
 this is right or equal to is iff this ∖ is > is
 
std::string to_string () const
 string output
 
size_t byte_size () const
 return size in bytes used by this object
 
- Public Member Functions inherited from TTypeInfo
virtual bool is_type (const typeid_t t) const
 return true if local object is of given type ID t
 
virtual std::string typestr () const
 return string representation of type
 

Detailed Description

Member Function Documentation

virtual void add_son ( TCluster son,
const bool  inc_nsons = false 
)
virtual

add a son (gets first unused slot); if inc_nsons is true, the number of sons will be increased, if no free slot is available