5 #ifndef BPP_PHYL_LEGACY_LIKELIHOOD_DRASDRTREELIKELIHOODDATA_H
6 #define BPP_PHYL_LEGACY_LIKELIHOOD_DRASDRTREELIKELIHOODDATA_H
9 #include "../../Model/SubstitutionModel.h"
10 #include "../../SitePatterns.h"
11 #include "../../PatternTools.h"
187 mutable std::map<int, DRASDRTreeLikelihoodNodeData>
nodeData_;
188 mutable std::map<int, DRASDRTreeLikelihoodLeafData>
leafData_;
258 int id = it.second.getNode()->getId();
259 it.second.setNode(
tree_->getNode(
id));
263 int id = it.second.getNode()->getId();
264 it.second.setNode(
tree_->getNode(
id));
290 return currentPosition;
295 return nodeData_[nodeId].getLikelihoodArrays();
300 return nodeData_[nodeId].getLikelihoodArrays();
305 return nodeData_[parentId].getLikelihoodArrayForNeighbor(neighborId);
310 return nodeData_[parentId].getLikelihoodArrayForNeighbor(neighborId);
315 return nodeData_[nodeId].getDLikelihoodArray();
320 return nodeData_[nodeId].getDLikelihoodArray();
325 return nodeData_[nodeId].getD2LikelihoodArray();
330 return nodeData_[nodeId].getD2LikelihoodArray();
335 return leafData_[nodeId].getLikelihoodArray();
340 return leafData_[nodeId].getLikelihoodArray();
Partial implementation of the TreeLikelihoodData interface.
AbstractTreeLikelihoodData & operator=(const AbstractTreeLikelihoodData &atd)
std::shared_ptr< const TreeTemplate< Node > > tree_
Likelihood data structure for rate across sites models, using a double-recursive algorithm.
size_t getNumberOfSites() const
const AlignmentDataInterface & shrunkData() const
Vdouble & getD2LikelihoodArray(int nodeId)
VVVdouble & getRootLikelihoodArray()
VVVdouble rootLikelihoods_
const Vdouble & getDLikelihoodArray(int nodeId) const
size_t getNumberOfClasses() const
Vdouble & getRootRateSiteLikelihoodArray()
const Vdouble & getD2LikelihoodArray(int nodeId) const
VVVdouble & getLikelihoodArray(int parentId, int neighborId)
VVdouble & getLeafLikelihoods(int nodeId)
const DRASDRTreeLikelihoodNodeData & getNodeData(int nodeId) const
DRASDRTreeLikelihoodData(const DRASDRTreeLikelihoodData &data)
std::map< int, VVVdouble > & getLikelihoodArrays(int nodeId)
VVdouble & getRootSiteLikelihoodArray()
std::shared_ptr< const AlignmentDataInterface > getShrunkData() const
DRASDRTreeLikelihoodNodeData & getNodeData(int nodeId)
virtual ~DRASDRTreeLikelihoodData()
DRASDRTreeLikelihoodData & operator=(const DRASDRTreeLikelihoodData &data)
void reInit()
Rebuild likelihood arrays at inner nodes.
const Vdouble & getRootRateSiteLikelihoodArray() const
size_t getNumberOfStates() const
const DRASDRTreeLikelihoodLeafData & getLeafData(int nodeId) const
DRASDRTreeLikelihoodData(std::shared_ptr< const TreeTemplate< Node >> tree, size_t nbClasses)
DRASDRTreeLikelihoodData * clone() const
const std::map< int, VVVdouble > & getLikelihoodArrays(int nodeId) const
void setTree(std::shared_ptr< const TreeTemplate< Node >> tree)
Set the tree associated to the data.
VVdouble rootLikelihoodsS_
void initLikelihoods(const AlignmentDataInterface &sites, const TransitionModelInterface &model)
Resize and initialize all likelihood arrays according to the given data set and substitution model.
Vdouble & getDLikelihoodArray(int nodeId)
DRASDRTreeLikelihoodLeafData & getLeafData(int nodeId)
const VVdouble & getRootSiteLikelihoodArray() const
Vdouble rootLikelihoodsSR_
const VVVdouble & getRootLikelihoodArray() const
std::map< int, DRASDRTreeLikelihoodNodeData > nodeData_
std::map< int, DRASDRTreeLikelihoodLeafData > leafData_
size_t getArrayPosition(int parentId, int sonId, size_t currentPosition) const
std::shared_ptr< AlignmentDataInterface > shrunkData_
size_t getNumberOfDistinctSites() const
const VVVdouble & getLikelihoodArray(int parentId, int neighborId) const
const VVdouble & getLeafLikelihoods(int nodeId) const
Likelihood data structure for a leaf.
DRASDRTreeLikelihoodLeafData * clone() const
DRASDRTreeLikelihoodLeafData & operator=(const DRASDRTreeLikelihoodLeafData &data)
DRASDRTreeLikelihoodLeafData(const DRASDRTreeLikelihoodLeafData &data)
DRASDRTreeLikelihoodLeafData()
const Node * getNode() const
Get the node associated to this data structure.
VVdouble & getLikelihoodArray()
void setNode(const Node *node)
Set the node associated to this data.
Likelihood data structure for a node.
Vdouble & getDLikelihoodArray()
DRASDRTreeLikelihoodNodeData * clone() const
void setNode(const Node *node)
Set the node associated to this data.
const VVVdouble & getLikelihoodArrayForNeighbor(int neighborId) const
DRASDRTreeLikelihoodNodeData()
const Vdouble & getDLikelihoodArray() const
DRASDRTreeLikelihoodNodeData & operator=(const DRASDRTreeLikelihoodNodeData &data)
const std::map< int, VVVdouble > & getLikelihoodArrays() const
virtual ~DRASDRTreeLikelihoodNodeData()
VVVdouble & getLikelihoodArrayForNeighbor(int neighborId)
void eraseNeighborArrays()
bool isNeighbor(int neighborId) const
Vdouble nodeDLikelihoods_
This contains all likelihood first order derivatives values used for computation.
Vdouble & getD2LikelihoodArray()
std::map< int, VVVdouble > & getLikelihoodArrays()
std::map< int, VVVdouble > nodeLikelihoods_
This contains all likelihood values used for computation.
DRASDRTreeLikelihoodNodeData(const DRASDRTreeLikelihoodNodeData &data)
const Node * getNode() const
Get the node associated to this data structure.
const Vdouble & getD2LikelihoodArrayForNeighbor() const
Vdouble nodeD2Likelihoods_
This contains all likelihood second order derivatives values used for computation.
The phylogenetic node class.
Interface for all transition models.
TreeLikelihood partial data structure.
The phylogenetic tree class.
Defines the basic types of data flow nodes.
std::vector< double > Vdouble
std::vector< VVdouble > VVVdouble
std::vector< Vdouble > VVdouble