13 std::shared_ptr<const GeneticCode> gCode,
14 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod,
19 gCode->getSourceAlphabet(),
22 hasParametrizedRates_(paramRates),
27 shared_ptr<NucleotideSubstitutionModelInterface> pmod2 = std::move(pmod);
28 for (
size_t i = 0; i < 3; ++i)
35 pmod2->enableEigenDecomposition(0);
40 for (
size_t i = 0; i < 3; ++i)
49 for (
size_t i = 0; i < 2; ++i)
57 std::shared_ptr<const GeneticCode> gCode,
58 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod1,
59 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod2,
60 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod3,
61 const std::string& prefix,
65 gCode->getSourceAlphabet(),
68 hasParametrizedRates_(paramRates),
73 VSubMod_.push_back(std::move(pmod1));
76 VSubMod_[0]->enableEigenDecomposition(0);
79 VSubMod_.push_back(std::move(pmod2));
82 VSubMod_[1]->enableEigenDecomposition(0);
85 VSubMod_.push_back(std::move(pmod3));
88 VSubMod_[2]->enableEigenDecomposition(0);
92 for (
size_t i = 0; i < 3; ++i)
100 for (
int i = 0; i < 2; ++i)
114 for (k = nbmod - 1; k > 0; k--)
117 for (i = 0; i < k; i++)
135 for (i = 0; i < salph; i++)
137 for (j = 0; j < salph; j++)
AbstractCodonSubstitutionModel(std::shared_ptr< const GeneticCode > gCode, std::unique_ptr< NucleotideSubstitutionModelInterface > pmod, const std::string &st, bool paramRates=false)
Build a new AbstractCodonSubstitutionModel object from a pointer to a NucleotideSubstitutionModel.
std::shared_ptr< const GeneticCode > gCode_
void completeMatrices_() override
Method inherited from AbstractWordSubstitutionModel.
void updateMatrices_() override
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
bool hasParametrizedRates_
boolean for the parametrization of the position relative rates. Default : false.
void addParameters_(const ParameterList ¶meters)
void addParameter_(Parameter *parameter)
RowMatrix< double > generator_
The generator matrix of the model.
bool enableEigenDecomposition()
Tell if eigenValues and Vectors must be computed.
int getAlphabetStateAsInt(size_t index) const override
size_t getNumberOfStates() const override
Get the number of states.
Abstract Basal class for words of substitution models.
void updateMatrices_()
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
std::vector< double > Vrate_
std::vector< std::shared_ptr< SubstitutionModelInterface > > VSubMod_
std::vector< std::string > VnestedPrefix_
This class implements a state map where all resolved states are modeled.
virtual double getCodonsMulRate(size_t, size_t) const =0
Returns the multiplicative rate specific to two codons specified by their number. The respective gene...
static const std::shared_ptr< IntervalConstraint > PROP_CONSTRAINT_EX
virtual std::string getNamespace() const=0
virtual double getParameterValue(const std::string &name) const=0
virtual const ParameterList & getParameters() const=0
Map the states of a given alphabet which have a model state.
std::string toString(T t)
Defines the basic types of data flow nodes.