40 #ifndef _TREELIKELIHOOD_H_ 41 #define _TREELIKELIHOOD_H_ 45 #include "../Model/SubstitutionModel.h" 48 #include <Bpp/Numeric/ParameterList.h> 49 #include <Bpp/Numeric/Parametrizable.h> 50 #include <Bpp/Numeric/Function/Functions.h> 51 #include <Bpp/Numeric/VectorTools.h> 54 #include <Bpp/Seq/Alphabet/Alphabet.h> 55 #include <Bpp/Seq/Container/SiteContainer.h> 67 public virtual DerivableSecondOrder
82 virtual int next() throw (Exception) = 0;
86 virtual
bool hasNext() const = 0;
103 virtual size_t next() throw (Exception) = 0;
107 virtual
bool hasNext() const = 0;
133 virtual
bool hasNext() const = 0;
159 virtual
bool hasNext() const = 0;
166 #ifndef NO_VIRTUAL_COV 177 virtual void setData(
const SiteContainer& sites) = 0;
184 virtual const SiteContainer*
getData()
const = 0;
194 virtual void initialize() throw (Exception) = 0;
392 virtual
size_t getSiteIndex(
size_t site) const throw (IndexOutOfBoundsException) = 0;
442 #endif //_TREELIKELIHOOD_H_ virtual const Alphabet * getAlphabet() const =0
Get the alphabet associated to the dataset.
A pair of SubstitutionModel / SiteIterator.
virtual void setData(const SiteContainer &sites)=0
Set the dataset for which the likelihood must be evaluated.
virtual ~BranchIterator()
Interface for all substitution models.
virtual ~ConstBranchModelIterator()
virtual const SiteContainer * getData() const =0
Get the dataset for which the likelihood must be evaluated.
virtual ~ConstSiteModelDescription()
virtual ParameterList getBranchLengthsParameters() const =0
Get the branch lengths parameters.
TreeLikelihood * clone() const =0
An iterator over a set of sites, speicfied by their position.
Iterates through all models used for all sites on a given branch.
virtual Vdouble getLikelihoodForEachSite() const =0
Get the likelihood for each site.
The TreeLikelihood interface.
virtual size_t getNumberOfStates() const =0
TreeLikelihood data structure.
virtual std::string getAlphabetStateAsChar(size_t i) const =0
virtual int getAlphabetStateAsInt(size_t i) 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 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 double getLikelihoodForASiteForAState(size_t site, int state) const =0
Get the likelihood for a site and for a state.
Interface for phylogenetic tree objects.
virtual const std::vector< int > & getAlphabetStates() const =0
virtual double getLogLikelihoodForASite(size_t site) const =0
Get the logarithm of the likelihood for a site.
virtual ConstSiteModelIterator * getNewSiteModelIterator(size_t siteIndex) const =0
virtual double getLogLikelihoodForASiteForAState(size_t site, int state) const =0
Get the logarithm of the likelihood for a site and for a state.
virtual ConstBranchModelIterator * getNewBranchModelIterator(int nodeId) const =0
virtual size_t getNumberOfSites() const =0
Get the number of sites in the dataset.
Iterates through all models used for all branches on a given site.
virtual ~ConstBranchModelDescription()
virtual TreeLikelihoodData * getLikelihoodData()=0
virtual ParameterList getNonDerivableParameters() const =0
All non derivable parameters.
virtual const Tree & getTree() const =0
Get the tree (topology and branch lengths).
virtual double getLikelihoodForASite(size_t site) const =0
Get the likelihood for a site.
virtual const SubstitutionModel * getSubstitutionModel(int nodeId, size_t siteIndex) const =0
Get the substitution model associated to a given node and alignment column.
virtual VVdouble getLogLikelihoodForEachSiteForEachState() const =0
Get the logarithm of the likelihood for each site and for each state.
Exception thrown when something is wrong with a particular node.
virtual size_t getSiteIndex(size_t site) const =0
Get the index (used for inner computations) of a given site (original alignment column).
virtual bool isInitialized() const =0
virtual ParameterList getDerivableParameters() const =0
All derivable parameters.
virtual void enableDerivatives(bool yn)=0
Tell if derivatives must be computed.
An iterator over a set of branches, specified by their node ids.
virtual double getLikelihood() const =0
Get the likelihood for the whole dataset.
virtual double getLogLikelihood() const =0
Get the logarithm of the likelihood for the whole dataset.
A pair of SubstitutionModel / BranchIterator.
virtual void initialize()=0
Init the likelihood object.
virtual ~ConstSiteModelIterator()
virtual ~TreeLikelihood()
virtual bool hasNext() const =0
virtual Vdouble getLogLikelihoodForEachSite() const =0
Get the logarithm of the likelihood for each site.
virtual VVdouble getLikelihoodForEachSiteForEachState() const =0
Get the likelihood for each site and for each state.
virtual ParameterList getSubstitutionModelParameters() const =0
Get the parameters associated to substitution model(s).