5 #ifndef BPP_PHYL_MODEL_ABSTRACTWRAPPEDMODEL_H
6 #define BPP_PHYL_MODEL_ABSTRACTWRAPPEDMODEL_H
67 virtual std::string
getName()
const override
151 std::map<int, double> freqs;
157 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.
void setScalable(bool scalable)
sets if model is scalable, ie scale can be changed. Default : true, set to false to avoid normalizati...
const Vdouble & getIEigenValues() const
bool isDiagonalizable() const
bool isScalable() const
returns if model is scalable
const Matrix< double > & getRowLeftEigenVectors() const
const Matrix< double > & getColumnRightEigenVectors() const
const Matrix< double > & generator() const
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.
virtual ~AbstractTotallyWrappedSubstitutionModel()
bool isNonSingular() const
const Vdouble & getEigenValues() const
void enableEigenDecomposition(bool yn)
Set if eigenValues and Vectors must be computed.
double getScale() const
Get the scalar product of diagonal elements of the generator and the frequencies vector....
const Matrix< double > & exchangeabilityMatrix() const
AbstractTotallyWrappedSubstitutionModel(const std::string &prefix)
double getRate() const override
Get the rate.
virtual ~AbstractTotallyWrappedTransitionModel()
void computeFrequencies(bool yn) override
double Pij_t(size_t i, size_t j, double t) const override
const Matrix< double > & getPij_t(double t) const override
const Vdouble & getFrequencies() 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
double d2Pij_dt2(size_t i, size_t j, 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.
Vdouble & getFrequencies_() override
const Matrix< double > & getdPij_dt(double t) const override
const Matrix< double > & getd2Pij_dt2(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::vector< size_t > getModelStates(int code) const override
Get the state in the model corresponding to a particular state in the alphabet.
std::string getAlphabetStateAsChar(size_t i) const override
virtual std::string getName() const override
Get the name of the model.
const Alphabet & alphabet() const override
const std::vector< int > & getAlphabetStates() const override
const FrequencySetInterface & frequencySet() const override
std::shared_ptr< const StateMapInterface > getStateMap() const override
std::shared_ptr< const Alphabet > getAlphabet() const override
virtual ~AbstractWrappedModel()
const StateMapInterface & stateMap() const override
size_t getNumberOfStates() const override
Get the number of states.
int getAlphabetStateAsInt(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.
TransitionModelInterface & transitionModel_()
virtual ~AbstractWrappedSubstitutionModel()
const TransitionModelInterface & transitionModel() const
virtual SubstitutionModelInterface & substitutionModel_()=0
AbstractWrappedSubstitutionModel(const std::string &prefix)
const BranchModelInterface & model() const override
virtual TransitionModelInterface & transitionModel_()=0
const FrequencySetInterface & frequencySet() const override
AbstractWrappedTransitionModel(const std::string &prefix)
BranchModelInterface & model_()
Interface for all Branch models.
virtual int getAlphabetStateAsInt(size_t index) 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 const StateMapInterface & stateMap() const =0
virtual const Alphabet & alphabet() 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 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 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.
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 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 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
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 double dPij_dt(size_t i, size_t j, double t) const =0
virtual Vdouble & getFrequencies_()=0
virtual bool computeFrequencies() const =0
virtual const Matrix< double > & getdPij_dt(double t) 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