bpp-phyl
2.2.0
|
Partial implementation of the TreeLikelihoodData interface. More...
#include <Bpp/Phyl/Likelihood/AbstractTreeLikelihoodData.h>
Public Member Functions | |
AbstractTreeLikelihoodData (const TreeTemplate< Node > *tree) | |
AbstractTreeLikelihoodData (const AbstractTreeLikelihoodData &atd) | |
AbstractTreeLikelihoodData & | operator= (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 Alphabet * | getAlphabet () const |
const TreeTemplate< Node > * | getTree () const |
TreeLikelihoodData * | clone () const =0 |
virtual size_t | getArrayPosition (int parentId, int sonId, size_t currentPosition) const =0 |
virtual TreeLikelihoodNodeData & | getNodeData (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 Alphabet * | alphabet_ |
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 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.
|
inline |
Definition at line 98 of file AbstractTreeLikelihoodData.h.
|
inline |
Definition at line 101 of file AbstractTreeLikelihoodData.h.
|
inlinevirtual |
Definition at line 118 of file AbstractTreeLikelihoodData.h.
|
pure virtualinherited |
Implemented in bpp::DRASDRTreeLikelihoodData, and bpp::DRASRTreeLikelihoodData.
|
inlinevirtual |
Implements bpp::TreeLikelihoodData.
Definition at line 136 of file AbstractTreeLikelihoodData.h.
References alphabet_.
|
pure virtualinherited |
Implemented in bpp::DRASDRTreeLikelihoodData, and bpp::DRASRTreeLikelihoodData.
|
pure virtualinherited |
Implemented in bpp::DRASDRTreeLikelihoodData, and bpp::DRASRTreeLikelihoodData.
|
pure virtualinherited |
Implemented in bpp::DRASDRTreeLikelihoodData, and bpp::DRASRTreeLikelihoodData.
|
pure virtualinherited |
Implemented in bpp::DRASDRTreeLikelihoodData, and bpp::DRASRTreeLikelihoodData.
|
pure virtualinherited |
Implemented in bpp::DRASDRTreeLikelihoodData, and bpp::DRASRTreeLikelihoodData.
|
pure virtualinherited |
Implemented in bpp::DRASDRTreeLikelihoodData, and bpp::DRASRTreeLikelihoodData.
|
inlinevirtual |
Implements bpp::TreeLikelihoodData.
Reimplemented in bpp::DRASRTreeLikelihoodData.
Definition at line 123 of file AbstractTreeLikelihoodData.h.
References rootPatternLinks_.
Referenced by bpp::DRHomogeneousTreeLikelihood::getLikelihoodForASite(), bpp::DRNonHomogeneousTreeLikelihood::getLikelihoodForASite(), bpp::DRHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClass(), bpp::DRNonHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClass(), bpp::DRHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClassForAState(), bpp::DRNonHomogeneousTreeLikelihood::getLikelihoodForASiteForARateClassForAState(), bpp::DRHomogeneousTreeLikelihood::getLogLikelihoodForASite(), bpp::DRNonHomogeneousTreeLikelihood::getLogLikelihoodForASite(), bpp::DRHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClass(), bpp::DRNonHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClass(), bpp::DRHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClassForAState(), bpp::DRNonHomogeneousTreeLikelihood::getLogLikelihoodForASiteForARateClassForAState(), bpp::DRHomogeneousTreeLikelihood::getSiteIndex(), and bpp::DRNonHomogeneousTreeLikelihood::getSiteIndex().
|
inline |
Definition at line 121 of file AbstractTreeLikelihoodData.h.
References rootPatternLinks_.
|
inline |
Definition at line 122 of file AbstractTreeLikelihoodData.h.
References rootPatternLinks_.
|
inlinevirtual |
Implements bpp::TreeLikelihoodData.
Definition at line 138 of file AbstractTreeLikelihoodData.h.
References tree_.
|
inlinevirtual |
Implements bpp::TreeLikelihoodData.
Definition at line 127 of file AbstractTreeLikelihoodData.h.
References rootWeights_.
Referenced by bpp::DRTreeLikelihoodTools::getPosteriorStateFrequencies().
|
inlinevirtual |
Implements bpp::TreeLikelihoodData.
Definition at line 131 of file AbstractTreeLikelihoodData.h.
References rootWeights_.
Referenced by bpp::DRHomogeneousMixedTreeLikelihood::getLikelihood(), bpp::DRHomogeneousTreeLikelihood::getLikelihood(), bpp::DRNonHomogeneousTreeLikelihood::getLikelihood(), bpp::DRHomogeneousMixedTreeLikelihood::getLogLikelihood(), bpp::DRHomogeneousTreeLikelihood::getLogLikelihood(), and bpp::DRNonHomogeneousTreeLikelihood::getLogLikelihood().
|
inline |
Definition at line 108 of file AbstractTreeLikelihoodData.h.
References alphabet_, rootPatternLinks_, rootWeights_, and tree_.
Referenced by bpp::DRASRTreeLikelihoodData::operator=(), and bpp::DRASDRTreeLikelihoodData::operator=().
|
protected |
Definition at line 95 of file AbstractTreeLikelihoodData.h.
Referenced by getAlphabet(), and operator=().
|
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=().
|
protected |
The frequency of each site.
Definition at line 91 of file AbstractTreeLikelihoodData.h.
Referenced by getWeight(), getWeights(), and operator=().
|
protected |
Definition at line 93 of file AbstractTreeLikelihoodData.h.
Referenced by getTree(), operator=(), bpp::DRASDRTreeLikelihoodData::reInit(), bpp::DRASRTreeLikelihoodData::setTree(), and bpp::DRASDRTreeLikelihoodData::setTree().