ARB
Classes | Macros | Enumerations | Functions
TreeNode.h File Reference
#include "arbdbt.h"
#include <algorithm>
Include dependency graph for TreeNode.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TreeRoot
 
struct  TreeNode
 
struct  TreeNode::multifurc_limits
 
struct  SimpleRoot
 
class  FINAL_TYPE< SEQTYPE >
 xml element More...
 
class  ARB_edge
 

Macros

#define rt_assert(cond)   arb_assert(cond)
 
#define DEFINE_READ_ACCESSORS(TYPE, ACCESS, MEMBER)
 
#define DEFINE_TREE_ROOT_ACCESSORS(RootType, TreeType)   DEFINE_DOWNCAST_ACCESSORS(TreeType, get_root_node, TreeRoot::get_root_node())
 
#define DEFINE_TREE_RELATIVES_ACCESSORS(TreeType)
 
#define DEFINE_TREE_ACCESSORS(RootType, TreeType)
 
#define ASSERT_VALID_TREE(tree)
 
#define ASSERT_VALID_TREE_OR_NULL(tree)
 
#define TEST_EXPECT_VALID_TREE(tree)
 
#define TEST_EXPECT_VALID_TREE_OR_NULL(tree)
 
#define TEST_EXPECT_VALID_TREE__BROKEN(tree)
 
#define TEST_EXPECT_VALID_TREE_OR_NULL__BROKEN(tree)
 

Enumerations

enum  TreeOrder {
  ORDER_BIG_DOWN = 1, ORDER_BIG_TO_EDGE = 2, ORDER_BIG_TO_CENTER = 4, ORDER_ALTERNATING = 8,
  BIG_BRANCHES_TO_TOP = 0, BIG_BRANCHES_TO_BOTTOM = ORDER_BIG_DOWN, BIG_BRANCHES_TO_EDGE = ORDER_BIG_TO_EDGE, BIG_BRANCHES_TO_CENTER = ORDER_BIG_TO_CENTER,
  BIG_BRANCHES_ALTERNATING = ORDER_BIG_TO_CENTER|ORDER_ALTERNATING
}
 
enum  ARB_edge_type { EDGE_TO_ROOT, EDGE_TO_LEAF, ROOT_EDGE }
 

Functions

 MARK_NONFINAL_METHOD (TreeRoot, change_root,(TreeNode *, TreeNode *))
 
GBT_RemarkType parse_remark (const char *remark, double &bootstrap)
 
 MARK_NONFINAL_METHOD (TreeNode, swap_sons,())
 
 MARK_NONFINAL_METHOD (TreeNode, set_root,())
 
void destroy (TreeNode *that)
 
void destroy (TreeNode *that, TreeRoot *root)
 
ARB_edge parentEdge (TreeNode *son)
 
ARB_edge leafEdge (TreeNode *leaf)
 
ARB_edge rootEdge (TreeRoot *root)
 

Macro Definition Documentation

#define rt_assert (   cond)    arb_assert(cond)
#define DEFINE_READ_ACCESSORS (   TYPE,
  ACCESS,
  MEMBER 
)
Value:
TYPE ACCESS() { return MEMBER; } \
const TYPE ACCESS() const { return MEMBER; }
PT1_TYPE
Definition: probe_tree.h:185

Definition at line 49 of file TreeNode.h.

#define DEFINE_TREE_ROOT_ACCESSORS (   RootType,
  TreeType 
)    DEFINE_DOWNCAST_ACCESSORS(TreeType, get_root_node, TreeRoot::get_root_node())

Definition at line 569 of file TreeNode.h.

#define DEFINE_TREE_RELATIVES_ACCESSORS (   TreeType)
Value:
DEFINE_DOWNCAST_ACCESSORS(TreeType, get_leftson, leftson); \
DEFINE_DOWNCAST_ACCESSORS(TreeType, get_rightson, rightson); \
TreeType *findLeafNamed(const char *wantedName) { return DOWNCAST(TreeType*, TreeNode::findLeafNamed(wantedName)); }
#define DEFINE_DOWNCAST_ACCESSORS(CLASS, NAME, VALUE)
Definition: downcast.h:147
TreeNode * findLeafNamed(const char *wantedName)
Definition: TreeNode.cxx:274
const TreeNode * get_root_node() const
Definition: TreeNode.h:382
#define DOWNCAST(totype, expr)
Definition: downcast.h:141
POS_TREE1 * father
Definition: probe_tree.h:39
POS_TREE1 * get_father() const
Definition: probe_tree.h:49
TreeNode * get_brother()
Definition: TreeNode.h:394

