41 #ifndef _DRASDRHOMOGENEOUSTREELIKELIHOODDATA_H_ 42 #define _DRASDRHOMOGENEOUSTREELIKELIHOODDATA_H_ 45 #include "../Model/SubstitutionModel.h" 46 #include "../PatternTools.h" 47 #include "../SitePatterns.h" 50 #include <Bpp/Seq/Container/AlignedSequenceContainer.h> 87 #ifndef NO_VIRTUAL_COV 176 #ifndef NO_VIRTUAL_COV 234 mutable std::map<int, DRASDRTreeLikelihoodNodeData>
nodeData_;
235 mutable std::map<int, DRASDRTreeLikelihoodLeafData>
leafData_;
304 for (std::map<int, DRASDRTreeLikelihoodNodeData>::iterator it =
nodeData_.begin(); it !=
nodeData_.end(); it++)
306 int id = it->second.
getNode()->getId();
307 it->second.setNode(
tree_->getNode(
id));
309 for (std::map<int, DRASDRTreeLikelihoodLeafData>::iterator it =
leafData_.begin(); it !=
leafData_.end(); it++)
311 int id = it->second.getNode()->getId();
312 it->second.setNode(
tree_->getNode(
id));
338 return currentPosition;
343 return nodeData_[nodeId].getLikelihoodArrays();
348 return nodeData_[nodeId].getLikelihoodArrays();
353 return nodeData_[parentId].getLikelihoodArrayForNeighbor(neighborId);
358 return nodeData_[parentId].getLikelihoodArrayForNeighbor(neighborId);
363 return nodeData_[nodeId].getDLikelihoodArray();
368 return nodeData_[nodeId].getDLikelihoodArray();
373 return nodeData_[nodeId].getD2LikelihoodArray();
378 return nodeData_[nodeId].getD2LikelihoodArray();
383 return leafData_[nodeId].getLikelihoodArray();
388 return leafData_[nodeId].getLikelihoodArray();
426 void reInit() throw (Exception);
428 void reInit(const
Node* node) throw (Exception);
453 #endif //_DRASDRHOMOGENEOUSTREELIKELIHOODDATA_H_
virtual ~DRASDRTreeLikelihoodData()
Vdouble nodeD2Likelihoods_
This contains all likelihood second order derivatives values used for computation.
Interface for all substitution models.
DRASDRTreeLikelihoodLeafData()
DRASDRTreeLikelihoodData & operator=(const DRASDRTreeLikelihoodData &data)
AbstractTreeLikelihoodData & operator=(const AbstractTreeLikelihoodData &atd)
Partial implementation of the TreeLikelihoodData interface.
const DRASDRTreeLikelihoodNodeData & getNodeData(int nodeId) const
DRASDRTreeLikelihoodNodeData(const DRASDRTreeLikelihoodNodeData &data)
VVVdouble & getRootLikelihoodArray()
void setNode(const Node *node)
Set the node associated to this data.
const DRASDRTreeLikelihoodLeafData & getLeafData(int nodeId) const
const Vdouble & getD2LikelihoodArray(int nodeId) const
DRASDRTreeLikelihoodData(const TreeTemplate< Node > *tree, size_t nbClasses)
VVdouble & getLikelihoodArray()
size_t getNumberOfDistinctSites() const
VVVdouble rootLikelihoods_
DRASDRTreeLikelihoodNodeData & getNodeData(int nodeId)
VVdouble & getRootSiteLikelihoodArray()
Likelihood data structure for a node.
const Vdouble & getDLikelihoodArray() const
Vdouble nodeDLikelihoods_
This contains all likelihood first order derivatives values used for computation. ...
std::map< int, DRASDRTreeLikelihoodLeafData > leafData_
Vdouble & getRootRateSiteLikelihoodArray()
const Vdouble & getD2LikelihoodArrayForNeighbor() const
DRASDRTreeLikelihoodNodeData * clone() const
size_t getNumberOfClasses() const
const std::map< int, VVVdouble > & getLikelihoodArrays(int nodeId) const
The phylogenetic tree class.
VVVdouble & getLikelihoodArrayForNeighbor(int neighborId)
Vdouble & getDLikelihoodArray(int nodeId)
Vdouble & getD2LikelihoodArray(int nodeId)
const Vdouble & getDLikelihoodArray(int nodeId) const
DRASDRTreeLikelihoodLeafData & getLeafData(int nodeId)
const TreeTemplate< Node > * tree_
Vdouble & getDLikelihoodArray()
const Node * getNode() const
Get the node associated to this data structure.
std::map< int, VVVdouble > & getLikelihoodArrays(int nodeId)
DRASDRTreeLikelihoodNodeData & operator=(const DRASDRTreeLikelihoodNodeData &data)
void reInit()
Rebuild likelihood arrays at inner nodes.
VVdouble & getLeafLikelihoods(int nodeId)
DRASDRTreeLikelihoodLeafData & operator=(const DRASDRTreeLikelihoodLeafData &data)
DRASDRTreeLikelihoodLeafData(const DRASDRTreeLikelihoodLeafData &data)
std::map< int, VVVdouble > & getLikelihoodArrays()
size_t getNumberOfStates() const
const VVdouble & getLeafLikelihoods(int nodeId) const
Vdouble rootLikelihoodsSR_
const VVVdouble & getLikelihoodArrayForNeighbor(int neighborId) const
VVVdouble & getLikelihoodArray(int parentId, int neighborId)
const VVVdouble & getRootLikelihoodArray() const
void setNode(const Node *node)
Set the node associated to this data.
The phylogenetic node class.
bool isNeighbor(int neighborId) const
DRASDRTreeLikelihoodData(const DRASDRTreeLikelihoodData &data)
const std::map< int, VVVdouble > & getLikelihoodArrays() const
DRASDRTreeLikelihoodNodeData()
const Node * getNode() const
Get the node associated to this data structure.
const VVVdouble & getLikelihoodArray(int parentId, int neighborId) const
std::map< int, VVVdouble > nodeLikelihoods_
This contains all likelihood values used for computation.
const Vdouble & getRootRateSiteLikelihoodArray() const
size_t getNumberOfSites() const
Likelihood data structure for rate across sites models, using a double-recursive algorithm.
const VVdouble & getRootSiteLikelihoodArray() const
DRASDRTreeLikelihoodData * clone() const
void initLikelihoods(const SiteContainer &sites, const SubstitutionModel &model)
Resize and initialize all likelihood arrays according to the given data set and substitution model...
virtual ~DRASDRTreeLikelihoodNodeData()
size_t getArrayPosition(int parentId, int sonId, size_t currentPosition) const
DRASDRTreeLikelihoodLeafData * clone() const
VVdouble rootLikelihoodsS_
std::map< int, DRASDRTreeLikelihoodNodeData > nodeData_
Likelihood data structure for a leaf.
SiteContainer * shrunkData_
void eraseNeighborArrays()
TreeLikelihood partial data structure.
virtual N * getNode(int id, bool checkId=false)
void setTree(const TreeTemplate< Node > *tree)
Set the tree associated to the data.
const SiteContainer * getShrunkData() const
Vdouble & getD2LikelihoodArray()