49 #ifndef WHTREEPROCESSER_H
50 #define WHTREEPROCESSER_H
104 std::pair< size_t, size_t >
pruneTree(
float condition,
size_t safeSize,
const HTPROC_MODE pruneType );
112 std::pair< size_t, size_t >
pruneRandom(
const size_t numberPruned,
unsigned int seed = 0 );
121 size_t collapseTree(
const dist_t flatGap,
const dist_t distLevelLimit,
const bool keepBaseNodes );
147 size_t collapseBranch(
const dist_t flatGap,
const dist_t distLevelLimit,
size_t root,
const bool keepBaseNodes );
155 size_t flattenSelection(
const std::list< size_t > selection,
const bool keepBaseNodes );
163 size_t flattenSelection(
const std::vector< size_t > &selection,
const bool keepBaseNodes );
171 size_t flattenSelection(
const std::vector< nodeID_t > &selection,
const bool keepBaseNodes );
178 std::pair< size_t, size_t >
pruneSelection(
const std::vector< size_t > &selection );
185 std::pair< size_t, size_t >
pruneSelection(
const std::vector< nodeID_t > &selection );
191 void flagSelection(
const std::vector< size_t > &selection );
197 void flagSelection(
const std::vector< nodeID_t > &selection );
203 void flagLeaves(
const std::vector< size_t > &selection );
209 void coarseTree(
const unsigned int coarseRatio );
241 size_t debinarize(
const bool keepBaseNodes );
265 size_t flattenBranch(
size_t root,
const bool keepBaseNodes );
273 void collapseNode(
const size_t thisNodeID,
const dist_t coefficient, HTPROC_COLLAPSE collapseMode = HTPR_C_CONSTANT );
281 void collapseNode(
const nodeID_t &thisNodeID,
const dist_t coefficient, HTPROC_COLLAPSE collapseMode = HTPR_C_CONSTANT );
this class implements methods for dendrogram processing, such as pruning, node collapsing and decimat...
std::pair< size_t, size_t > pruneRandom(const size_t numberPruned, unsigned int seed=0)
Prunes the tree from randomly chosen leaves.
WHtree & m_tree
tree object
void forceMonotonicityDown()
calls on private WHtree member to eliminate non monotonic steps in the tree top-down,...
size_t debinarize(const bool keepBaseNodes)
calls on private WHtree member to merge nodes joining binary at the same level into non-binary struct...
void flagSelection(const std::vector< size_t > &selection)
set flags for pruning all of the subtrees indicated (using only non-leaf node ID)
size_t collapseTreeLinear(const dist_t coefficient, const bool keepBaseNodes)
Collapses the nodes of the tree that have branch lenghts smoller than the distance level multiplied b...
size_t collapseTreeSquare(const dist_t coefficient, const bool keepBaseNodes)
Collapses the nodes of the tree that have branch lenghts smoller than the squared distance level mult...
size_t baseNodes2Leaves()
converts the base nodes into leaves, pruning out all excess leaves and information
size_t flattenSelection(const std::list< size_t > selection, const bool keepBaseNodes)
Collapses all the nodes of the subtrees indicated (using only non-leaf node ID)
size_t collapseBranch(const dist_t flatGap, const dist_t distLevelLimit, size_t root, const bool keepBaseNodes)
Collapses the nodes of the subtree that have branch lenghts equal or lower to the one indicated.
~WHtreeProcesser()
Destructor.
void flagLeaves(const std::vector< size_t > &selection)
set flags for pruning all of the leaves indicated
size_t collapseTree(const dist_t flatGap, const dist_t distLevelLimit, const bool keepBaseNodes)
Collapses the nodes of the tree that have branch lenghts equal or lower to the one indicated.
void forceMonotonicityUp()
calls on private WHtree member to eliminate non monotonic steps in the tree bottom-up,...
void coarseTree(const unsigned int coarseRatio)
Reduces the tree grid size by the ratio specified (as if it had been obtained from an image of lower ...
WHtreeProcesser(WHtree *const tree)
Constructor.
size_t flattenBranch(size_t root, const bool keepBaseNodes)
Collapses all the nodes of the subtree.
void collapseNode(const size_t thisNodeID, const dist_t coefficient, HTPROC_COLLAPSE collapseMode=HTPR_C_CONSTANT)
eliminates branchings in the tree, raising them to the parent level
std::pair< size_t, size_t > pruneSelection(const std::vector< size_t > &selection)
Prunes all of the subtrees indicated (using only non-leaf node ID)
std::pair< size_t, size_t > pruneTree(float condition, size_t safeSize, const HTPROC_MODE pruneType)
Prunes the tree according to the options specified.
void forceMonotonicity(double errorMult=1)
calls on private WHtree member to eliminate non monotonic steps in the tree while keeping as much inf...
this class implements a hierarchical tree and provides functions for creation, partitioning,...