Definition at line 572 of file TreeNode.h.

#define DEFINE_TREE_ACCESSORS (   RootType,
  TreeType 
)
Value:
#define DEFINE_DOWNCAST_ACCESSORS(CLASS, NAME, VALUE)
Definition: downcast.h:147
#define DEFINE_TREE_RELATIVES_ACCESSORS(TreeType)
Definition: TreeNode.h:572
TreeRoot * get_tree_root() const
Definition: TreeNode.h:380

Definition at line 580 of file TreeNode.h.

#define ASSERT_VALID_TREE (   tree)
#define ASSERT_VALID_TREE_OR_NULL (   tree)

Definition at line 607 of file TreeNode.h.

Referenced by AP_tree::REMOVE(), and AP_tree_root::remove_leafs().

#define TEST_EXPECT_VALID_TREE (   tree)

Definition at line 619 of file TreeNode.h.

#define TEST_EXPECT_VALID_TREE_OR_NULL (   tree)

Definition at line 620 of file TreeNode.h.

#define TEST_EXPECT_VALID_TREE__BROKEN (   tree)

Definition at line 621 of file TreeNode.h.

#define TEST_EXPECT_VALID_TREE_OR_NULL__BROKEN (   tree)

Definition at line 622 of file TreeNode.h.

Enumeration Type Documentation

enum TreeOrder
Enumerator
ORDER_BIG_DOWN 
ORDER_BIG_TO_EDGE 
ORDER_BIG_TO_CENTER 
ORDER_ALTERNATING 
BIG_BRANCHES_TO_TOP 
BIG_BRANCHES_TO_BOTTOM 
BIG_BRANCHES_TO_EDGE 
BIG_BRANCHES_TO_CENTER 
BIG_BRANCHES_ALTERNATING 

Definition at line 35 of file TreeNode.h.

Enumerator
EDGE_TO_ROOT 
EDGE_TO_LEAF 
ROOT_EDGE 

Definition at line 657 of file TreeNode.h.

Function Documentation

MARK_NONFINAL_METHOD ( TreeRoot  ,
change_root  ,
(TreeNode *, TreeNode *)   
)
GBT_RemarkType parse_remark ( const char remark,
double &  bootstrap 
)
inline

analyse 'remark' and return GBT_RemarkType. If result is REMARK_BOOTSTRAP, 'bootstrap' contains the bootstrap value

Definition at line 117 of file TreeNode.h.

References NULp, REMARK_BOOTSTRAP, REMARK_NONE, and REMARK_OTHER.

Referenced by BootstrapConfig::display_remark(), and TreeNode::parse_bootstrap().

MARK_NONFINAL_METHOD ( TreeNode  ,
swap_sons  ,
()   
)
MARK_NONFINAL_METHOD ( TreeNode  ,
set_root  ,
()   
)
void destroy ( TreeNode that)
inline
void destroy ( TreeNode that,
TreeRoot root 
)
inline

Definition at line 562 of file TreeNode.h.

References TreeNode::destroy().

ARB_edge parentEdge ( TreeNode son)
inline

returns edge to father (or to brother for sons of root). Cannot be called with root-node (but can be called with each end of any ARB_edge)

Definition at line 842 of file TreeNode.h.

References EDGE_TO_ROOT, TreeNode::get_brother(), TreeNode::is_root_node(), ROOT_EDGE, and rt_assert.

Referenced by TreeNode::LengthCollector::eliminate_parent_edge(), TreeNode::LengthCollector::independent_distribution(), leafEdge(), and TreeNode::multifurcate().

ARB_edge leafEdge ( TreeNode leaf)
inline

Definition at line 852 of file TreeNode.h.

References ARB_edge::inverse(), TreeNode::is_leaf(), parentEdge(), and rt_assert.

ARB_edge rootEdge ( TreeRoot root)
inline