A library for working with phylogenetic and population genetic data.
v0.32.0
phylo_factor.hpp File Reference
#include "genesis/tree/mass_tree/balances.hpp"
#include "genesis/utils/containers/matrix.hpp"
#include <functional>
#include <unordered_set>
#include <vector>

Go to the source code of this file.

Classes

struct  PhyloFactor
 A single phylogenetic factor. More...
 

Namespaces

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

Typedefs

using PhyloFactorObjectiveFunction = std::function< double(size_t iteration, size_t edge_index, std::vector< double > const &balances) >
 Function type used as the objective function in phylogenetic_factorization(). More...
 

Functions

PhyloFactor phylo_factor_find_best_edge (size_t iteration, BalanceData const &data, std::unordered_set< size_t > const &candidate_edges, PhyloFactorObjectiveFunction objective)
 Helper function for phylogenetic_factorization() that tries all candidate edges to find the one that maximizes the objective function. More...
 
std::unordered_set< size_t > phylo_factor_subtree_indices (Subtree const &subtree, std::unordered_set< size_t > const &candidate_edges)
 Helper function for phylogenetic_factorization() to find the constrained subtrees that are split by an edge. More...
 
std::vector< PhyloFactor > phylogenetic_factorization (BalanceData const &data, PhyloFactorObjectiveFunction objective, size_t max_iterations=0, std::function< void(size_t iteration, size_t max_iterations)> log_progress={})
 Calculate the Phylogenetic Factorization (PhyloFactor) of a set of MassTrees. More...
 
std::vector< PhyloFactor > phylogenetic_factorization (BalanceData const &data, std::function< double(std::vector< double > const &balances)> objective, size_t max_iterations=0, std::function< void(size_t iteration, size_t max_iterations)> log_progress={})
 Calculate the Phylogenetic Factorization (PhyloFactor) of a set of MassTrees. More...