OpenWalnut  1.5.0dev
Public Member Functions | Private Attributes | List of all members
WHnode Class Reference

this class implements a hierarchical tree node with several relevant attributes More...

#include <WHnode.h>

+ Collaboration diagram for WHnode:

Public Member Functions

 WHnode (nodeID_t idInit)
 Constructor. More...
 
 WHnode (nodeID_t idInit, std::vector< nodeID_t >childrenInit, size_t nodeSizeInit, dist_t distanceLevelInit, size_t hLevelInit)
 Constructor. More...
 
 ~WHnode ()
 Destructor. More...
 
bool isNode () const
 returns true if object is a node More...
 
bool isLeaf () const
 returns true if object is a leaf More...
 
bool isRoot () const
 returns true if object is the root of the tree More...
 
bool isFlagged () const
 returns true if object is flagged for pruning More...
 
size_t getID () const
 returns node/leaf ID More...
 
nodeID_t getFullID () const
 returns full ID More...
 
nodeID_t getParent () const
 returns parent ID More...
 
size_t getSize () const
 returns number of elements contained by the node More...
 
dist_t getDistLevel () const
 returns distance level at which the element was formed More...
 
size_t getHLevel () const
 returns maximum number of nodes between the node and a leaf element More...
 
std::vector< nodeID_t > getChildren () const
 returns a vector with the ids of the children of that node More...
 
void setID (const nodeID_t newID)
 sets the ID field to the specified value More...
 
void setParent (const nodeID_t newDad)
 sets the parent id field to the specified value More...
 
void setSize (const size_t newSize)
 sets the size field to the specified value More...
 
void setHLevel (const size_t newLevel)
 sets the hierarchical level field to the specified value More...
 
void setDistLevel (const dist_t newLevel)
 sets the distance level field to the specified value More...
 
void setChildren (std::vector< nodeID_t > newKids)
 sets the children vector to the input values More...
 
void setFlag (const bool newFlag)
 sets the prune flag to the indicated value More...
 
std::string printAllData () const
 prints out a string with the node data, in order to implement the operator << More...
 
std::string printJointData () const
 prints out a string with the node join data, (reduced version of the node data) More...
 

Private Attributes

nodeID_t m_fullID
 node ID More...
 
nodeID_t m_parent
 parent node ID More...
 
std::vector< nodeID_t > m_children
 chlidren nodes IDs More...
 
size_t m_nodeSize
 number of leaves contained on the node More...
 
dist_t m_distanceLevel
 distance level where the node was created More...
 
size_t m_hLevel
 level in the hierarchy (max number of nodes until reaching a leaf) More...
 
bool m_flag
 flag bit More...
 

Detailed Description

this class implements a hierarchical tree node with several relevant attributes

Definition at line 68 of file WHnode.h.

Constructor & Destructor Documentation

◆ WHnode() [1/2]

WHnode::WHnode ( nodeID_t  idInit)
explicit

Constructor.

Parameters
idInitnode id initializer

Definition at line 61 of file WHnode.cpp.

◆ WHnode() [2/2]

WHnode::WHnode ( nodeID_t  idInit,
std::vector< nodeID_t >  childrenInit,
size_t  nodeSizeInit,
dist_t  distanceLevelInit,
size_t  hLevelInit 
)

Constructor.

Parameters
idInitnode id initializer
childrenInitchildren id vector initializer
nodeSizeInitnode size initializer
distanceLevelInitnode distance level initializer
hLevelInitnode hierarchical level initializer

Definition at line 66 of file WHnode.cpp.

◆ ~WHnode()

WHnode::~WHnode ( )

Destructor.

Definition at line 72 of file WHnode.cpp.

Member Function Documentation

◆ getChildren()

std::vector< nodeID_t > WHnode::getChildren ( ) const
inline

◆ getDistLevel()

dist_t WHnode::getDistLevel ( ) const
inline

◆ getFullID()

nodeID_t WHnode::getFullID ( ) const
inline

returns full ID

Returns
full id indicator

Definition at line 247 of file WHnode.h.

References m_fullID.

Referenced by WHtreeProcesser::collapseNode(), WHtree::getRoute2Root(), WHtreePartition::partitionClassic(), WHtreePartition::partitionOptimized(), WHtreePartition::partitionSharp(), and WHtreePartition::partitionSmooth().

+ Here is the caller graph for this function:

◆ getHLevel()

size_t WHnode::getHLevel ( ) const
inline

◆ getID()

size_t WHnode::getID ( ) const
inline

◆ getParent()

nodeID_t WHnode::getParent ( ) const
inline

◆ getSize()

size_t WHnode::getSize ( ) const
inline

◆ isFlagged()

bool WHnode::isFlagged ( ) const
inline

returns true if object is flagged for pruning

Returns
flag indicator

Definition at line 237 of file WHnode.h.

References m_flag.

Referenced by WHtree::cleanup(), WHtreeProcesser::pruneRandom(), and WHtreeProcesser::pruneTree().

+ Here is the caller graph for this function:

◆ isLeaf()

bool WHnode::isLeaf ( ) const
inline

returns true if object is a leaf

Returns
leaf indicator

Definition at line 232 of file WHnode.h.

References m_fullID.

Referenced by WHtree::cleanup(), WNonBinDendroGeode::layout(), WHtreePartition::partitionClassic(), and WHtreePartition::partitionSharp().

+ Here is the caller graph for this function:

◆ isNode()

bool WHnode::isNode ( ) const
inline

