32 for (
size_t i = 0; i < 4; ++i)
34 for (
size_t j = 0; j < 4; ++j)
46 for (
size_t i = 0; i < 4; i++)
50 for (
size_t i = 1; i < 4; i++)
52 for (
size_t j = 0; j < 4; j++)
61 for (
size_t i = 0; i < 4; i++)
65 for (
size_t i = 1; i < 4; i++)
69 for (
size_t i = 0; i < 3; i++)
71 for (
size_t j = 1; j < 4; j++)
86 return 1. / 4. + 3. / 4. *
exp(-
rate_ * 4. / 3. * d);
88 return 1. / 4. - 1. / 4. *
exp(-
rate_ * 4. / 3. * d);
116 for (
size_t i = 0; i <
size_; i++)
118 for (
size_t j = 0; j <
size_; j++)
120 p_(i, j) = (i == j) ? 1. / 4. + 3. / 4. *
exp_ : 1. / 4. - 1. / 4. *
exp_;
129 for (
size_t i = 0; i <
size_; i++)
131 for (
size_t j = 0; j <
size_; j++)
142 for (
size_t i = 0; i <
size_; i++)
144 for (
size_t j = 0; j <
size_; j++)
Specialisation abstract class for reversible nucleotide substitution model.
RowMatrix< double > generator_
The generator matrix of the model.
Vdouble eigenValues_
The vector of eigen values.
RowMatrix< double > exchangeability_
The exchangeability matrix of the model, defined as . When the model is reversible,...
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).
size_t size_
The number of states.
Vdouble freq_
The vector of equilibrium frequencies.
double rate_
The rate of the model (default: 1). The generator (and all its vectorial components) is independent o...
This class implements a state map where all resolved states are modeled.
double dPij_dt(size_t i, size_t j, double d) const override
double d2Pij_dt2(size_t i, size_t j, double d) const override
const Matrix< double > & getd2Pij_dt2(double d) const override
double Pij_t(size_t i, size_t j, double d) const override
JCnuc(std::shared_ptr< const NucleicAlphabet > alpha)
void updateMatrices_() override
const Matrix< double > & getPij_t(double d) const override
const Matrix< double > & getdPij_dt(double d) const override
Defines the basic types of data flow nodes.
ExtendedFloat exp(const ExtendedFloat &ef)