40 #ifndef _ABSTRACTHOMOGENEOUSTREELIKELIHOOD_H_ 41 #define _ABSTRACTHOMOGENEOUSTREELIKELIHOOD_H_ 64 public ConstSiteModelIterator
78 throw Exception(
"AbstractHomogeneousTreeLikelihood::ConstHomogeneousSiteModelIterator::next(). No more site in the set.");
91 mutable std::map<int, VVVdouble>
pxy_;
93 mutable std::map<int, VVVdouble>
dpxy_;
95 mutable std::map<int, VVVdouble>
d2pxy_;
124 DiscreteDistribution* rDist,
125 bool checkRooted =
true,
152 DiscreteDistribution* rDist,
154 bool verbose)
throw (Exception);
236 throw Exception(
"AbstractHomogeneousTreeLikelihood::setMinimumBranchLength. Minimum branch length sould be lower than the maximum one: " + TextTools::toString(
maximumBrLen_));
246 throw Exception(
"AbstractHomogeneousTreeLikelihood::setMaximumBranchLength. Maximum branch length sould be higher than the minimum one: " + TextTools::toString(
minimumBrLen_));
270 #endif //_ABSTRACTHOMOGENEOUSTREELIKELIHOOD_H_ std::vector< double > rootFreqs_
Interface for all substitution models.
virtual void computeAllTransitionProbabilities()
Fill the pxy_, dpxy_ and d2pxy_ arrays for all nodes.
const std::vector< int > & getAlphabetStates() const
virtual int getAlphabetStateAsInt(size_t index) const =0
SubstitutionModel * getSubstitutionModel(int nodeId, size_t siteIndex)
Get the substitution model associated to a given node and alignment column.
VVVdouble getTransitionProbabilitiesPerRateClass(int nodeId, size_t siteIndex) const
Retrieves all Pij(t) for a particular branch, defined by the upper node.
virtual const std::vector< int > & getAlphabetStates() const =0
Partial implementation of the DiscreteRatesAcrossSitesTreeLikelihood interface.
std::map< int, VVVdouble > dpxy_
Specialization of the TreeLikelihood interface for the Homogeneous case.
Iterates through all models used for all sites on a given branch.
ConstSiteModelDescription * next()
const SubstitutionModel * getSubstitutionModel() const
virtual void initParameters()
This builds the parameters list from all parametrizable objects, i.e. substitution model...
ParameterList getRateDistributionParameters() const
Get the parameters associated to the rate distirbution.
Interface for phylogenetic tree objects.
ConstNoPartitionSiteModelDescription siteModelDescription_
ConstHomogeneousSiteModelIterator(const Tree &tree, const SubstitutionModel *model)
AbstractHomogeneousTreeLikelihood(const Tree &tree, SubstitutionModel *model, DiscreteDistribution *rDist, bool checkRooted=true, bool verbose=true)
SubstitutionModel * model_
void init_(const Tree &tree, SubstitutionModel *model, DiscreteDistribution *rDist, bool checkRooted, bool verbose)
Method called by constructor.
virtual void setMinimumBranchLength(double minimum)
virtual const Vdouble & getFrequencies() const =0
void initialize()
Init the likelihood object.
ParameterList getRateDistributionParameters() const
Get the parameters associated to the rate distirbution.
Iterates through all models used for all branches on a given site.
std::map< int, VVVdouble > d2pxy_
ConstSiteModelIterator * getNewSiteModelIterator(size_t siteIndex) const
std::string getAlphabetStateAsChar(size_t i) const
virtual void initBranchLengthsParameters()
virtual double getMaximumBranchLength() const
Exception thrown when something is wrong with a particular node.
TreeTemplate< Node > * tree_
ParameterList getSubstitutionModelParameters() const
Get the parameters associated to substitution model(s).
The phylogenetic node class.
int getAlphabetStateAsInt(size_t i) const
const SubstitutionModel * getSubstitutionModel(int nodeId, size_t siteIndex) const
Get the substitution model associated to a given node and alignment column.
virtual std::string getAlphabetStateAsChar(size_t index) const =0
void setSubstitutionModel(SubstitutionModel *model)
SubstitutionModel * getSubstitutionModel()
virtual void computeTransitionProbabilitiesForNode(const Node *node)
Fill the pxy_, dpxy_ and d2pxy_ arrays for one node.
std::vector< Node * > nodes_
Pointer toward all nodes in the tree.
std::map< int, VVVdouble > pxy_
ParameterList getBranchLengthsParameters() const
Get the branch lengths parameters.
virtual void applyParameters()
All parameters are stored in a parameter list. This function apply these parameters to the substituti...
A pair of SubstitutionModel / BranchIterator.
size_t getNumberOfStates() const
virtual size_t getNumberOfStates() const =0
Get the number of states.
virtual void setMaximumBranchLength(double maximum)
Partial implementation for homogeneous model of the TreeLikelihood interface.
std::auto_ptr< Constraint > brLenConstraint_
ConstBranchModelIterator * getNewBranchModelIterator(int nodeId) const
ParameterList brLenParameters_
const std::vector< double > & getRootFrequencies(size_t siteIndex) const
Get the values of the frequencies for each state in the alphabet at the root node.
virtual double getMinimumBranchLength() const