PhyloTree< T > Class Template Reference

#include <PhyloTree.h>

List of all members.

Public Member Functions

const T & back () const
T & back ()
void clear ()
double getHeight (node_id_t nodeI) const
 Determines the height of the tree along the path from nodeI to its left-most descendant leaf node.

double getHeight () const
 Determines the height of the tree along the path from the root to the left-most leaf node.

PhyloTree< T > & operator= (const PhyloTree< T > &pt)
const T & operator[] (const unsigned i) const
T & operator[] (const unsigned i)
 PhyloTree (const PhyloTree< T > &pt)
 PhyloTree ()
void push_back (T &t)
void readTree (std::istream &tree_file)
 Reads a tree in Newick format.

void resize (const unsigned s)
size_t size () const
void swap (PhyloTree< T > &other)
void writeTree (std::ostream &os) const
 Writes a tree in Newick format.

 ~PhyloTree ()

Public Attributes

std::vector< T > nodes
 nodes of the tree

node_id_t root
 root of the tree

double weight
 Overall tree weight.

template<class T>
class PhyloTree< T >


Constructor & Destructor Documentation

template<class T>
PhyloTree< T >::PhyloTree  ) 
 

Definition at line 75 of file PhyloTree.h.

References PhyloTree< T >::root.

template<class T>
PhyloTree< T >::PhyloTree const PhyloTree< T > &  pt  ) 
 

Definition at line 82 of file PhyloTree.h.

template<class T>
PhyloTree< T >::~PhyloTree  ) 
 

Definition at line 98 of file PhyloTree.h.


Member Function Documentation

template<class T>
const T& PhyloTree< T >::back  )  const [inline]
 

Definition at line 60 of file PhyloTree.h.

template<class T>
T& PhyloTree< T >::back  )  [inline]
 

Definition at line 59 of file PhyloTree.h.

template<class T>
void PhyloTree< T >::clear  ) 
 

Definition at line 102 of file PhyloTree.h.

References PhyloTree< T >::nodes, and PhyloTree< T >::root.

Referenced by PhyloTree< T >::readTree().

template<class T>
double PhyloTree< T >::getHeight node_id_t  nodeI  )  const
 

Determines the height of the tree along the path from nodeI to its left-most descendant leaf node.

Definition at line 321 of file PhyloTree.h.

References PhyloTree< T >::getHeight().

template<class T>
double PhyloTree< T >::getHeight  )  const
 

Determines the height of the tree along the path from the root to the left-most leaf node.

Definition at line 315 of file PhyloTree.h.

References PhyloTree< T >::root.

Referenced by PhyloTree< T >::getHeight().

template<class T>
PhyloTree< T > & PhyloTree< T >::operator= const PhyloTree< T > &  pt  ) 
 

Definition at line 89 of file PhyloTree.h.

References PhyloTree< T >::nodes, PhyloTree< T >::root, and PhyloTree< T >::weight.

template<class T>
const T& PhyloTree< T >::operator[] const unsigned  i  )  const [inline]
 

Definition at line 56 of file PhyloTree.h.

template<class T>
T& PhyloTree< T >::operator[] const unsigned  i  )  [inline]
 

Definition at line 55 of file PhyloTree.h.

template<class T>
void PhyloTree< T >::push_back T &  t  )  [inline]
 

Definition at line 58 of file PhyloTree.h.

template<class T>
void PhyloTree< T >::readTree std::istream &  tree_file  ) 
 

Reads a tree in Newick format.

WARNING: only reads rooted trees correctly

< read_state of 0 indicates nothing has been parsed yet

Definition at line 115 of file PhyloTree.h.

References PhyloTree< T >::clear(), node_id_t, PhyloTree< T >::nodes, and uint.

template<class T>
void PhyloTree< T >::resize const unsigned  s  )  [inline]
 

Definition at line 61 of file PhyloTree.h.

template<class T>
size_t PhyloTree< T >::size  )  const [inline]
 

Definition at line 57 of file PhyloTree.h.

Referenced by PhyloTree< T >::writeTree().

template<class T>
void PhyloTree< T >::swap PhyloTree< T > &  other  )  [inline]
 

Definition at line 64 of file PhyloTree.h.

Referenced by std::swap().

template<class T>
void PhyloTree< T >::writeTree std::ostream &  os  )  const
 

Writes a tree in Newick format.

Definition at line 256 of file PhyloTree.h.

References node_id_t, PhyloTree< T >::root, and PhyloTree< T >::size().


Member Data Documentation

template<class T>
std::vector< T > PhyloTree< T >::nodes
 

nodes of the tree

Definition at line 36 of file PhyloTree.h.

Referenced by PhyloTree< T >::clear(), PhyloTree< T >::operator=(), PhyloTree< T >::readTree(), and PhyloTree< AlignmentTreeNode >::swap().

template<class T>
node_id_t PhyloTree< T >::root
 

root of the tree

Definition at line 35 of file PhyloTree.h.

Referenced by PhyloTree< T >::clear(), PhyloTree< T >::getHeight(), PhyloTree< T >::operator=(), PhyloTree< T >::PhyloTree(), PhyloTree< AlignmentTreeNode >::swap(), and PhyloTree< T >::writeTree().

template<class T>
double PhyloTree< T >::weight
 

Overall tree weight.

Definition at line 34 of file PhyloTree.h.

Referenced by PhyloTree< T >::operator=(), and PhyloTree< AlignmentTreeNode >::swap().


The documentation for this class was generated from the following file:
Generated on Fri Mar 14 06:01:38 2008 for libMems by doxygen 1.3.6