5 #ifndef BPP_PHYL_MODEL_REGISTERRATESSUBSTITUTIONMODEL_H
6 #define BPP_PHYL_MODEL_REGISTERRATESSUBSTITUTIONMODEL_H
10 #include "../Mapping/SubstitutionRegister.h"
63 std::unique_ptr<SubstitutionModelInterface> originalModel,
65 bool isNormalized =
false);
145 return "FromRegister";
155 throw Exception(
"RegisterRatesSubstitutionModel::addRateParameter method should not be called, because rates are defined through registers.");
204 std::shared_ptr<const StateMapInterface>
getStateMap()
const override
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
virtual void fireParameterChanged(const ParameterList ¶meters)
AbstractSubstitutionModel & operator=(const AbstractSubstitutionModel &model)
Abstract class of Wrapping model class, where all methods are redirected from model().
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
const Alphabet & alphabet() const override
const std::vector< int > & getAlphabetStates() const override
std::shared_ptr< const StateMapInterface > getStateMap() const override
std::shared_ptr< const Alphabet > getAlphabet() const override
const StateMapInterface & stateMap() const override
int getAlphabetStateAsInt(size_t i) const override
const BranchModelInterface & model() const override
const FrequencySetInterface & frequencySet() const override
BranchModelInterface & model_()
virtual void setRate(double rate)=0
Set the rate of the model (must be positive).
virtual double getRate() const =0
Get the rate.
Parametrize a set of state frequencies.
virtual bool matchParametersValues(const ParameterList ¶meters)=0
From a model, substitution rates are set into categories following a given register....
SubstitutionModelInterface & substitutionModel_() override
VVVuint vRegStates_
Vector of register state -> vector of from states -> vector of to states (for acceleration purpose)
RegisterRatesSubstitutionModel(const RegisterRatesSubstitutionModel &fmsm)
const TransitionModelInterface & transitionModel() const override
const FrequencySetInterface & frequencySet() const override
std::vector< size_t > getModelStates(const std::string &s) const override
Get the state in the model corresponding to a particular state in the alphabet.
RegisterRatesSubstitutionModel & operator=(const RegisterRatesSubstitutionModel &fmsm)
RegisterRatesSubstitutionModel * clone() const override
std::vector< size_t > getModelStates(int i) const override
Get the state in the model corresponding to a particular state in the alphabet.
std::unique_ptr< SubstitutionModelInterface > originalModel_
The related model.
std::shared_ptr< const StateMapInterface > getStateMap() const override
std::shared_ptr< const Alphabet > getAlphabet() const override
int getAlphabetStateAsInt(size_t i) const override
std::string getAlphabetStateAsChar(size_t s) const override
void setRate(double rate) override
Set the rate of the model (must be positive).
double getRate() const override
The rate of the substitution process.
Vdouble vRates_
vector of the rates of the register types
RegisterRatesSubstitutionModel(std::unique_ptr< SubstitutionModelInterface > originalModel, const SubstitutionRegisterInterface ®, bool isNormalized=false)
Constructor.
void fireParameterChanged(const ParameterList ¶meters) override
Tells the model that a parameter value has changed.
std::string getName() const override
Get the name of the model.
const std::string & getRegisterName() const
const std::vector< int > & getAlphabetStates() const override
Overrides of AbstractSubstitutionModel and AbstractWrappedSubstitutionModel.
const StateMapInterface & stateMap() const override
size_t getNumberOfStates() const override
Get the number of states.
void updateMatrices_() override
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
const Alphabet & alphabet() const override
TransitionModelInterface & transitionModel_() override
virtual ~RegisterRatesSubstitutionModel()
std::string registerName_
void addRateParameter() override
add a "rate" parameter to the model, that handles the overall rate of the process.
const SubstitutionModelInterface & substitutionModel() const override
From AbstractWrappedSubstitutionModel.
Map the states of a given alphabet which have a model state.
virtual size_t getNumberOfModelStates() const =0
Interface for all substitution models.
The SubstitutionRegister interface.
Interface for all transition models.
Defines the basic types of data flow nodes.
std::vector< double > Vdouble
std::vector< VVuint > VVVuint