A toolkit for working with phylogenetic data.
v0.18.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BipartitionSet Class Reference

#include <genesis/tree/bipartition/bipartition_set.hpp>

Detailed Description

Definition at line 43 of file bipartition_set.hpp.

Public Member Functions

 BipartitionSet (Tree &tree)
 
std::string dump ()
 
Bipartitionfind_smallest_subtree (std::vector< TreeNode * > nodes)
 Finds the smallest subtree (measured in number of nodes) that contains all given nodes. More...
 
std::unordered_set< size_t > get_subtree_edges (TreeLink *subtree)
 
void make ()
 
void make_index ()
 
bool validate ()
 

Protected Attributes

std::vector< Bipartitionbipartitions_
 
std::vector< size_t > leaf_to_node_map_
 
std::vector< int > node_to_leaf_map_
 
Treetree_
 

Constructor & Destructor Documentation

BipartitionSet ( Tree tree)
inline

Definition at line 51 of file bipartition_set.hpp.

Member Function Documentation

std::string dump ( )

Definition at line 203 of file bipartition_set.cpp.

Bipartition * find_smallest_subtree ( std::vector< TreeNode * >  nodes)

Finds the smallest subtree (measured in number of nodes) that contains all given nodes.

A subtree is defined by one of the two parts of a tree that are splitted by one edge. Thus, this function tries all subtrees by leaving out each edge once.

If no fitting subtree exists, the function returns a nullptr.

Definition at line 113 of file bipartition_set.cpp.

std::unordered_set< size_t > get_subtree_edges ( TreeLink subtree)

Definition at line 160 of file bipartition_set.cpp.

void make ( )

Definition at line 52 of file bipartition_set.cpp.

void make_index ( )

Definition at line 82 of file bipartition_set.cpp.

bool validate ( )

Definition at line 198 of file bipartition_set.cpp.

Member Data Documentation

std::vector<Bipartition> bipartitions_
protected

Definition at line 77 of file bipartition_set.hpp.

std::vector<size_t> leaf_to_node_map_
protected

Definition at line 75 of file bipartition_set.hpp.

std::vector<int> node_to_leaf_map_
protected

Definition at line 74 of file bipartition_set.hpp.

Tree& tree_
protected

Definition at line 72 of file bipartition_set.hpp.


The documentation for this class was generated from the following files: