5 #ifndef BPP_PHYL_MODEL_SUBSTITUTIONMODEL_H
6 #define BPP_PHYL_MODEL_SUBSTITUTIONMODEL_H
71 virtual std::shared_ptr<const StateMapInterface>
getStateMap()
const = 0;
87 virtual std::vector<size_t>
getModelStates(
const std::string& code)
const = 0;
152 virtual const Eigen::VectorXd&
Lik_t(
const Eigen::VectorXd& values,
double t)
const = 0;
153 virtual const Eigen::VectorXd&
dLik_dt(
const Eigen::VectorXd& values,
double t)
const = 0;
154 virtual const Eigen::VectorXd&
d2Lik_dt2(
const Eigen::VectorXd& values,
double t)
const = 0;
203 virtual double freq(
size_t i)
const = 0;
209 virtual double Pij_t(
size_t i,
size_t j,
double t)
const = 0;
216 virtual double dPij_dt(
size_t i,
size_t j,
double t)
const = 0;
223 virtual double d2Pij_dt2(
size_t i,
size_t j,
double t)
const = 0;
270 virtual const Eigen::VectorXd&
Lik_t(
const Eigen::VectorXd& values,
double t)
const = 0;
272 virtual const Eigen::VectorXd&
dLik_dt(
const Eigen::VectorXd& values,
double t)
const = 0;
274 virtual const Eigen::VectorXd&
d2Lik_dt2(
const Eigen::VectorXd& values,
double t)
const = 0;
295 virtual void setFreq(std::map<int, double>& frequencies) = 0;
422 virtual double Qij(
size_t i,
size_t j)
const = 0;
453 virtual double Sij(
size_t i,
size_t j)
const = 0;
Virtual class of a Transition Model related to a given SubstitutionModel.
Interface for all Branch models.
virtual int getAlphabetStateAsInt(size_t index) const =0
virtual ~BranchModelInterface()
virtual std::vector< size_t > getModelStates(const std::string &code) const =0
Get the state in the model corresponding to a particular state in the alphabet.
BranchModelInterface * clone() const =0
virtual const Eigen::VectorXd & d2Lik_dt2(const Eigen::VectorXd &values, double t) const =0
virtual const FrequencySetInterface & frequencySet() const =0
virtual const std::vector< int > & getAlphabetStates() const =0
virtual std::string getAlphabetStateAsChar(size_t index) const =0
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 void setRate(double rate)=0
Set the rate of the model (must be positive).
virtual size_t getNumberOfStates() const =0
Get the number of states.
virtual std::string getName() const =0
Get the name of the model.
virtual double getRate() const =0
Get the rate.
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
virtual std::shared_ptr< const StateMapInterface > getStateMap() const =0
virtual double getInitValue(size_t i, int state) const =0
virtual void addRateParameter()=0
virtual const Eigen::VectorXd & Lik_t(const Eigen::VectorXd &values, double t) const =0
virtual const StateMapInterface & stateMap() const =0
virtual const Alphabet & alphabet() const =0
virtual const Eigen::VectorXd & dLik_dt(const Eigen::VectorXd &values, double t) const =0
Parametrize a set of state frequencies.
SubModel taken from a MixedTransitionModel, kept in the context of the MixedTransitionModel (see From...
Interface for reversible substitution models.
ReversibleSubstitutionModelInterface()
ReversibleSubstitutionModelInterface * clone() const override=0
virtual ~ReversibleSubstitutionModelInterface()
Map the states of a given alphabet which have a model state.
Interface for all substitution models.
virtual const Vdouble & getIEigenValues() const =0
virtual bool isDiagonalizable() const =0
virtual void setScalable(bool scalable)=0
sets if model is scalable, ie scale can be changed. Default : true, set to false to avoid normalizati...
virtual const Matrix< double > & getColumnRightEigenVectors() const =0
virtual ~SubstitutionModelInterface()
virtual void enableEigenDecomposition(bool yn)=0
Set if eigenValues and Vectors must be computed.
virtual const Matrix< double > & generator() const =0
virtual void normalize()=0
Normalize the generator.
SubstitutionModelInterface * clone() const override=0
virtual double getScale() const =0
Get the scalar product of diagonal elements of the generator and the frequencies vector....
virtual bool enableEigenDecomposition()=0
Tell if eigenValues and Vectors must be computed.
SubstitutionModelInterface()
virtual double Sij(size_t i, size_t j) const =0
virtual bool isScalable() const =0
returns if model is scalable
virtual const Vdouble & getEigenValues() const =0
virtual void setDiagonal()=0
set the diagonal of the generator such that sum on each line equals 0.
virtual const Matrix< double > & getRowLeftEigenVectors() const =0
virtual bool isNonSingular() const =0
virtual const Matrix< double > & exchangeabilityMatrix() const =0
virtual void setScale(double scale)=0
Multiplies the current generator by the given scale.
virtual double Qij(size_t i, size_t j) const =0
A method for computing all necessary matrices.
Interface for all transition models.
virtual const Eigen::VectorXd & dLik_dt(const Eigen::VectorXd &values, double t) const =0
virtual const Eigen::VectorXd & d2Lik_dt2(const Eigen::VectorXd &values, double t) const =0
TransitionModelInterface()
virtual double Pij_t(size_t i, size_t j, double t) const =0
virtual double freq(size_t i) const =0
virtual double d2Pij_dt2(size_t i, size_t j, double t) const =0
virtual const Matrix< double > & getPij_t(double t) const =0
TransitionModelInterface * clone() const =0
virtual const Vdouble & getFrequencies() const =0
virtual void setFreq(std::map< int, double > &frequencies)=0
Set equilibrium frequencies.
virtual const Matrix< double > & getd2Pij_dt2(double t) const =0
virtual ~TransitionModelInterface()
virtual void computeFrequencies(bool yn)=0
virtual double dPij_dt(size_t i, size_t j, double t) const =0
virtual Vdouble & getFrequencies_()=0
virtual void setFreqFromData(const SequenceDataInterface &data, double pseudoCount=0)=0
Set equilibrium frequencies equal to the frequencies estimated from the data.
virtual bool computeFrequencies() const =0
virtual const Matrix< double > & getdPij_dt(double t) const =0
virtual const Eigen::VectorXd & Lik_t(const Eigen::VectorXd &values, double t) const =0
Defines the basic types of data flow nodes.
std::vector< double > Vdouble