5#ifndef BPP_PHYL_MODEL_ABSTRACTWRAPPEDMODEL_H
6#define BPP_PHYL_MODEL_ABSTRACTWRAPPEDMODEL_H
67 virtual std::string
getName()
const override
150 std::map<int, double> freqs;
156 void setFreq(std::map<int, double>& frequencies)
override
Partial implementation of the TransitionModel interface, with function for likelihood computations.
double Sij(size_t i, size_t j) const
void setDiagonal()
set the diagonal of the generator such that sum on each line equals 0.
void setScale(double scale)
Multiplies the current generator by the given scale.
const Vdouble & getEigenValues() const
void setScalable(bool scalable)
sets if model is scalable, ie scale can be changed. Default : true, set to false to avoid normalizati...
const Matrix< double > & exchangeabilityMatrix() const
bool isDiagonalizable() const
bool isScalable() const
returns if model is scalable
bool enableEigenDecomposition()
Tell if eigenValues and Vectors must be computed.
void normalize()
Normalize the generator.
double Qij(size_t i, size_t j) const
Methods to supersede SubstitutionModel methods.
const Matrix< double > & getRowLeftEigenVectors() const
virtual ~AbstractTotallyWrappedSubstitutionModel()
bool isNonSingular() const
const Matrix< double > & generator() const
const Matrix< double > & getColumnRightEigenVectors() const
void enableEigenDecomposition(bool yn)
Set if eigenValues and Vectors must be computed.
const Vdouble & getIEigenValues() const
double getScale() const
Get the scalar product of diagonal elements of the generator and the frequencies vector....
AbstractTotallyWrappedSubstitutionModel(const std::string &prefix)
double getRate() const override
Get the rate.
virtual ~AbstractTotallyWrappedTransitionModel()
void computeFrequencies(bool yn) override
Set if equilibrium frequencies should be computed from the generator.
double Pij_t(size_t i, size_t j, double t) const override
void setFreqFromData(const SequenceDataInterface &data, double pseudoCount=0) override
Set equilibrium frequencies equal to the frequencies estimated from the data.
double getInitValue(size_t i, int state) const override
const Matrix< double > & getd2Pij_dt2(double t) const override
double d2Pij_dt2(size_t i, size_t j, double t) const override
const Matrix< double > & getPij_t(double t) const override
double freq(size_t i) const override
Methods to supersede TransitionModel methods.
void setFreq(std::map< int, double > &frequencies) override
Set equilibrium frequencies.
const Vdouble & getFrequencies() const override
Vdouble & getFrequencies_() override
const Matrix< double > & getdPij_dt(double t) const override
void setRate(double rate) override
Set the rate of the model (must be positive).
AbstractTotallyWrappedTransitionModel(const std::string &prefix)
double dPij_dt(size_t i, size_t j, double t) const override
bool computeFrequencies() const override
Abstract class of Wrapping model class, where all methods are redirected from model().
AbstractWrappedModel(const std::string &prefix)
std::shared_ptr< const StateMapInterface > getStateMap() const override
const Alphabet & alphabet() const override
const std::vector< int > & getAlphabetStates() const override
std::shared_ptr< const Alphabet > getAlphabet() const override
std::string getAlphabetStateAsChar(size_t i) const override
std::vector< size_t > getModelStates(const std::string &code) const override
Get the state in the model corresponding to a particular state in the alphabet.
virtual std::string getName() const override
Get the name of the model.
std::vector< size_t > getModelStates(int code) const override
Get the state in the model corresponding to a particular state in the alphabet.
virtual ~AbstractWrappedModel()
const FrequencySetInterface & frequencySet() const override
const StateMapInterface & stateMap() const override
size_t getNumberOfStates() const override
Get the number of states.
int getAlphabetStateAsInt(size_t i) const override
virtual ~AbstractWrappedSubstitutionModel()
virtual SubstitutionModelInterface & substitutionModel_()=0
const TransitionModelInterface & transitionModel() const
TransitionModelInterface & transitionModel_()
AbstractWrappedSubstitutionModel(const std::string &prefix)
const BranchModelInterface & model() const override
virtual TransitionModelInterface & transitionModel_()=0
BranchModelInterface & model_()
const FrequencySetInterface & frequencySet() const override
AbstractWrappedTransitionModel(const std::string &prefix)
Interface for all Branch models.
virtual int getAlphabetStateAsInt(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 const FrequencySetInterface & frequencySet() const =0
virtual const std::vector< int > & getAlphabetStates() const =0
virtual std::string getAlphabetStateAsChar(size_t index) const =0
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
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 double getInitValue(size_t i, int state) const =0
virtual const Alphabet & alphabet() const =0
virtual std::shared_ptr< const StateMapInterface > getStateMap() const =0
virtual const StateMapInterface & stateMap() const =0
Parametrize a set of state frequencies.
Map the states of a given alphabet which have a model state.
Interface for all substitution models.
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 > & generator() const =0
virtual void enableEigenDecomposition(bool yn)=0
Set if eigenValues and Vectors must be computed.
virtual void normalize()=0
Normalize the generator.
virtual const Vdouble & getIEigenValues() const =0
virtual double getScale() const =0
Get the scalar product of diagonal elements of the generator and the frequencies vector....
virtual double Sij(size_t i, size_t j) const =0
virtual const Matrix< double > & getColumnRightEigenVectors() const =0
virtual bool isScalable() const =0
returns if model is scalable
virtual const Matrix< double > & exchangeabilityMatrix() const =0
virtual const Matrix< double > & getRowLeftEigenVectors() const =0
virtual void setDiagonal()=0
set the diagonal of the generator such that sum on each line equals 0.
virtual bool isNonSingular() 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.
virtual const Vdouble & getEigenValues() const =0
Interface for all transition models.
virtual Vdouble & getFrequencies_()=0
virtual const Matrix< double > & getPij_t(double t) const =0
virtual const Matrix< double > & getdPij_dt(double t) const =0
virtual const Vdouble & getFrequencies() const =0
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 > & getd2Pij_dt2(double t) const =0
virtual void setFreq(std::map< int, double > &frequencies)=0
Set equilibrium frequencies.
virtual double dPij_dt(size_t i, size_t j, double t) const =0
virtual bool computeFrequencies() const =0
Wrapping model interface.
virtual const BranchModelInterface & model() const =0
virtual const SubstitutionModelInterface & substitutionModel() const =0
virtual const TransitionModelInterface & transitionModel() const =0
Defines the basic types of data flow nodes.
std::vector< double > Vdouble