returns true if object is a node

Returns
node indicator

Definition at line 227 of file WHnode.h.

References m_fullID.

Referenced by WHtreeProcesser::collapseNode(), WNonBinDendroGeode::findClickedCluster(), and WNonBinDendroGeode::layout().

+ Here is the caller graph for this function:

◆ isRoot()

bool WHnode::isRoot ( ) const

returns true if object is the root of the tree

Returns
root indicator

Definition at line 77 of file WHnode.cpp.

References m_fullID, and m_parent.

Referenced by WMHierchClustDisplay::assignColorHierch(), WHtree::cleanup(), WHtree::forceMonotonicity(), WHtree::getBaseNodes(), WHtree::getRoute2Root(), WHtreePartition::partitionClassic(), and WHtreePartition::partitionSmooth().

+ Here is the caller graph for this function:

◆ printAllData()

std::string WHnode::printAllData ( ) const

prints out a string with the node data, in order to implement the operator <<

Returns
a string with the node information

Definition at line 117 of file WHnode.cpp.

References m_children, m_distanceLevel, m_flag, m_fullID, m_hLevel, m_nodeSize, m_parent, and string_utils::toString().

Referenced by WMHierchClustDisplay::initProperties().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printJointData()

std::string WHnode::printJointData ( ) const

prints out a string with the node join data, (reduced version of the node data)

Returns
a string with the node join information

Definition at line 142 of file WHnode.cpp.

References m_children, m_distanceLevel, and string_utils::toString().

+ Here is the call graph for this function:

◆ setChildren()

void WHnode::setChildren ( std::vector< nodeID_t >  newKids)

sets the children vector to the input values

Parameters
newKidsvector with the new children ids

Definition at line 107 of file WHnode.cpp.

References m_children.

Referenced by WHtree::cleanup().

+ Here is the caller graph for this function:

◆ setDistLevel()

void WHnode::setDistLevel ( const dist_t  newLevel)

sets the distance level field to the specified value

Parameters
newLevelnew distance level

Definition at line 102 of file WHnode.cpp.

References m_distanceLevel.

Referenced by WHtreeProcesser::collapseNode(), WHtree::forceMonotonicity(), WHtree::forceMonotonicityDown(), and WHtree::forceMonotonicityUp().

+ Here is the caller graph for this function:

◆ setFlag()

void WHnode::setFlag ( const bool  newFlag)

sets the prune flag to the indicated value

Parameters
newFlagnew value for the prune flag

Definition at line 112 of file WHnode.cpp.

References m_flag.

Referenced by WHtreeProcesser::baseNodes2Leaves(), WHtreeProcesser::coarseTree(), WHtreeProcesser::flagLeaves(), WHtreeProcesser::flattenSelection(), WHtreeProcesser::pruneRandom(), and WHtreeProcesser::pruneTree().

+ Here is the caller graph for this function:

◆ setHLevel()

void WHnode::setHLevel ( const size_t  newLevel)

sets the hierarchical level field to the specified value

Parameters
newLevelnew hierarchical level

Definition at line 97 of file WHnode.cpp.

References m_hLevel.

Referenced by WHtree::cleanup(), and WHtree::debinarize().

+ Here is the caller graph for this function:

◆ setID()

void WHnode::setID ( const nodeID_t  newID)

sets the ID field to the specified value

Parameters
newIDnew ID

Definition at line 82 of file WHnode.cpp.

References m_fullID.

◆ setParent()

void WHnode::setParent ( const nodeID_t  newDad)

sets the parent id field to the specified value

Parameters
newDadnew parent id

Definition at line 87 of file WHnode.cpp.

References m_parent.

Referenced by WHtree::debinarize(), and WHtree::readTree().

+ Here is the caller graph for this function:

◆ setSize()

void WHnode::setSize ( const size_t  newSize)

sets the size field to the specified value

Parameters
newSizenew size

Definition at line 92 of file WHnode.cpp.

References m_nodeSize.

Referenced by WHtree::cleanup().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_children

std::vector<nodeID_t> WHnode::m_children
private

chlidren nodes IDs

Definition at line 217 of file WHnode.h.

Referenced by getChildren(), printAllData(), printJointData(), and setChildren().

◆ m_distanceLevel

dist_t WHnode::m_distanceLevel
private

distance level where the node was created

Definition at line 219 of file WHnode.h.

Referenced by getDistLevel(), printAllData(), printJointData(), and setDistLevel().

◆ m_flag

bool WHnode::m_flag
private

flag bit

Definition at line 221 of file WHnode.h.

Referenced by isFlagged(), printAllData(), and setFlag().

◆ m_fullID

nodeID_t WHnode::m_fullID
private

node ID

Definition at line 215 of file WHnode.h.

Referenced by getFullID(), getID(), isLeaf(), isNode(), isRoot(), printAllData(), and setID().

◆ m_hLevel

size_t WHnode::m_hLevel
private

level in the hierarchy (max number of nodes until reaching a leaf)

Definition at line 220 of file WHnode.h.

Referenced by getHLevel(), printAllData(), and setHLevel().

◆ m_nodeSize

size_t WHnode::m_nodeSize
private

number of leaves contained on the node

Definition at line 218 of file WHnode.h.

Referenced by getSize(), printAllData(), and setSize().

◆ m_parent

nodeID_t WHnode::m_parent
private

parent node ID

Definition at line 216 of file WHnode.h.

Referenced by getParent(), isRoot(), printAllData(), and setParent().


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