5 #ifndef BPP_PHYL_LEGACY_LIKELIHOOD_TREELIKELIHOOD_H
6 #define BPP_PHYL_LEGACY_LIKELIHOOD_TREELIKELIHOOD_H
13 #include "../../Model/SubstitutionModel.h"
82 virtual std::shared_ptr<const TransitionModelInterface>
getModel()
const = 0;
113 virtual std::shared_ptr<const TransitionModelInterface>
getModel()
const = 0;
330 virtual std::shared_ptr<const TransitionModelInterface>
getModelForSite(
int nodeId,
size_t siteIndex)
const = 0;
341 virtual std::shared_ptr<TransitionModelInterface>
getModelForSite(
int nodeId,
size_t siteIndex) = 0;
Interface for all substitution models.
Interface for all transition models.
TreeLikelihood data structure.
An iterator over a set of branches, specified by their node ids.
virtual bool hasNext() const =0
virtual ~BranchIterator()
A pair of SubstitutionModel / SiteIterator.
virtual std::shared_ptr< const SubstitutionModelInterface > getSubstitutionModel() const =0
virtual std::shared_ptr< const TransitionModelInterface > getModel() const =0
virtual const SubstitutionModelInterface & substitutionModel() const =0
virtual ~ConstBranchModelDescription()
virtual const TransitionModelInterface & model() const =0
virtual SiteIterator * getNewSiteIterator() const =0
Iterates through all models used for all sites on a given branch.
virtual ~ConstBranchModelIterator()
virtual ConstBranchModelDescription * next()=0
virtual bool hasNext() const =0
A pair of SubstitutionModel / BranchIterator.
virtual ~ConstSiteModelDescription()
virtual const TransitionModelInterface & model() const =0
virtual const SubstitutionModelInterface & substitutionModel() const =0
virtual std::shared_ptr< const TransitionModelInterface > getModel() const =0
virtual BranchIterator * getNewBranchIterator() const =0
virtual std::shared_ptr< const SubstitutionModelInterface > getSubstitutionModel() const =0
Iterates through all models used for all branches on a given site.
virtual ConstSiteModelDescription * next()=0
virtual bool hasNext() const =0
virtual ~ConstSiteModelIterator()
An iterator over a set of sites, specified by their position.
virtual bool hasNext() const =0
The TreeLikelihood interface.
virtual size_t getNumberOfStates() const =0
virtual ~TreeLikelihoodInterface()
virtual TreeLikelihoodData & likelihoodData()=0
virtual std::shared_ptr< const TransitionModelInterface > getModelForSite(int nodeId, size_t siteIndex) const =0
Get the substitution model associated to a given node and alignment column.
virtual const std::vector< int > & getAlphabetStates() const =0
virtual bool isInitialized() const =0
virtual double getLikelihoodForASiteForAState(size_t site, int state) const =0
Get the likelihood for a site and for a state.
virtual size_t getNumberOfSites() const =0
Get the number of sites in the dataset.
virtual double getLogLikelihoodForASite(size_t site) const =0
Get the logarithm of the likelihood for a site.
virtual Vdouble getLikelihoodPerSite() const =0
Get the likelihood for each site.
virtual ConstBranchModelIterator * getNewBranchModelIterator(int nodeId) const =0
virtual const std::vector< double > & getRootFrequencies(size_t siteIndex) const =0
Get the values of the frequencies for each state in the alphabet at the root node.
virtual ParameterList getSubstitutionModelParameters() const =0
Get the parameters associated to substitution model(s).
virtual bool hasLikelihoodData() const =0
virtual int getAlphabetStateAsInt(size_t i) const =0
virtual double getLikelihoodForASite(size_t site) const =0
Get the likelihood for a site.
virtual double getLogLikelihood() const =0
Get the logarithm of the likelihood for the whole dataset.
virtual ParameterList getDerivableParameters() const =0
All derivable parameters.
virtual void initialize()=0
Init the likelihood object.
virtual double getLogLikelihoodForASiteForAState(size_t site, int state) const =0
Get the logarithm of the likelihood for a site and for a state.
virtual const AlignmentDataInterface & data() const =0
Get the dataset for which the likelihood must be evaluated.
virtual size_t getSiteIndex(size_t site) const =0
Get the index (used for inner computations) of a given site (original alignment column).
virtual VVdouble getLogLikelihoodPerSitePerState() const =0
Get the logarithm of the likelihood for each site and for each state.
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
Get the alphabet associated to the dataset.
virtual const TreeLikelihoodData & likelihoodData() const =0
virtual std::string getAlphabetStateAsChar(size_t i) const =0
TreeLikelihoodInterface * clone() const override=0
virtual ParameterList getNonDerivableParameters() const =0
All non derivable parameters.
virtual void setData(const AlignmentDataInterface &sites)=0
Set the dataset for which the likelihood must be evaluated.
TreeLikelihoodInterface()
virtual double getLikelihood() const =0
Get the likelihood for the whole dataset.
virtual const Tree & tree() const =0
Get the tree (topology and branch lengths).
virtual void enableDerivatives(bool yn)=0
Tell if derivatives must be computed.
virtual std::shared_ptr< TransitionModelInterface > getModelForSite(int nodeId, size_t siteIndex)=0
Get the substitution model associated to a given node and alignment column.
virtual Vdouble getLogLikelihoodPerSite() const =0
Get the logarithm of the likelihood for each site.
virtual ParameterList getBranchLengthsParameters() const =0
Get the branch lengths parameters.
virtual ConstSiteModelIterator * getNewSiteModelIterator(size_t siteIndex) const =0
virtual VVdouble getTransitionProbabilities(int nodeId, size_t siteIndex) const =0
Retrieves all Pij(t) for a particular branch, defined by the upper node and site.
virtual VVdouble getLikelihoodPerSitePerState() const =0
Get the likelihood for each site and for each state.
Interface for phylogenetic tree objects.
Defines the basic types of data flow nodes.
std::vector< double > Vdouble
std::vector< Vdouble > VVdouble