40 #ifndef _ABSTRACTBIBLIOSUBSTITUTIONMODEL_H_ 41 #define _ABSTRACTBIBLIOSUBSTITUTIONMODEL_H_ 46 #include <Bpp/Numeric/AbstractParameterAliasable.h> 59 public AbstractParameterAliasable
81 #ifndef NO_VIRTUAL_COV 149 void setFreqFromData(
const SequenceContainer& data,
double pseudoCount = 0);
151 void setFreq(std::map<int, double>& frequ);
179 AbstractParameterAliasable::fireParameterChanged(parameters);
180 if (parameters.size() > 1 || (parameters.size() == 1 && parameters[0].getName() != getNamespace() +
"rate")) {
201 #endif // _ABSTRACTBIBLIOSUBSTITUTIONMODEL_H_ AbstractBiblioSubstitutionModel(const std::string &prefix)
Interface for all substitution models.
std::map< std::string, std::string > mapParNamesFromPmodel_
Tools to make the link between the Parameters of the object and those of pmixmodel_.
virtual std::vector< size_t > getModelStates(int code) const =0
Get the state in the model corresponding to a particular state in the alphabet.
virtual int getAlphabetStateAsInt(size_t index) const =0
virtual const Matrix< double > & getExchangeabilityMatrix() const =0
ParameterList lParPmodel_
const Matrix< double > & getColumnRightEigenVectors() const
virtual double getInitValue(size_t i, int state) const =0
const Matrix< double > & getGenerator() const
virtual const StateMap & getStateMap() const =0
size_t getNumberOfStates() const
Get the number of states.
virtual const std::vector< int > & getAlphabetStates() const =0
Partial implementation of the SubstitutionModel interface for models that are set for matching the bi...
const Alphabet * getAlphabet() const
void enableEigenDecomposition(bool yn)
Set if eigenValues and Vectors must be computed.
virtual double Qij(size_t i, size_t j) const
void setRate(double rate)
Set the rate of the model (must be positive).
virtual const Vdouble & getFrequencies() const
virtual void updateMatrices()
virtual const FrequenciesSet * getFrequenciesSet() const
If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0.
virtual const Alphabet * getAlphabet() const =0
AbstractBiblioSubstitutionModel & operator=(const AbstractBiblioSubstitutionModel &model)
virtual double Sij(size_t i, size_t j) const =0
double getInitValue(size_t i, int state) const
const Matrix< double > & getdPij_dt(double t) const
std::string getAlphabetStateAsChar(size_t i) const
Parametrize a set of state frequencies.
std::vector< size_t > getModelStates(int code) const
Get the state in the model corresponding to a particular state in the alphabet.
virtual void setScale(double scale)=0
Multiplies the current generator by the given scale.
virtual void setRate(double rate)=0
Set the rate of the model (must be positive).
virtual const Vdouble & getFrequencies() const =0
virtual const Matrix< double > & getd2Pij_dt2(double t) const =0
const std::vector< int > & getAlphabetStates() const
virtual AbstractBiblioSubstitutionModel * clone() const =0
virtual double dPij_dt(size_t i, size_t j, double t) const
virtual void enableEigenDecomposition(bool yn)=0
Set if eigenValues and Vectors must be computed.
virtual double d2Pij_dt2(size_t i, size_t j, double t) const =0
virtual const Vdouble & getEigenValues() const =0
const Matrix< double > & getd2Pij_dt2(double t) const
virtual const Matrix< double > & getPij_t(double t) const =0
const StateMap & getStateMap() const
virtual double Pij_t(size_t i, size_t j, double t) const =0
bool isDiagonalizable() const
virtual double Qij(size_t i, size_t j) const =0
virtual const Matrix< double > & getGenerator() const =0
virtual bool isDiagonalizable() const =0
void setFreqFromData(const SequenceContainer &data, double pseudoCount=0)
Set equilibrium frequencies equal to the frequencies estimated from the data.
virtual void fireParameterChanged(const ParameterList ¶meters)
Tells the model that a parameter value has changed.
virtual double d2Pij_dt2(size_t i, size_t j, double t) const
void setScale(double scale)
Multiplies the current generator by the given scale.
void setFreq(std::map< int, double > &frequ)
Set equilibrium frequencies.
const Matrix< double > & getRowLeftEigenVectors() const
virtual std::string getAlphabetStateAsChar(size_t index) const =0
const Matrix< double > & getPij_t(double t) const
virtual double getRate() const =0
Get the rate.
virtual const Matrix< double > & getRowLeftEigenVectors() const =0
double getScale() const
Get the scalar product of diagonal elements of the generator and the frequencies vector. If the generator is normalized, then scale=1. Otherwise each element must be multiplied by 1/scale.
double getRate() const
Get the rate.
virtual double freq(size_t i) const =0
virtual double getScale() const =0
Get the scalar product of diagonal elements of the generator and the frequencies vector. If the generator is normalized, then scale=1. Otherwise each element must be multiplied by 1/scale.
bool isNonSingular() const
int getAlphabetStateAsInt(size_t i) const
virtual const Matrix< double > & getdPij_dt(double t) const =0
const Vdouble & getIEigenValues() const
virtual double dPij_dt(size_t i, size_t j, double t) const =0
virtual const Matrix< double > & getColumnRightEigenVectors() const =0
virtual bool isNonSingular() const =0
virtual ~AbstractBiblioSubstitutionModel()
virtual size_t getNumberOfStates() const =0
Get the number of states.
Map the states of a given alphabet which have a model state.
virtual double Pij_t(size_t i, size_t j, double t) const
virtual const Vdouble & getIEigenValues() const =0
double Sij(size_t i, size_t j) const
virtual const SubstitutionModel & getModel() const =0
const FrequenciesSet * getFrequenciesSet() const
If the model owns a FrequenciesSet, returns a pointer to it, otherwise return 0.
const Matrix< double > & getExchangeabilityMatrix() const
bool enableEigenDecomposition()
Tell if eigenValues and Vectors must be computed.
std::vector< size_t > getModelStates(const std::string &code) const
Get the state in the model corresponding to a particular state in the alphabet.
const Vdouble & getEigenValues() const
virtual double freq(size_t i) const