bpp-phyl3
3.0.0
|
Partial implementation of the TreeLikelihoodData interface. More...
#include <Bpp/Phyl/Legacy/Likelihood/AbstractTreeLikelihoodData.h>
Public Member Functions | |
AbstractTreeLikelihoodData (std::shared_ptr< 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 |
std::shared_ptr< const Alphabet > | getAlphabet () const |
std::shared_ptr< 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... | |
std::shared_ptr< const TreeTemplate< Node > > | tree_ |
std::shared_ptr< 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 correspondence 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 35 of file AbstractTreeLikelihoodData.h.
|
inline |
Definition at line 62 of file AbstractTreeLikelihoodData.h.
|
inline |
Definition at line 65 of file AbstractTreeLikelihoodData.h.
|
inlinevirtual |
Definition at line 82 of file AbstractTreeLikelihoodData.h.
|
pure virtualinherited |
Implements bpp::Clonable.
Implemented in bpp::DRASRTreeLikelihoodData, and bpp::DRASDRTreeLikelihoodData.
|
inlinevirtual |
Implements bpp::TreeLikelihoodData.
Definition at line 100 of file AbstractTreeLikelihoodData.h.
References alphabet_.
|
pure virtualinherited |
Implemented in bpp::DRASRTreeLikelihoodData, and bpp::DRASDRTreeLikelihoodData.
|
pure virtualinherited |
Implemented in bpp::DRASRTreeLikelihoodData, and bpp::DRASDRTreeLikelihoodData.
|
pure virtualinherited |
Implemented in bpp::DRASRTreeLikelihoodData, and bpp::DRASDRTreeLikelihoodData.
|
pure virtualinherited |
Implemented in bpp::DRASRTreeLikelihoodData, and bpp::DRASDRTreeLikelihoodData.
Referenced by bpp::TreeLikelihoodTools::getAncestralFrequencies().
|
pure virtualinherited |
Implemented in bpp::DRASRTreeLikelihoodData, and bpp::DRASDRTreeLikelihoodData.
|
pure virtualinherited |
Implemented in bpp::DRASRTreeLikelihoodData, and bpp::DRASDRTreeLikelihoodData.
|
inlinevirtual |
Implements bpp::TreeLikelihoodData.
Reimplemented in bpp::DRASRTreeLikelihoodData.
Definition at line 87 of file AbstractTreeLikelihoodData.h.
References rootPatternLinks_.
|
inline |
Definition at line 85 of file AbstractTreeLikelihoodData.h.
References rootPatternLinks_.
|
inline |
Definition at line 86 of file AbstractTreeLikelihoodData.h.
References rootPatternLinks_.
|
inlinevirtual |
Implements bpp::TreeLikelihoodData.
Definition at line 102 of file AbstractTreeLikelihoodData.h.
References tree_.
|
inlinevirtual |
Implements bpp::TreeLikelihoodData.
Definition at line 91 of file AbstractTreeLikelihoodData.h.
References rootWeights_.
Referenced by bpp::DRTreeLikelihoodTools::getPosteriorStateFrequencies().
|
inlinevirtual |
Implements bpp::TreeLikelihoodData.
Definition at line 95 of file AbstractTreeLikelihoodData.h.
References rootWeights_.
|
inline |
Definition at line 72 of file AbstractTreeLikelihoodData.h.
References alphabet_, rootPatternLinks_, rootWeights_, and tree_.
Referenced by bpp::DRASDRTreeLikelihoodData::operator=(), and bpp::DRASRTreeLikelihoodData::operator=().
|
protected |
Definition at line 59 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 50 of file AbstractTreeLikelihoodData.h.
Referenced by getRootArrayPosition(), bpp::DRASRTreeLikelihoodData::getRootArrayPosition(), getRootArrayPositions(), and operator=().
|
protected |
The frequency of each site.
Definition at line 55 of file AbstractTreeLikelihoodData.h.
Referenced by getWeight(), getWeights(), and operator=().
|
protected |
Definition at line 57 of file AbstractTreeLikelihoodData.h.
Referenced by getTree(), operator=(), bpp::DRASDRTreeLikelihoodData::setTree(), and bpp::DRASRTreeLikelihoodData::setTree().