#include <quetzal/coalescence/container/Network.hpp>
template<class CellT>
class quetzal::coalescence::container::Network< CellT >
Data structure for representing phylogenetic network topologies where each node contains a data field.
- Template Parameters
-
CellT | Cell type, ie the value of the node. The requirements that are imposed on CellT depend on the actual operations performed on Network<CellT>. |
- See also
- Standardization of the Phylogenetic Network concept: https://doi.org/10.1186/1471-2105-9-532
|
| Network () |
| Default constructor.
|
|
| Network (const CellT &cell) |
| Constructor with data copy.
|
|
| Network (CellT &&cell) noexcept |
| Constructor with data move.
|
|
unsigned int | nb_children () const |
| Returns the number of children.
|
|
unsigned int | nb_parents () const |
| Returns the number of parents.
|
|
const CellT & | cell () const |
| Cell accessor.
|
|
CellT & | cell () |
| Cell accessor.
|
|
Network< CellT > & | add_child (CellT &&cell) noexcept |
| Add a subnetwork to the children list of the network, initialize the network.
|
|
Network< CellT > & | add_child (Network< CellT > &subnetwork) |
| Add a sub-network to the children list of the network.
|
|
Network< CellT > & | add_parent (Network< CellT > &parent) |
| Add a itself as a sub-network in the list of the parent children.
|
|
bool | has_parent () const |
| Checks whether the network has a parent.
|
|
bool | has_children () const |
| Checks whether the network has one or more child.
|
|
template<typename UnaryOperation > |
void | visit_cell_by_pre_order_DFS (UnaryOperation op) const |
| Applies a function object to the data member of each node encountered in a preorder depth first search algorithm.
|
|
template<class UnaryOperation > |
void | visit_by_pre_order_DFS (UnaryOperation op) |
| Applies a function object to each node encountered in a depth first search algorithm.
|
|
template<typename Op1 , typename Op2 , typename Op3 > |
void | visit_by_generic_DFS (Op1 preorder, Op2 inorder, Op3 postorder) |
| Applies a function object to each node encountered in a depth first search algorithm.
|
|
template<typename UnaryOperation > |
void | visit_leaves_cells_by_DFS (UnaryOperation op) const |
| Applies a function object to the data member of each leave encountered along a depth first search algorithm.
|
|
◆ Network() [1/3]
◆ Network() [2/3]
Constructor with data copy.
- Parameters
-
cell | the value of the network cell |
◆ Network() [3/3]
Constructor with data move.
- Parameters
-
cell | the value of the network cell |
◆ add_child() [1/2]
Add a subnetwork to the children list of the network, initialize the network.
- Parameters
-
cell | the cell value of the subnetwork to be added |
- Returns
- a reference on the new subnetwork
◆ add_child() [2/2]
Add a sub-network to the children list of the network.
- Parameters
-
subtree | the subtree to be added |
- Returns
- a reference on the added subtree
◆ add_parent()
Add a itself as a sub-network in the list of the parent children.
- Parameters
-
subtree | the subtree to be added |
- Returns
- a reference on the added subtree
◆ cell() [1/2]
Cell accessor.
- Returns
- a reference to the network cell
◆ cell() [2/2]
Cell accessor.
- Returns
- a const-reference to the network cell
◆ has_children()
Checks whether the network has one or more child.
- Returns
- Returns false if the network has no child, else returns true.
◆ has_parent()
Checks whether the network has a parent.
- Returns
- Returns true if the network has a parent, else returns false.
◆ visit_by_generic_DFS()
template<class CellT >
template<typename Op1 , typename Op2 , typename Op3 >
Applies a function object to each node encountered in a depth first search algorithm.
- Parameters
-
preorder | unary operation function object that will be applied to every node of the network. The unary operator takes the node as argument. The signature of the function should be equivalent to the following: void op(Network & node); . |
inorder | unary operation function object that will be applied to every node of the network. The unary operator takes the node as argument. The signature of the function should be equivalent to the following: void op(Network & node); . |
postorder | unary operation function object that will be applied to every node of the network. The unary operator takes the node as argument. The signature of the function should be equivalent to the following: void op(Network & node); . |
◆ visit_by_pre_order_DFS()
template<class CellT >
template<class UnaryOperation >
Applies a function object to each node encountered in a depth first search algorithm.
- Parameters
-
op | unary operation function object that will be applied to every node of the network. The unary operator takes the node as argument. The signature of the function should be equivalent to the following: void op(Network & node); . |
◆ visit_cell_by_pre_order_DFS()
template<class CellT >
template<typename UnaryOperation >
Applies a function object to the data member of each node encountered in a preorder depth first search algorithm.
- Parameters
-
op | unary operation function object that will be applied to the data member of the network. The unary operator takes the cell as argument. The signature of the function should be equivalent to the following: void op(const CellT & cell); . |
◆ visit_leaves_cells_by_DFS()
template<class CellT >
template<typename UnaryOperation >
Applies a function object to the data member of each leave encountered along a depth first search algorithm.
- Parameters
-
op | unary operation function object that will be applied to the data member of the network. The unary operator takes the cell as argument. The signature of the function should be equivalent to the following: void op(const CellT & cell); . |
The documentation for this class was generated from the following file:
- /home/runner/work/quetzal-CoaTL/quetzal-CoaTL/src/include/quetzal/coalescence/container/Network.hpp