Sequence::newick_stream_marginal_tree Class Reference
[Classes and functions related to simulating data under coalescent models]

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

#include <Sequence/Coalescent/SimTypes.hpp>

List of all members.

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 219 of file SimTypes.hpp.


Member Function Documentation

std::vector< node > Sequence::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 433 of file CoalescentSimTypes.cc.

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

Write the marginal tree in Newick format to stream o

Definition at line 442 of file CoalescentSimTypes.cc.

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

Read a Newick tree from stream i

Warning:
Not implemented!

Definition at line 451 of file CoalescentSimTypes.cc.


The documentation for this class was generated from the following files:
Generated on Thu Aug 11 13:22:05 2011 for libsequence by  doxygen 1.6.3