19 std::shared_ptr<const NucleicAlphabet> alph,
20 std::unique_ptr<NucleotideSubstitutionModelInterface> pm,
24 model_(std::move(pm)),
25 nestedPrefix_(model_->getNamespace()),
29 model_->enableEigenDecomposition(0);
30 model_->computeFrequencies(
false);
42 model_(gbgc.model_->clone()),
43 nestedPrefix_(gbgc.nestedPrefix_),
60 model_->matchParametersValues(parameters);
70 for (i = 0; i < 4; ++i)
72 for (j = 0; j < 4; ++j)
80 double bp =
B_ / (1 -
exp(-
B_));
123 size_t nulleigen = 0;
127 while (nulleigen < 4)
157 for (i = 0; i < 4; i++)
163 for (i = 0; i < 4; i++)
168 for (i = 0; i < 4; i++)
190 for (i = 1; i < 4; i++)
205 for (i = 0; i < 4; ++i)
Specialisation abstract class for nucleotide substitution model.
void addParameters_(const ParameterList ¶meters)
void addParameter_(Parameter *parameter)
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
void setNamespace(const std::string &prefix)
double getParameterValue(const std::string &name) const override
RowMatrix< double > generator_
The generator matrix of the model.
bool isDiagonalizable_
boolean value for diagonalizability in R of the generator_
bool isNonSingular_
boolean value for non-singularity of rightEigenVectors_
AbstractSubstitutionModel & operator=(const AbstractSubstitutionModel &model)
std::vector< RowMatrix< double > > vPowGen_
vector of the powers of generator_ for Taylor development (if rightEigenVectors_ is singular).
Vdouble eigenValues_
The vector of eigen values.
void normalize()
normalize the generator
bool computeFrequencies() const
Vdouble iEigenValues_
The vector of the imaginary part of the eigen values.
RowMatrix< double > leftEigenVectors_
The matrix made of left eigen vectors (by row) if rightEigenVectors_ is non-singular.
RowMatrix< double > rightEigenVectors_
The matrix made of right eigen vectors (by column).
bool enableEigenDecomposition()
Tell if eigenValues and Vectors must be computed.
void setScale(double scale)
Multiplies the current generator by the given scale.
RowMatrix< double > tmpMat_
For computational issues.
virtual void fireParameterChanged(const ParameterList ¶meters) override
Tells the model that a parameter value has changed.
Vdouble freq_
The vector of equilibrium frequencies.
const RowMatrix< Real > & getV() const
const std::vector< Real > & getImagEigenValues() const
const std::vector< Real > & getRealEigenValues() const
void setNamespace(const std::string &) override
void updateMatrices_() override
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
std::string nestedPrefix_
std::unique_ptr< NucleotideSubstitutionModelInterface > model_
void fireParameterChanged(const ParameterList &) override
Tells the model that a parameter value has changed.
gBGC & operator=(const gBGC &gbgc)
gBGC(std::shared_ptr< const NucleicAlphabet >, std::unique_ptr< NucleotideSubstitutionModelInterface >, double B=0)
Build a new gBGC substitution model.
double B_
the value of the bias.
Defines the basic types of data flow nodes.
ExtendedFloat exp(const ExtendedFloat &ef)
ExtendedFloat abs(const ExtendedFloat &ef)