1 #ifndef GENESIS_TREE_MASS_TREE_FUNCTIONS_H_ 2 #define GENESIS_TREE_MASS_TREE_FUNCTIONS_H_ 80 double const scaler_lhs = 1.0,
81 double const scaler_rhs = 1.0
97 double const scaler_lhs = 1.0,
98 double const scaler_rhs = 1.0
251 #endif // include guard void mass_tree_reverse_signs(MassTree &tree)
Reverse the sign of each mass point on a MassTree.
double mass_tree_center_masses_on_branches_averaged(MassTree &tree)
Accumulate all masses of a MassTree at the average mass position per edge.
double mass_tree_sum_of_masses(MassTree const &tree)
Return the total sum of all masses on the MassTree.
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
bool mass_tree_validate(MassTree const &tree, double valid_total_mass_difference)
Validate the data on a MassTree.
std::vector< double > mass_tree_mass_per_edge(MassTree const &tree)
Return a std::vector that contains the total mass for each edge of the given MassTree.
void mass_tree_transform_to_unit_branch_lengths(MassTree &tree)
Set all branch lengths of a MassTree to 1.0, while keeping the relative position of all masses on the...
Tree MassTree
Alias for a Tree that stores masses on its TreeEdges.
std::vector< std::pair< double, double > > mass_tree_mass_per_edge_averaged(MassTree const &tree)
Return a std::vector that contains the total Mass for each edge of the given MassTree (second value)...
void mass_tree_merge_trees_inplace(MassTree &lhs, MassTree const &rhs, double const scaler_lhs, double const scaler_rhs)
Merge all masses of two MassTrees by adding them to the first MassTree.
void mass_trees_make_average_branch_lengths(std::vector< MassTree > &mass_trees)
Change the branch lengths of all trees to their average, and move the masses accordingly in a proport...
void mass_tree_clear_masses(MassTree &tree)
Clear all masses of a MassTree, while keeping its topology.
void mass_tree_scale_masses(MassTree &tree, double factor)
Scale all masses of a MassTree with the multiplicative factor factor.
void mass_tree_normalize_masses(MassTree &tree)
Scale all masses of a MassTree so that they sum up to 1.0.
MassTree mass_tree_merge_trees(MassTree const &lhs, MassTree const &rhs, double const scaler_lhs, double const scaler_rhs)
Merge all masses of two MassTrees into one and return it.
double mass_tree_center_masses_on_branches(MassTree &tree)
Accumulate all masses of a MassTree on the centers of their edges.
double mass_tree_binify_masses(MassTree &tree, size_t number_of_bins)
Accumulate all masses of a MassTree into bins on each branch.