59 #include <boost/format.hpp>
63 typedef std::pair<bool, size_t> nodeID_t;
75 explicit WHnode( nodeID_t idInit );
85 WHnode( nodeID_t idInit, std::vector<nodeID_t>childrenInit,
size_t nodeSizeInit, dist_t distanceLevelInit,
size_t hLevelInit );
120 size_t getID()
const;
162 void setID(
const nodeID_t newID );
174 void setSize(
const size_t newSize );
198 void setFlag(
const bool newFlag );
286 std::ostream& operator <<( std::ostream& os,
const WHnode&
object );
this class implements a hierarchical tree node with several relevant attributes
size_t getSize() const
returns number of elements contained by the node
size_t m_hLevel
level in the hierarchy (max number of nodes until reaching a leaf)
WHnode(nodeID_t idInit)
Constructor.
void setParent(const nodeID_t newDad)
sets the parent id field to the specified value
dist_t m_distanceLevel
distance level where the node was created
std::string printJointData() const
prints out a string with the node join data, (reduced version of the node data)
nodeID_t m_parent
parent node ID
bool isFlagged() const
returns true if object is flagged for pruning
void setChildren(std::vector< nodeID_t > newKids)
sets the children vector to the input values
void setHLevel(const size_t newLevel)
sets the hierarchical level field to the specified value
bool isLeaf() const
returns true if object is a leaf
std::vector< nodeID_t > m_children
chlidren nodes IDs
size_t getHLevel() const
returns maximum number of nodes between the node and a leaf element
void setSize(const size_t newSize)
sets the size field to the specified value
size_t m_nodeSize
number of leaves contained on the node
bool isRoot() const
returns true if object is the root of the tree
size_t getID() const
returns node/leaf ID
std::string printAllData() const
prints out a string with the node data, in order to implement the operator <<
void setID(const nodeID_t newID)
sets the ID field to the specified value
void setFlag(const bool newFlag)
sets the prune flag to the indicated value
dist_t getDistLevel() const
returns distance level at which the element was formed
void setDistLevel(const dist_t newLevel)
sets the distance level field to the specified value
bool isNode() const
returns true if object is a node
nodeID_t getFullID() const
returns full ID
nodeID_t getParent() const
returns parent ID
std::vector< nodeID_t > getChildren() const
returns a vector with the ids of the children of that node