HLIBpro
1.2
|
Represents a node in a cluster tree with an arbitrary number of sons. More...
#include <TCluster.hh>
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 TCluster * | son (const size_t i) |
return i'th son | |
virtual const TCluster * | son (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 TCluster * | create () const |
return object of same type | |
virtual TCluster * | copy () 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 () | |
construct empty index set | |
TIndexSet (const size_t n) | |
construct indexset if size n | |
TIndexSet (const idx_t afirst, const idx_t alast) | |
construct indexset by first and last index | |
TIndexSet (const TIndexSet &is) | |
copy constructor | |
idx_t | first () const |
return first index in set | |
idx_t | last () const |
return last index in set | |
size_t | size () const |
return last index in set | |
void | set_first_last (const idx_t afirst, const idx_t alast) |
set indexset by first and last index | |
void | set_first_size (const idx_t afirstf, const size_t asize) |
set indexset by first and size | |
bool | is_in (const idx_t idx) const |
return true if given index is part of indexset and false otherwise | |
bool | is_sub (const TIndexSet &is) const |
return true if given indexset is subset | |
TIndexSet & | operator= (const TIndexSet &is) |
copy operator | |
bool | operator== (const TIndexSet &is) const |
equality operator | |
bool | operator!= (const TIndexSet &is) const |
inequality operator | |
bool | is_strictly_left_of (const TIndexSet &is) const |
this is strictly left of is iff ∀ i ∈ this, j ∈ is : i < j | |
bool | is_left_or_equal_to (const TIndexSet &is) const |
this is left or equal to is iff this ∖ is < is | |
bool | is_strictly_right_of (const TIndexSet &is) const |
this is strictly right of is iff ∀ i ∈ this, j ∈ is : i > j | |
bool | is_right_or_equal_to (const TIndexSet &is) const |
this is right or equal to is iff this ∖ is > is | |
String | to_string () const |
string output | |
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 String | typestr () const |
return string representation of type |
|
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