5 #ifndef BPP_PHYL_LEGACY_LIKELIHOOD_DRHOMOGENEOUSTREELIKELIHOOD_H
6 #define BPP_PHYL_LEGACY_LIKELIHOOD_DRHOMOGENEOUSTREELIKELIHOOD_H
55 std::shared_ptr<TransitionModelInterface> model,
56 std::shared_ptr<DiscreteDistributionInterface> rDist,
57 bool checkRooted =
true,
77 std::shared_ptr<TransitionModelInterface> model,
78 std::shared_ptr<DiscreteDistributionInterface> rDist,
79 bool checkRooted =
true,
227 const std::vector<const VVVdouble*>& iLik,
228 const std::vector<const VVVdouble*>& tProb,
230 size_t nbDistinctSites,
256 const std::vector<const VVVdouble*>& iLik,
257 const std::vector<const VVVdouble*>& tProb,
262 size_t nbDistinctSites,
Partial implementation for homogeneous model of the TreeLikelihood interface.
const AlignmentDataInterface & data() const
Get the dataset for which the likelihood must be evaluated.
const Tree & tree() const
Get the tree (topology and branch lengths).
std::shared_ptr< TreeTemplate< Node > > tree_
Likelihood data structure for rate across sites models, using a double-recursive algorithm.
A class to compute the average of several DRHomogeneousTreeLikelihood defined from a Mixed Substituti...
This class implements the likelihood computation for a tree using the double-recursive algorithm.
virtual ~DRHomogeneousTreeLikelihood()
double getLikelihoodForASiteForARateClassForAState(size_t site, size_t rateClass, int state) const override
Get the likelihood for a site knowing its rate class and its ancestral state.
virtual void fireParameterChanged(const ParameterList ¶ms) override
double getLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const override
Get the likelihood for a site knowing its rate class.
virtual void computeLikelihoodAtNode(int nodeId, VVVdouble &likelihoodArray) const override
Compute the likelihood array at a given node.
double getLikelihood() const override
Get the likelihood for the whole dataset.
static void computeLikelihoodFromArrays(const std::vector< const VVVdouble * > &iLik, const std::vector< const VVVdouble * > &tProb, VVVdouble &oLik, size_t nbNodes, size_t nbDistinctSites, size_t nbClasses, size_t nbStates, bool reset=true)
Compute conditional likelihoods.
double getSecondOrderDerivative(const std::string &variable) const override
DRHomogeneousTreeLikelihood * clone() const override
virtual void resetLikelihoodArrays(const Node *node)
double getFirstOrderDerivative(const std::string &variable) const override
double getValue() const override
Function and NNISearchable interface.
double getLikelihoodForASite(size_t site) const override
Get the likelihood for a site.
void init_()
Method called by constructors.
const DRASDRTreeLikelihoodData & likelihoodData() const override
void computeTreeLikelihood()
double getLogLikelihoodForASiteForARateClassForAState(size_t site, size_t rateClass, int state) const override
Get the logarithm of the likelihood for a site knowing its rate class and its ancestral state.
virtual void computeTreeDLikelihoodAtNode(const Node *node)
void setParameters(const ParameterList ¶meters) override
Implements the Function interface.
virtual void displayLikelihood(const Node *node)
This method is mainly for debugging purpose.
virtual void computeTreeDLikelihoods()
virtual void computeTreeD2LikelihoodAtNode(const Node *node)
virtual void computeTreeD2Likelihoods()
virtual void computeLikelihoodAtNode_(const Node *node, VVVdouble &likelihoodArray, const Node *sonNode=0) const
double getLogLikelihood() const override
Get the logarithm of the likelihood for the whole dataset.
double getSecondOrderDerivative(const std::string &variable1, const std::string &variable2) const override
DRHomogeneousTreeLikelihood(const Tree &tree, std::shared_ptr< TransitionModelInterface > model, std::shared_ptr< DiscreteDistributionInterface > rDist, bool checkRooted=true, bool verbose=true)
Build a new DRHomogeneousTreeLikelihood object without data.
virtual void computeSubtreeLikelihoodPrefix(const Node *node)
virtual void computeRootLikelihood()
double getLogLikelihoodForASite(size_t site) const override
Get the logarithm of the likelihood for a site.
void setData(const AlignmentDataInterface &sites) override
Set the dataset for which the likelihood must be evaluated.
std::unique_ptr< DRASDRTreeLikelihoodData > likelihoodData_
size_t getSiteIndex(size_t site) const override
Get the index (used for inner computations) of a given site (original alignment column).
DRHomogeneousTreeLikelihood & operator=(const DRHomogeneousTreeLikelihood &lik)
DRASDRTreeLikelihoodData & likelihoodData() override
double getLogLikelihoodForASiteForARateClass(size_t site, size_t rateClass) const override
Get the logarithm of the likelihood for a site knowing its rate class.
virtual void computeSubtreeLikelihoodPostfix(const Node *node)
Interface for double-recursive (DR) implementation of the likelihood computation.
The phylogenetic node class.
Interface for phylogenetic tree objects.
Defines the basic types of data flow nodes.
std::vector< VVdouble > VVVdouble