bpp-phyl  2.1.0
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
bpp::AbstractTreeLikelihoodData Class Referenceabstract

Partial implementation of the TreeLikelihoodData interface. More...

#include <Bpp/Phyl/Likelihood/AbstractTreeLikelihoodData.h>

+ Inheritance diagram for bpp::AbstractTreeLikelihoodData:
+ Collaboration diagram for bpp::AbstractTreeLikelihoodData:

Public Member Functions

 AbstractTreeLikelihoodData (const TreeTemplate< Node > *tree)
 
 AbstractTreeLikelihoodData (const AbstractTreeLikelihoodData &atd)
 
AbstractTreeLikelihoodDataoperator= (const AbstractTreeLikelihoodData &atd)
 
virtual ~AbstractTreeLikelihoodData ()
 
std::vector< size_t > & getRootArrayPositions ()
 
const std::vector< size_t > & getRootArrayPositions () const
 
size_t getRootArrayPosition (const size_t site) const
 
unsigned int getWeight (size_t pos) const
 
const std::vector< unsigned int > & getWeights () const
 
const AlphabetgetAlphabet () const
 
const TreeTemplate< Node > * getTree () const
 
TreeLikelihoodDataclone () const =0
 
virtual size_t getArrayPosition (int parentId, int sonId, size_t currentPosition) const =0
 
virtual TreeLikelihoodNodeDatagetNodeData (int nodeId)=0
 
virtual const
TreeLikelihoodNodeData
getNodeData (int nodeId) const =0
 
virtual size_t getNumberOfDistinctSites () const =0
 
virtual size_t getNumberOfSites () const =0
 
virtual size_t getNumberOfStates () const =0
 

Protected Attributes

std::vector< size_t > rootPatternLinks_
 Links between sites and patterns. More...
 
std::vector< unsigned int > rootWeights_
 The frequency of each site. More...
 
const TreeTemplate< Node > * tree_
 
const Alphabetalphabet_
 

Detailed Description

Partial implementation of the TreeLikelihoodData interface.

This data structure provides a simple compression, by performing and storing computations only one time per identical sites.

The compression is achieved by the TreeLikelihood object. The correspondance between sites in the dataset and the arrays in the structures is given by the rootPatternLinks_ array: the array indice for site $i$ if given by:

Finally, the rootWeights_ array gives for each array position, the number of sites with this pattern. The global likelihood is then given by the product of all likelihoods for each array position, weighted by the corresponding number of sites.

Definition at line 71 of file AbstractTreeLikelihoodData.h.

Constructor & Destructor Documentation

bpp::AbstractTreeLikelihoodData::AbstractTreeLikelihoodData ( const TreeTemplate< Node > *  tree)
inline

Definition at line 98 of file AbstractTreeLikelihoodData.h.

bpp::AbstractTreeLikelihoodData::AbstractTreeLikelihoodData ( const AbstractTreeLikelihoodData atd)
inline

Definition at line 101 of file AbstractTreeLikelihoodData.h.

virtual bpp::AbstractTreeLikelihoodData::~AbstractTreeLikelihoodData ( )
inlinevirtual

Definition at line 118 of file AbstractTreeLikelihoodData.h.

Member Function Documentation

TreeLikelihoodData* bpp::TreeLikelihoodData::clone ( ) const
pure virtualinherited
const Alphabet* bpp::AbstractTreeLikelihoodData::getAlphabet ( ) const
inlinevirtual

Implements bpp::TreeLikelihoodData.

Definition at line 136 of file AbstractTreeLikelihoodData.h.

References alphabet_.

virtual size_t bpp::TreeLikelihoodData::getArrayPosition ( int  parentId,
int  sonId,
size_t  currentPosition 
) const
pure virtualinherited
virtual TreeLikelihoodNodeData& bpp::TreeLikelihoodData::getNodeData ( int  nodeId)
pure virtualinherited
virtual const TreeLikelihoodNodeData& bpp::TreeLikelihoodData::getNodeData ( int  nodeId) const
pure virtualinherited
virtual size_t bpp::TreeLikelihoodData::getNumberOfDistinctSites ( ) const
pure virtualinherited
Returns
The number of non redundant patterns.

Implemented in bpp::DRASDRTreeLikelihoodData, and bpp::DRASRTreeLikelihoodData.

virtual size_t bpp::TreeLikelihoodData::getNumberOfSites ( ) const
pure virtualinherited
Returns
The total number of sites.

Implemented in bpp::DRASDRTreeLikelihoodData, and bpp::DRASRTreeLikelihoodData.

virtual size_t bpp::TreeLikelihoodData::getNumberOfStates ( ) const
pure virtualinherited
Returns
Get the number of states used in the model.

Implemented in bpp::DRASDRTreeLikelihoodData, and bpp::DRASRTreeLikelihoodData.

std::vector<size_t>& bpp::AbstractTreeLikelihoodData::getRootArrayPositions ( )
inline

Definition at line 121 of file AbstractTreeLikelihoodData.h.

References rootPatternLinks_.

const std::vector<size_t>& bpp::AbstractTreeLikelihoodData::getRootArrayPositions ( ) const
inline

Definition at line 122 of file AbstractTreeLikelihoodData.h.

References rootPatternLinks_.

const TreeTemplate<Node>* bpp::AbstractTreeLikelihoodData::getTree ( ) const
inlinevirtual

Implements bpp::TreeLikelihoodData.

Definition at line 138 of file AbstractTreeLikelihoodData.h.

References tree_.

unsigned int bpp::AbstractTreeLikelihoodData::getWeight ( size_t  pos) const
inlinevirtual
Returns
The frequency of a given pattern.

Implements bpp::TreeLikelihoodData.

Definition at line 127 of file AbstractTreeLikelihoodData.h.

References rootWeights_.

Referenced by bpp::DRTreeLikelihoodTools::getPosteriorStateFrequencies().

AbstractTreeLikelihoodData& bpp::AbstractTreeLikelihoodData::operator= ( const AbstractTreeLikelihoodData atd)
inline

Member Data Documentation

const Alphabet* bpp::AbstractTreeLikelihoodData::alphabet_
protected

Definition at line 95 of file AbstractTreeLikelihoodData.h.

Referenced by getAlphabet(), and operator=().

std::vector<size_t> bpp::AbstractTreeLikelihoodData::rootPatternLinks_
protected

Links between sites and patterns.

The size of this vector is equal to the number of sites in the container, each element corresponds to a site in the container and points to the corresponding column in the likelihood array of the root node. If the container contains no repeated site, there will be a strict equivalence between each site and the likelihood array of the root node. However, if this is not the case, some pointers may point toward the same element in the likelihood array.

Definition at line 86 of file AbstractTreeLikelihoodData.h.

Referenced by getRootArrayPosition(), bpp::DRASRTreeLikelihoodData::getRootArrayPosition(), getRootArrayPositions(), and operator=().

std::vector<unsigned int> bpp::AbstractTreeLikelihoodData::rootWeights_
protected

The frequency of each site.

Definition at line 91 of file AbstractTreeLikelihoodData.h.

Referenced by getWeight(), getWeights(), and operator=().


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