A library for working with phylogenetic and population genetic data.
v0.27.0
rf.cpp File Reference
#include "genesis/tree/bipartition/rf.hpp"
#include "genesis/tree/common_tree/tree.hpp"
#include "genesis/tree/function/functions.hpp"
#include "genesis/tree/iterator/postorder.hpp"
#include "genesis/utils/core/algorithm.hpp"
#include <cstdint>
#include <algorithm>
#include <cassert>
#include <stdexcept>
#include <limits>

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

size_t rf_distance_absolute (Tree const &lhs, Tree const &rhs)
 Compute the absolute RF (Robinson-Foulds) distance metric between two Trees. More...
 
std::vector< size_t > rf_distance_absolute (Tree const &lhs, TreeSet const &rhs)
 Compute the absolute RF (Robinson-Foulds) distance metric between a given lhs Tree and all of the trees in the rhs TreeSet. More...
 
utils::Matrix< size_t > rf_distance_absolute (TreeSet const &trees)
 Compute the pairwise absolute RF (Robinson-Foulds) distance metric between a set of trees. More...
 
double rf_distance_relative (Tree const &lhs, Tree const &rhs)
 Compute the relative RF (Robinson-Foulds) distance metric between two Trees. More...
 
std::vector< double > rf_distance_relative (Tree const &lhs, TreeSet const &rhs)
 Compute the relative RF (Robinson-Foulds) distance metric between a given lhs Tree and all of the trees in the rhs TreeSet. More...
 
utils::Matrix< double > rf_distance_relative (TreeSet const &trees)
 Compute the pairwise relative RF (Robinson-Foulds) distance metric between a set of trees. More...
 
std::vector< utils::Bitvector > rf_get_bitvectors (Tree const &tree, std::unordered_map< std::string, size_t > const &names)
 Get all split Bitvectors for a given Tree. More...
 
template<typename BitvectorProcessor >
void rf_get_bitvectors_template (Tree const &tree, std::unordered_map< std::string, size_t > const &names, BitvectorProcessor const &process_bitvector)
 Local helper function template that constructs all bitvectors for the splits of a tree, but allows to customize what to do with them once constructed. More...
 
std::unordered_map< utils::Bitvector, utils::Bitvector > rf_get_occurrences (Tree const &lhs, Tree const &rhs)
 Get an occurrence map for each split found in two trees. More...
 
std::unordered_map< utils::Bitvector, utils::Bitvector > rf_get_occurrences (Tree const &lhs, TreeSet const &rhs)
 Get an occurrence map for each split found in some Trees. More...
 
std::unordered_map< utils::Bitvector, utils::Bitvector > rf_get_occurrences (TreeSet const &trees)
 Get an occurrence map for each split found in the given TreeSet. More...
 
std::unordered_map< std::string, size_t > rf_taxon_name_map (Tree const &tree)
 Get a mapping from taxon names to unique IDs. More...