2 #include "tree_bones.hpp" 3 #include "treeiterator_bones.hpp" 6 template <
typename Data_Type>
9 this->current_node = tree->
POSTORDER.at(0);
10 this->pos_in_pruning_sequence = 0u;
17 template <
typename Data_Type>
20 return (this->tree)->offspring.at(this->current_node).begin();
24 template <
typename Data_Type>
27 return (this->tree)->offspring.at(this->current_node).end();
31 template <
typename Data_Type>
34 return (this->tree)->parents.at(this->current_node).begin();
38 template <
typename Data_Type>
41 return (this->tree)->parents.at(this->current_node).end();
48 template <
typename Data_Type>
51 if (++this->pos_in_pruning_sequence == this->tree->
POSTORDER.size()) {
52 --this->pos_in_pruning_sequence;
56 this->current_node = this->tree->
POSTORDER[this->pos_in_pruning_sequence];
61 template <
typename Data_Type>
64 if (this->pos_in_pruning_sequence == 0) {
68 this->current_node = this->tree->
POSTORDER[--this->pos_in_pruning_sequence];
73 template <
typename Data_Type>
76 template <
typename Data_Type>
79 template <
typename Data_Type>
82 this->pos_in_pruning_sequence = this->tree->
POSTORDER.size() - 1u;
86 template <
typename Data_Type>
88 this->current_node = this->tree->
POSTORDER[0u];
89 this->pos_in_pruning_sequence = 0;
93 template <
typename Data_Type>
98 template <
typename Data_Type>
100 return this->tree->
n_parents(this->current_node);
103 template <
typename Data_Type>
105 return this->tree->
parents[current_node].size() == 0u;
108 template <
typename Data_Type>
110 return this->tree->
offspring[current_node].size() == 0u;
113 template <
typename Data_Type>
120 template <
typename Data_Type>
v_uint POSTORDER
Postorder sequence.
Definition: tree_bones.hpp:67
vv_uint offspring
Each nodes' offspring.
Definition: tree_bones.hpp:49
v_uint::const_iterator end_par() const
End of parents const_iterator on the current node.
Definition: treeiterator_meat.hpp:39
int n_parents(uint i) const
Return the number of parents a given node has.
Definition: tree_meat.hpp:488
int down()
Sets the current_node to the previous value as specified in Tree::POSTORDER.
Definition: treeiterator_meat.hpp:62
v_uint::const_iterator begin_off() const
Begin of offpring const_iterator on the current node.
Definition: treeiterator_meat.hpp:18
bool is_root() const
Check whether the current node is root.
Definition: treeiterator_meat.hpp:104
int n_offspring() const
Return the number of offsprings the current node has.
Definition: treeiterator_meat.hpp:94
Tree class.
Definition: tree_bones.hpp:36
vv_uint parents
Each nodes' parents.
Definition: tree_bones.hpp:47
int n_offspring(uint i) const
Return the number of offsprings a given node has.
Definition: tree_meat.hpp:479
bool is_tip() const
Checks whether the current node is a tip (leaf) or not.
Definition: treeiterator_meat.hpp:109
int up()
Sets the current_node to the next value as specified in Tree::POSTORDER.
Definition: treeiterator_meat.hpp:49
Definition: treeiterator_bones.hpp:12
int n_parents() const
Return the number of parents the current node has.
Definition: treeiterator_meat.hpp:99
v_uint::const_iterator end_off() const
End of offpring const_iterator on the current node.
Definition: treeiterator_meat.hpp:25
v_uint::const_iterator begin_par() const
Begin of parents const_iterator on the current node.
Definition: treeiterator_meat.hpp:32