NCBI C++ ToolKit
Classes | Functions
tree_algo.hpp File Reference

Tree algorithms. More...

#include <corelib/ncbi_tree.hpp>
+ Include dependency graph for tree_algo.hpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CTreeParentTraceFunc< TTreeNode, TTraceContainer >
 Functor to trace node pointers to root (TreeForEachParent) More...
 
class  CTreePrintFunc< TTreeNode, TConverter >
 Tree print functor used as a tree traversal payload. More...
 
class  CTreeIdToSetFunc< TTreeNode, TBackInsert >
 Functor to trace node pointers to root and create set of parents (TreeForEachParent) More...
 
class  CTreeSet2NodeListFunc< TTreeNode, TSet, TNodeList >
 Functor to convert tree to a nodelist by the set pattern. More...
 
class  CTreeNonRedundantSet< TNode, TSet, TNodeList >
 Class-algorithm to compute Non Redundant Set. More...
 
class  CTreeMinimalSet< TNode, TSet, TNodeList >
 Functor takes a single nodelist as an argument and tries to push that nodelist as high as it can. More...
 
class  CNodesToBitset< TNode, TSet, TNodeList >
 Utility to join to node lists according to a set of ids. More...
 
class  CTreeNodesAnd< TNode, TSet, TNodeList >
 Node list AND (set intersection) More...
 
class  CTreeNodesOr< TNode, TSet, TNodeList >
 Node list OR (set union) More...
 

Functions

template<class TTreeNode , class TCompFun >
bool TreeCompare (const TTreeNode &tree1, const TTreeNode &tree2, TCompFun func)
 Compare two trees using comparison functor where order of children matters. More...
 
template<class TTreeNode , class TFunc >
TFunc TreeForEachParent (const TTreeNode &tree_node, TFunc func, bool skip_self=false)
 Visit every parent of the specified node. More...
 
template<class TTreeNode , class TTraceContainer >
void TreeTraceToRoot (const TTreeNode &tree_node, TTraceContainer &trace)
 Trace from the specified node to to the tree root. More...
 
template<class TTreeNode >
void TreeReRoot (TTreeNode &new_root_node)
 Change tree root (tree rotation) More...
 
template<class TTreeNode >
const TTreeNode * TreeFindCommonParent (const TTreeNode &tree_node_a, const TTreeNode &tree_node_b)
 Check if two nodes have the same common root. More...
 
template<class TTreeNode , class TConverter >
void TreePrint (CNcbiOstream &os, const TTreeNode &tree_node, TConverter conv, bool print_ptr=false)
 Tree printing (use for debugging purposes) More...
 
template<class TPairTree , class TValue >
const TPairTree * PairTreeBackTraceNode (const TPairTree &tr, const TValue &search_id)
 Algorithm to to search for a node with specified id. More...
 
template<class TPairTree , class TPathList >
const TPairTree * PairTreeTraceNode (const TPairTree &tr, const TPathList &node_path)
 Algorithm to trace the pair tree and find specified leaf along the node path. More...
 
template<class TNodeListIt , class TBackInsert >
void TreeListToSet (TNodeListIt node_list_first, TNodeListIt node_list_last, TBackInsert back_ins)
 Convert list of node pointers to set of ids Input set is represented by input forward iterators Output set is a back insert iterator. More...
 
template<class TNodeList , class TBackInsert >
void TreeListToSet (const TNodeList &node_list, TBackInsert back_ins)
 Convert list of node pointers to set of ids. More...
 
template<class TNode , class TBackInsert >
void TreeMakeParentsSet (const TNode &tree_node, TBackInsert back_ins)
 Traverses all ancestors and add their ids to a set. More...
 
template<class TNode , class TBackInsert >
void TreeMakeSet (const TNode &tree_node, TBackInsert back_ins)
 Create set of all sub-nodes (recursively) More...
 
template<class TNode , class TBackInsert >
void TreeMakeSubNodesSet (const TNode &tree_node, TBackInsert back_ins)
 Create set of all immediate sub-nodes (one level down from the root) More...
 
template<class TNode , class TSet , class TNodeList >
void TreeSetToNodeList (const TNode &tree_node, const TSet &node_set, TNodeList &nlist)
 Convert set of node ids to list of nodes. More...
 

Detailed Description

Tree algorithms.

Definition in file tree_algo.hpp.

Modified on Sun Jun 23 05:19:14 2024 by modify_doxy.py rev. 669887