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

Detailed Description

Implementation of Default Tree functions.

Definition in file tree/default/functions.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

std::vector< double > branch_lengths (Tree const &tree)
 Get a vector of all branch lengths of a Tree, index by the edge index. More...
 
double diameter (Tree const &tree)
 Get the diameter of the tree, i.e., the longest distance between any two nodes, measured using the branch_length. More...
 
TreeNode const * find_node (Tree const &tree, const std::string &name, bool replace_underscores)
 Finds a Node, given its name. If not found, nullptr is returned. More...
 
TreeNode * find_node (Tree &tree, const std::string &name, bool replace_underscores)
 Finds a Node, given its name. If not found, nullptr is returned. More...
 
double height (Tree const &tree)
 Get the height of the tree, i.e., the longest distance from the root to a leaf, measured using the branch_length. More...
 
double length (Tree const &tree)
 Get the length of the tree, i.e., the sum of all branch lengths. More...
 
std::unordered_set< std::string > node_names (Tree const &tree, bool leaves_only)
 Returns an unordered set of all TreeNode names of a Tree. More...
 
std::unordered_set< std::string > node_names (TreeSet const &tree_set, bool leaves_only)
 Returns a set of all TreeNode names of a TreeSet. More...
 
utils::SortedVector< std::string > node_names_sorted (Tree const &tree, bool leaves_only)
 Returns a set of all TreeNode names of a Tree. More...
 
utils::SortedVector< std::string > node_names_sorted (TreeSet const &tree_set, bool leaves_only)
 Returns a set of all TreeNode names of a TreeSet. More...
 
void scale_all_branch_lengths (Tree &tree, double factor)
 Scale all branch lengths of a Tree by a given factor. More...
 
void set_all_branch_lengths (Tree &tree, double length)
 Set all branch lengths of a Tree to a given value. More...