40 #ifndef _ABSTRACTMIXEDSUBSTITUTIONMODEL_H_ 41 #define _ABSTRACTMIXEDSUBSTITUTIONMODEL_H_ 145 virtual void setRate(
double rate);
157 virtual void setVRates(
const Vdouble& vd);
199 if ((prob >= 0) && (prob <= 1))
207 double Qij(
size_t i,
size_t j)
const {
return 0; }
216 virtual const Matrix<double>&
getPij_t(
double t)
const;
217 virtual const Matrix<double>&
getdPij_dt(
double t)
const;
218 virtual const Matrix<double>&
getd2Pij_dt2(
double t)
const;
222 #endif // _ABSTRACTMIXEDSUBSTITUTIONMODEL_H_ Interface for all substitution models.
virtual const Matrix< double > & getd2Pij_dt2(double t) const
virtual AbstractMixedSubstitutionModel * clone() const =0
virtual size_t getNumberOfModels() const
returns the number of models in the mixture
virtual void setVRates(const Vdouble &vd)
Sets the rates of the submodels to be proportional to a given vector, with the constraint that the me...
virtual void normalizeVRates()
Normalizes the rates of the submodels so that the mean rate of the mixture equals rate_...
Partial implementation of the SubstitutionModel interface.
Partial implementation for Mixed Substitution models, defined as a mixture of "simple" substitution m...
double getNRate(size_t i) const
Returns the rate of a specific model from the mixture.
virtual const Matrix< double > & getdPij_dt(double t) const
virtual double getNProbability(size_t i) const
Returns the probability of a specific model from the mixture.
virtual const std::vector< double > & getProbabilities() const
Returns the vector of probabilities.
virtual const Matrix< double > & getPij_t(double t) const
AbstractMixedSubstitutionModel & operator=(const AbstractMixedSubstitutionModel &)
virtual void setNProbability(size_t i, double prob)
Sets the probability of a specific model from the mixture.
virtual void setRate(double rate)
Set the rate of the model and the submodels.
const std::vector< double > & getVRates() const
Returns the vector of all the rates of the mixture.
std::vector< double > vRates_
vector of the rates of the models.
double Qij(size_t i, size_t j) const
This function can not be applied here, so it is defined to prevent wrong usage.
virtual const SubstitutionModel * getNModel(size_t i) const
Returns a specific model from the mixture.
AbstractMixedSubstitutionModel(const Alphabet *, StateMap *stateMap, const std::string &prefix)
Map the states of a given alphabet which have a model state.
virtual SubstitutionModel * getNModel(size_t i)
virtual size_t getNumberOfStates() const
From SubstitutionModel interface.
std::vector< SubstitutionModel * > modelsContainer_
vector of pointers to SubstitutionModels.
std::vector< double > vProbas_
vector of the probabilities of the models
Interface for Substitution models, defined as a mixture of "simple" substitution models.
virtual ~AbstractMixedSubstitutionModel()