bpp-phyl3  3.0.0
T92.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_PHYL_MODEL_NUCLEOTIDE_T92_H
6 #define BPP_PHYL_MODEL_NUCLEOTIDE_T92_H
7 
9 
10 #include "../AbstractSubstitutionModel.h"
12 
13 // From SeqLib:
15 
16 namespace bpp
17 {
123 class T92 :
125 {
126 private:
127  double kappa_, theta_, k_, r_, piA_, piC_, piG_, piT_;
128  mutable double exp1_, exp2_, l_;
130 
131 public:
132  T92(std::shared_ptr<const NucleicAlphabet> alpha, double kappa = 1., double theta = 0.5);
133 
134  virtual ~T92() {}
135 
136  T92* clone() const override { return new T92(*this); }
137 
138 public:
139  double Pij_t (size_t i, size_t j, double d) const override;
140  double dPij_dt (size_t i, size_t j, double d) const override;
141  double d2Pij_dt2(size_t i, size_t j, double d) const override;
142  const Matrix<double>& getPij_t(double d) const override;
143  const Matrix<double>& getdPij_dt(double d) const override;
144  const Matrix<double>& getd2Pij_dt2(double d) const override;
145 
146  std::string getName() const override { return "T92"; }
147 
151  void setFreq(std::map<int, double>& freqs) override;
152 
153 protected:
154  void updateMatrices_() override;
155 };
156 } // end of namespace bpp.
157 #endif // BPP_PHYL_MODEL_NUCLEOTIDE_T92_H
Specialisation abstract class for reversible nucleotide substitution model.
The Tamura (1992) substitution model for nucleotides.
Definition: T92.h:125
virtual ~T92()
Definition: T92.h:134
double d2Pij_dt2(size_t i, size_t j, double d) const override
Definition: T92.cpp:253
double r_
Definition: T92.h:127
double dPij_dt(size_t i, size_t j, double d) const override
Definition: T92.cpp:203
const Matrix< double > & getd2Pij_dt2(double d) const override
Definition: T92.cpp:371
double theta_
Definition: T92.h:127
double exp2_
Definition: T92.h:128
double piG_
Definition: T92.h:127
double piT_
Definition: T92.h:127
T92(std::shared_ptr< const NucleicAlphabet > alpha, double kappa=1., double theta=0.5)
Definition: T92.cpp:19
RowMatrix< double > p_
Definition: T92.h:129
const Matrix< double > & getPij_t(double d) const override
Definition: T92.cpp:305
double Pij_t(size_t i, size_t j, double d) const override
Definition: T92.cpp:153
void updateMatrices_() override
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Definition: T92.cpp:43
double k_
Definition: T92.h:127
void setFreq(std::map< int, double > &freqs) override
This method is over-defined to actualize the 'theta' parameter too.
Definition: T92.cpp:408
double kappa_
Definition: T92.h:127
double l_
Definition: T92.h:128
double piC_
Definition: T92.h:127
const Matrix< double > & getdPij_dt(double d) const override
Definition: T92.cpp:338
std::string getName() const override
Get the name of the model.
Definition: T92.h:146
double piA_
Definition: T92.h:127
double exp1_
Definition: T92.h:128
T92 * clone() const override
Definition: T92.h:136
Defines the basic types of data flow nodes.