A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tree/function/operators.cpp File Reference

Detailed Description

Implementation of Tree operator functions.

Definition in file tree/function/operators.cpp.

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::tree
 

Functions

bool belongs_to (Tree const &tree, TreeNode const &node)
 Return whether the TreeNode belongs to the Tree, i.e., whether it is owned by the Tree. More...
 
bool belongs_to (TreeNode const &node, Tree const &tree)
 Return whether the TreeNode belongs to the Tree, i.e., whether it is owned by the Tree. More...
 
bool belongs_to (Tree const &tree, TreeEdge const &edge)
 Return whether the TreeEdge belongs to the Tree, i.e., whether it is owned by the Tree. More...
 
bool belongs_to (TreeEdge const &edge, Tree const &tree)
 Return whether the TreeEdge belongs to the Tree, i.e., whether it is owned by the Tree. More...
 
bool belongs_to (Tree const &tree, TreeLink const &link)
 Return whether the TreeLink belongs to the Tree, i.e., whether it is owned by the Tree. More...
 
bool belongs_to (TreeLink const &link, Tree const &tree)
 Return whether the TreeLink belongs to the Tree, i.e., whether it is owned by the Tree. More...
 
Tree convert (Tree const &source, std::function< std::unique_ptr< BaseNodeData >(BaseNodeData const &node_data)> node_data_converter, std::function< std::unique_ptr< BaseEdgeData >(BaseEdgeData const &edge_data)> edge_data_converter)
 Create a tree with the same topology as the source tree, while converting its data. More...
 
TreeEdge * edge_between (TreeNode &lhs, TreeNode &rhs)
 Return the TreeEdge between two TreeNode&s, if they are neighbours, or nullptr otherwise. More...
 
TreeEdge const * edge_between (TreeNode const &lhs, TreeNode const &rhs)
 Return the TreeEdge between two TreeNode&s, if they are neighbours, or nullptr otherwise. More...
 
bool equal (Tree const &lhs, Tree const &rhs, std::function< bool(TreeNode const &, TreeNode const &) > node_comparator, std::function< bool(TreeEdge const &, TreeEdge const &) > edge_comparator)
 Compares two trees for equality given binary comparator functionals for their nodes and edges. More...
 
bool identical_topology (Tree const &lhs, Tree const &rhs)
 Returns true iff both trees have an identical topology. More...
 
std::ostream & operator<< (std::ostream &out, Tree const &tree)
 
bool validate_topology (Tree const &tree)
 Validate that all internal pointers of the Tree elements (TreeLinks, TreeNodes, TreeEdges) to each other are correct and that some other invariants are met. More...