libsequence  1.9.5

Class that provides a typecast-on-output of a marginal tree to a newick tree Example use: More...

#include <Sequence/Coalescent/SimTypes.hpp>

Public Member Functions

 newick_stream_marginal_tree (const marginal &m)
 
 newick_stream_marginal_tree (const marginal *m)
 
 newick_stream_marginal_tree (arg::const_iterator m)
 
 newick_stream_marginal_tree (arg::iterator m)
 
std::vector< nodeget_tree () const
 
std::ostream & print (std::ostream &o) const
 
std::istream & read (std::istream &i)
 

Detailed Description

Class that provides a typecast-on-output of a marginal tree to a newick tree Example use:

//assume we've done something useful to get
//data into an arg called sample_history
//tlength is the total length of the region being simulated
int seg = 0,nsegs=sample_history.size();
arg::iterator i = sample_history.begin(),j=i;
++j;
for( seg=0 ; seg < nsegs ; ++seg,++i,++j)
{
int length = ( (seg<nsegs-1) ? (j->beg-i->beg) : (tlength-i->beg) );
cout << '['
<< length
<< ']'
<< newick_stream_marginal_tree(i)
<< '\n';
}

Definition at line 221 of file SimTypes.hpp.

Member Function Documentation

◆ get_tree()

std::vector< node > Sequence::coalsim::newick_stream_marginal_tree::get_tree ( ) const

if a tree has been read in from a stream, return it, else return an empty tree

Definition at line 434 of file CoalescentSimTypes.cc.

◆ print()

std::ostream & Sequence::coalsim::newick_stream_marginal_tree::print ( std::ostream &  o) const

Write the marginal tree in Newick format to stream o

Definition at line 443 of file CoalescentSimTypes.cc.

◆ read()

std::istream & Sequence::coalsim::newick_stream_marginal_tree::read ( std::istream &  i)

Read a Newick tree from stream i

Warning
Not implemented!

Definition at line 452 of file CoalescentSimTypes.cc.


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