|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file.
59 std::vector<size_t> done;
68 node_color.enabled(
false );
69 link_color.enabled(
false );
70 next_color.enabled(
false );
71 edge_color.enabled(
false );
80 while( &l->next() != &tree.
root_link() ) {
88 std::string
indent = std::string(4 * depth[n.index()],
' ');
95 done.push_back(n.index());
102 out <<
" " << link_color(
"Link " +
std::to_string( l->index() ));
104 out <<
" " << next_color(
">") <<
" "
109 out <<
" -- " << link_color(
"Link " +
std::to_string( l->index() ));
110 out <<
" -- " << edge_color(
"Edge " +
std::to_string( l->edge().index() ));
112 out <<
" --> " << link_color(
"Link " +
std::to_string( l->index() )) <<
"\n";
113 }
while( &l->next() != &tree.
root_link() );
117 out <<
" " << link_color(
"Link " +
std::to_string( l->index() ));
119 out <<
" " << next_color(
">") <<
" "
126 std::ostringstream res;
Provides some valuable algorithms that are not part of the C++ 11 STL.
std::string indent(std::string const &text, std::string const &indentation)
Indent each line of text with indentation and return the result.
TreeLink & next()
Return the next TreeLink within the TreeNode of this link.
TreeNode & node()
Return the TreeNode of this TreeLink.
std::string to_string(GenomeLocus const &locus)
void print(std::ostream &out, Tree const &tree) const
Class for representing phylogenetic trees.
TreeLink & root_link()
Return the TreeLink at the current root of the Tree.
std::string name
Name of the node.
Simple text style class for colorized and bold output to a terminal.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Common class containing the commonly needed data for tree nodes.
bool contains(const C &v, const T &x)
Returns whether a container object has a certain element.
Header of Tree distance methods.
std::vector< size_t > node_path_length_vector(Tree const &tree, TreeNode const &node)
Return a vector containing the depth of all nodes with respect to the given start node.