41 #ifndef _DRASRHOMOGENEOUSTREELIKELIHOODDATA_H_ 42 #define _DRASRHOMOGENEOUSTREELIKELIHOODDATA_H_ 45 #include "../Model/SubstitutionModel.h" 46 #include "../SitePatterns.h" 48 #include <Bpp/Numeric/VectorTools.h> 101 #ifndef NO_VIRTUAL_COV 136 mutable std::map<int, DRASRTreeLikelihoodNodeData>
nodeData_;
213 for (std::map<int, DRASRTreeLikelihoodNodeData>::iterator it =
nodeData_.begin(); it !=
nodeData_.end(); it++)
215 int id = it->second.
getNode()->getId();
216 it->second.setNode(
tree_->getNode(
id));
251 return nodeData_[nodeId].getLikelihoodArray();
256 return nodeData_[nodeId].getDLikelihoodArray();
261 return nodeData_[nodeId].getD2LikelihoodArray();
310 #endif //_DRASRHOMOGENEOUSTREELIKELIHOODDATA_H_
SiteContainer * shrunkData_
DRASRTreeLikelihoodNodeData(const DRASRTreeLikelihoodNodeData &data)
size_t getArrayPosition(int parentId, int sonId, size_t currentPosition)
Interface for all substitution models.
AbstractTreeLikelihoodData & operator=(const AbstractTreeLikelihoodData &atd)
Partial implementation of the TreeLikelihoodData interface.
const VVVdouble & getDLikelihoodArray() const
VVVdouble nodeD2Likelihoods_
size_t getRootArrayPosition(size_t currentPosition) const
void setNode(const Node *node)
Set the node associated to this data.
void setTree(const TreeTemplate< Node > *tree)
Set the tree associated to the data.
VVVdouble nodeLikelihoods_
std::map< int, DRASRTreeLikelihoodNodeData > nodeData_
This contains all likelihood values used for computation.
The phylogenetic tree class.
discrete Rate Across Sites, (simple) Recursive likelihood data structure.
VVVdouble & getDLikelihoodArray()
DRASRTreeLikelihoodNodeData()
DRASRTreeLikelihoodNodeData * clone() const
VVVdouble nodeDLikelihoods_
const TreeTemplate< Node > * tree_
DRASRTreeLikelihoodData(const DRASRTreeLikelihoodData &data)
std::map< int, std::map< int, std::vector< size_t > > > patternLinks_
This map defines the pattern network.
const VVVdouble & getD2LikelihoodArray() const
std::vector< size_t > rootPatternLinks_
Links between sites and patterns.
VVVdouble & getDLikelihoodArray(int nodeId)
DRASRTreeLikelihoodData & operator=(const DRASRTreeLikelihoodData &data)
const DRASRTreeLikelihoodNodeData & getNodeData(int nodeId) const
size_t getNumberOfClasses() const
size_t getArrayPosition(int parentId, int sonId, size_t currentPosition) const
size_t getNumberOfSites() const
size_t getNumberOfStates() const
void initLikelihoods(const SiteContainer &sites, const SubstitutionModel &model)
The phylogenetic node class.
VVVdouble & getLikelihoodArray()
VVVdouble & getD2LikelihoodArray()
DRASRTreeLikelihoodData * clone() const
const VVVdouble & getLikelihoodArray() const
size_t getNumberOfDistinctSites() const
DRASRTreeLikelihoodData(const TreeTemplate< Node > *tree, size_t nbClasses, bool usePatterns=true)
DRASRTreeLikelihoodNodeData & getNodeData(int nodeId)
Data structure for site patterns.
const std::vector< size_t > & getArrayPositions(int parentId, int sonId) const
Likelihood data structure for a node.
virtual SitePatterns * initLikelihoodsWithPatterns(const Node *node, const SiteContainer &sequences, const SubstitutionModel &model)
This method initializes the leaves according to a sequence file.
std::vector< size_t > & getArrayPositions(int parentId, int sonId)
VVVdouble & getLikelihoodArray(int nodeId)
VVVdouble & getD2LikelihoodArray(int nodeId)
TreeLikelihood partial data structure.
const Node * getNode() const
Get the node associated to this data structure.
virtual N * getNode(int id, bool checkId=false)
virtual ~DRASRTreeLikelihoodData()
DRASRTreeLikelihoodNodeData & operator=(const DRASRTreeLikelihoodNodeData &data)