40 #ifndef _ABSTRACTTREELIKELIHOOD_H_ 41 #define _ABSTRACTTREELIKELIHOOD_H_ 45 #include "../TreeTemplate.h" 47 #include <Bpp/Numeric/AbstractParametrizable.h> 50 #include <Bpp/Seq/Container/SiteContainer.h> 71 public AbstractParametrizable
91 int next() throw (Exception)
94 throw Exception(
"AbstractTreeLikelihood::SimpleBranchIterator::next(). No more branch in the set.");
122 size_t next() throw (Exception)
125 throw Exception(
"AbstractTreeLikelihood::SimpleSiteIterator::next(). No more site in the set.");
182 throw Exception(
"AbstractHomogeneousTreeLikelihood::ConstHomogeneousBranchModelIterator::next(). No more branch in the set.");
233 AbstractParametrizable(
""),
241 AbstractParametrizable(lik),
248 if (lik.
data_)
data_ =
dynamic_cast<SiteContainer*
>(lik.
data_->clone());
254 AbstractParametrizable::operator=(lik);
256 if (lik.
data_)
data_ =
dynamic_cast<SiteContainer*
>(lik.
data_->clone());
316 #endif //_ABSTRACTTREELIKELIHOOD_H_ A pair of SubstitutionModel / SiteIterator.
ConstNoPartitionSiteModelDescription & operator=(const ConstNoPartitionSiteModelDescription &smd)
ConstNoPartitionSiteModelDescription(const ConstNoPartitionSiteModelDescription &smd)
ConstNoPartitionSiteModelDescription(const SubstitutionModel *model, const std::vector< int > nodesId)
Interface for all substitution models.
const SubstitutionModel * getModel() const
SimpleSiteIterator(size_t nbSites, size_t offset=0)
std::vector< int > nodesId_
const SubstitutionModel * getModel() const
ConstNoPartitionBranchModelDescription branchModelDescription_
virtual ~AbstractTreeLikelihood()
Abstract class destructor.
An iterator over a set of sites, speicfied by their position.
Iterates through all models used for all sites on a given branch.
VVdouble getLogLikelihoodForEachSiteForEachState() const
Get the logarithm of the likelihood for each site and for each state.
const SiteContainer * getData() const
Get the dataset for which the likelihood must be evaluated.
BranchIterator * getNewBranchIterator() const
The TreeLikelihood interface.
const SubstitutionModel * model_
void enableDerivatives(bool yn)
Tell if derivatives must be computed.
const SubstitutionModel * model_
The phylogenetic tree class.
Vdouble getLogLikelihoodForEachSite() const
Get the logarithm of the likelihood for each site.
Interface for phylogenetic tree objects.
ConstNoPartitionBranchModelIterator(const SubstitutionModel *model, size_t nbSites)
ConstNoPartitionBranchModelDescription(const SubstitutionModel *model, size_t nbSites)
AbstractTreeLikelihood & operator=(const AbstractTreeLikelihood &lik)
bool enableFirstOrderDerivatives() const
ConstNoPartitionBranchModelDescription(const ConstNoPartitionBranchModelDescription &bmd)
VVdouble getLikelihoodForEachSiteForEachState() const
Get the likelihood for each site and for each state.
Partial implementation of the TreeLikelihood interface.
A very simple branch iterator.
bool enableSecondOrderDerivatives() const
AbstractTreeLikelihood(const AbstractTreeLikelihood &lik)
bool computeFirstOrderDerivatives_
Vdouble getLikelihoodForEachSite() const
Get the likelihood for each site.
TreeTemplate< Node > * tree_
size_t getNumberOfSites() const
Get the number of sites in the dataset.
void enableSecondOrderDerivatives(bool yn)
const Alphabet * getAlphabet() const
Get the alphabet associated to the dataset.
const Tree & getTree() const
Get the tree (topology and branch lengths).
An iterator over a set of branches, specified by their node ids.
std::vector< int > nodesId_
SimpleBranchIterator(const std::vector< int > &nodesId)
const SiteContainer * data_
ConstNoPartitionBranchModelDescription * next()
A pair of SubstitutionModel / BranchIterator.
ConstNoPartitionBranchModelDescription & operator=(const ConstNoPartitionBranchModelDescription &bmd)
void enableFirstOrderDerivatives(bool yn)
bool isInitialized() const
void initialize()
Init the likelihood object.
bool computeSecondOrderDerivatives_
A very simple site iterator.
SiteIterator * getNewSiteIterator() const