OpenWalnut
1.5.0dev
|
this class implements a hierarchical tree node with several relevant attributes More...
#include <WHnode.h>
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... | |
this class implements a hierarchical tree node with several relevant attributes
|
explicit |
WHnode::WHnode | ( | nodeID_t | idInit, |
std::vector< nodeID_t > | childrenInit, | ||
size_t | nodeSizeInit, | ||
dist_t | distanceLevelInit, | ||
size_t | hLevelInit | ||
) |
Constructor.
idInit | node id initializer |
childrenInit | children id vector initializer |
nodeSizeInit | node size initializer |
distanceLevelInit | node distance level initializer |
hLevelInit | node hierarchical level initializer |
Definition at line 66 of file WHnode.cpp.
WHnode::~WHnode | ( | ) |
Destructor.
Definition at line 72 of file WHnode.cpp.
|
inline |
returns a vector with the ids of the children of that node
Definition at line 272 of file WHnode.h.
References m_children.
Referenced by WMHierchClustDisplay::assignColorHierch(), WHtree::check(), WHtree::cleanup(), WHtreeProcesser::collapseNode(), WMHierchClustDisplay::colorBranch(), WMHierchClustDisplay::colorBranchCustom(), WHtree::debinarize(), WNonBinDendroGeode::findClickedCluster(), WHtreeProcesser::flattenSelection(), WHtree::forceMonotonicity(), WHtree::forceMonotonicityDown(), WHtree::forceMonotonicityUp(), WMHierchClustDisplay::initializeColorsHdist(), WMHierchClustDisplay::initializeColorsSize(), WNonBinDendroGeode::layout(), WHtreePartition::level2granularity(), WHtreePartition::partitionClassic(), WHtreePartition::partitionSharp(), WHtreePartition::partitionSmooth(), WHtreeProcesser::pruneTree(), WHtreePartition::scanHozPartitions(), and WHtreePartition::scanOptimalPartitions().
|
inline |
returns distance level at which the element was formed
Definition at line 262 of file WHnode.h.
References m_distanceLevel.
Referenced by WHtreeProcesser::collapseBranch(), WHtreeProcesser::collapseNode(), WHtreeProcesser::collapseTree(), WNonBinDendroGeode::create(), WHtree::debinarize(), WHtreePartition::evalPartBranchDist(), WHtreePartition::evalPartBranchDistWeighted(), WHtreePartition::evalPartIntraDist(), WHtreePartition::evalPartIntraDistWeighted(), WHtreePartition::evalSSindex(), WNonBinDendroGeode::findClickedCluster(), WHtree::forceMonotonicity(), WHtree::forceMonotonicityDown(), WHtree::forceMonotonicityUp(), WHtree::getDistance(), WHtreePartition::getICDmatrix(), WHtree::getLeafDistance(), WMHierchClustDisplay::initProperties(), WNonBinDendroGeode::layout(), WMHierchClustDisplay::moduleMain(), WHtreePartition::partitionClassic(), WHtreePartition::partitionOptimized(), WHtreePartition::partitionSharp(), WHtreePartition::partitionSmooth(), WHtreeProcesser::pruneTree(), WHtreePartition::scanOptimalPartitions(), and WMHierchClustDisplay::updateWidgets().
|
inline |
returns full ID
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().
|
inline |
returns maximum number of nodes between the node and a leaf element
Definition at line 267 of file WHnode.h.
References m_hLevel.
Referenced by WMHierchClustDisplay::assignColorHierch(), WHtree::check(), WHtree::cleanup(), WMHierchClustDisplay::clusterSelection(), WMHierchClustDisplay::colorBranch(), WMHierchClustDisplay::colorBranchCustom(), WNonBinDendroGeode::create(), WNonBinDendroGeode::findClickedCluster(), WHtreeProcesser::flattenSelection(), WHtree::getBranching(), WHtree::getRoute2Root(), WMHierchClustDisplay::initializeColorsHdist(), WMHierchClustDisplay::initializeColorsSize(), WMHierchClustDisplay::initProperties(), WNonBinDendroGeode::layout(), WHtreePartition::level2granularity(), WMHierchClustDisplay::moduleMain(), WHtreePartition::partitionClassic(), WHtreePartition::partitionSharp(), WHtree::readTree(), and WMHierchClustDisplay::updateWidgets().
|
inline |
returns node/leaf ID
Definition at line 242 of file WHnode.h.
References m_fullID.
Referenced by WMHierchClustDisplay::addPartitions(), WHtree::cleanup(), WHtreeProcesser::collapseNode(), WHtreeProcesser::collapseTree(), WHtreeProcesser::collapseTreeLinear(), WHtreeProcesser::collapseTreeSquare(), WNonBinDendroGeode::create(), WNonBinDendroGeode::findClickedCluster(), WHtree::forceMonotonicity(), WHtree::getBaseNodes(), WMHierchClustDisplay::initProperties(), WNonBinDendroGeode::layout(), WMHierchClustDisplay::moduleMain(), WHtreePartition::partitionClassic(), WHtreePartition::partitionOptimized(), WHtreePartition::partitionSharp(), WHtreePartition::partitionSmooth(), WHtreePartition::scanHozPartitions(), WHtreePartition::scanOptimalPartitions(), WMHierchClustDisplay::updateColors(), WMHierchClustDisplay::updateWidgets(), and WMHierchClustDisplay::writePartition().
|
inline |
returns parent ID
Definition at line 252 of file WHnode.h.
References m_parent.
Referenced by WMHierchClustDisplay::assignColorHierch(), WHtree::check(), WHtree::cleanup(), WHtree::debinarize(), WHtreePartition::evalPartBranchDist(), WHtreePartition::evalPartBranchDistWeighted(), WHtreePartition::evalSSindex(), WHtree::forceMonotonicity(), WHtree::getBaseNodes(), WHtree::getCommonAncestor(), WHtree::getRoute2Root(), WHtreePartition::level2granularity(), and WHtreePartition::partitionSmooth().
|
inline |
returns number of elements contained by the node
Definition at line 257 of file WHnode.h.
References m_nodeSize.
Referenced by WHtree::check(), WHtree::cleanup(), WMHierchClustDisplay::clusterSelection(), WNonBinDendroGeode::create(), WHtreePartition::evalPartBranchDistWeighted(), WHtreePartition::evalPartClustSizeDiff(), WHtreePartition::evalPartInterDistWeighted(), WHtreePartition::evalPartIntraDistWeighted(), WHtreePartition::evalSSindex(), WNonBinDendroGeode::findClickedCluster(), WHtree::forceMonotonicity(), WNonBinDendroGeode::getClickedCluster(), WMHierchClustDisplay::initProperties(), WNonBinDendroGeode::layout(), WMHierchClustDisplay::moduleMain(), WHtreePartition::partitionClassic(), WHtreePartition::partitionOptimized(), WHtreeProcesser::pruneTree(), WHtree::readTree(), and WMHierchClustDisplay::updateWidgets().
|
inline |
returns true if object is flagged for pruning
Definition at line 237 of file WHnode.h.
References m_flag.
Referenced by WHtree::cleanup(), WHtreeProcesser::pruneRandom(), and WHtreeProcesser::pruneTree().
|
inline |
returns true if object is a leaf
Definition at line 232 of file WHnode.h.
References m_fullID.
Referenced by WHtree::cleanup(), WNonBinDendroGeode::layout(), WHtreePartition::partitionClassic(), and WHtreePartition::partitionSharp().
|
inline |
returns true if object is a node
Definition at line 227 of file WHnode.h.
References m_fullID.
Referenced by WHtreeProcesser::collapseNode(), WNonBinDendroGeode::findClickedCluster(), and WNonBinDendroGeode::layout().
bool WHnode::isRoot | ( | ) | const |
returns true if object is the root of the tree
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().
std::string WHnode::printAllData | ( | ) | const |
prints out a string with the node data, in order to implement the operator <<
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().
std::string WHnode::printJointData | ( | ) | const |
prints out a string with the node join data, (reduced version of the node data)
Definition at line 142 of file WHnode.cpp.
References m_children, m_distanceLevel, and string_utils::toString().
void WHnode::setChildren | ( | std::vector< nodeID_t > | newKids | ) |
sets the children vector to the input values
newKids | vector with the new children ids |
Definition at line 107 of file WHnode.cpp.
References m_children.
Referenced by WHtree::cleanup().
void WHnode::setDistLevel | ( | const dist_t | newLevel | ) |
sets the distance level field to the specified value
newLevel | new distance level |
Definition at line 102 of file WHnode.cpp.
References m_distanceLevel.
Referenced by WHtreeProcesser::collapseNode(), WHtree::forceMonotonicity(), WHtree::forceMonotonicityDown(), and WHtree::forceMonotonicityUp().
void WHnode::setFlag | ( | const bool | newFlag | ) |
sets the prune flag to the indicated value
newFlag | new 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().
void WHnode::setHLevel | ( | const size_t | newLevel | ) |
sets the hierarchical level field to the specified value
newLevel | new hierarchical level |
Definition at line 97 of file WHnode.cpp.
References m_hLevel.
Referenced by WHtree::cleanup(), and WHtree::debinarize().
void WHnode::setID | ( | const nodeID_t | newID | ) |
sets the ID field to the specified value
newID | new ID |
Definition at line 82 of file WHnode.cpp.
References m_fullID.
void WHnode::setParent | ( | const nodeID_t | newDad | ) |
sets the parent id field to the specified value
newDad | new parent id |
Definition at line 87 of file WHnode.cpp.
References m_parent.
Referenced by WHtree::debinarize(), and WHtree::readTree().
void WHnode::setSize | ( | const size_t | newSize | ) |
sets the size field to the specified value
newSize | new size |
Definition at line 92 of file WHnode.cpp.
References m_nodeSize.
Referenced by WHtree::cleanup().
|
private |
chlidren nodes IDs
Definition at line 217 of file WHnode.h.
Referenced by getChildren(), printAllData(), printJointData(), and setChildren().
|
private |
distance level where the node was created
Definition at line 219 of file WHnode.h.
Referenced by getDistLevel(), printAllData(), printJointData(), and setDistLevel().
|
private |
flag bit
Definition at line 221 of file WHnode.h.
Referenced by isFlagged(), printAllData(), and setFlag().
|
private |
node ID
Definition at line 215 of file WHnode.h.
Referenced by getFullID(), getID(), isLeaf(), isNode(), isRoot(), printAllData(), and setID().
|
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().
|
private |
number of leaves contained on the node
Definition at line 218 of file WHnode.h.
Referenced by getSize(), printAllData(), and setSize().
|
private |
parent node ID
Definition at line 216 of file WHnode.h.
Referenced by getParent(), isRoot(), printAllData(), and setParent().