Implementation of CommonTree distance methods.
Definition in file tree/common_tree/distances.cpp.
#include "genesis/tree/common_tree/distances.hpp"
#include "genesis/tree/function/functions.hpp"
#include "genesis/tree/function/lca_lookup.hpp"
#include "genesis/tree/iterator/levelorder.hpp"
#include "genesis/tree/iterator/preorder.hpp"
#include "genesis/tree/tree.hpp"
#include "genesis/utils/containers/matrix/operators.hpp"
#include <algorithm>
#include <cassert>
#include <stdexcept>
#include <vector>
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< std::pair< TreeNode const *, double > > | closest_leaf_distance_vector (Tree const &tree) |
Return a vector containing the closest leaf node for each node, using the branch_length as distance measure. More... | |
std::vector< std::pair< TreeNode const *, double > > | closest_leaf_distance_vector (Tree const &tree, utils::Matrix< double > const &node_distances) |
double | deepest_distance (Tree const &tree) |
Return the longest distance from any point in the tree (on the edges) to any leaf. More... | |
utils::Matrix< double > | edge_branch_length_distance_matrix (Tree const &tree) |
std::vector< double > | edge_branch_length_distance_vector (Tree const &tree, TreeEdge const *edge) |
std::vector< std::pair< TreeNode const *, double > > | furthest_leaf_distance_vector (Tree const &tree) |
Opposite of closest_leaf_distance_vector(). More... | |
std::vector< std::pair< TreeNode const *, double > > | furthest_leaf_distance_vector (Tree const &tree, utils::Matrix< double > const &node_distances) |
template<class Comparator > | |
std::vector< std::pair< TreeNode const *, double > > | leaf_distance_vector (Tree const &tree, utils::Matrix< double > const &node_distances, Comparator comp) |
Local helper function to calculate either closest_leaf_distance_vector() or furthest_leaf_distance_vector(). More... | |
utils::Matrix< double > | node_branch_length_distance_matrix (Tree const &tree) |
Return a distance matrix containing pairwise distances between all Nodes, using the branch_length of the Edges as distance measurement. More... | |
std::vector< double > | node_branch_length_distance_vector (Tree const &tree, TreeNode const *node=nullptr) |
Return a vector containing the distance of all nodes with respect to the given start node, where distance is measured in the sum of branch lengths between the nodes. More... | |