bpp-phyl3  3.0.0
TN93.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_TN93_H
6 #define BPP_PHYL_MODEL_NUCLEOTIDE_TN93_H
7 
9 
10 #include "../AbstractSubstitutionModel.h"
12 
13 // From bpp-seq:
15 
16 namespace bpp
17 {
93 class TN93 :
95 {
96 private:
98  mutable double exp1_, exp21_, exp22_, l_;
100 
101 public:
102  TN93(
103  std::shared_ptr<const NucleicAlphabet> alpha,
104  double kappa1 = 1.,
105  double kappa2 = 1.,
106  double piA = 0.25,
107  double piC = 0.25,
108  double piG = 0.25,
109  double piT = 0.25);
110 
111  virtual ~TN93() {}
112 
113  TN93* clone() const override { return new TN93(*this); }
114 
115 public:
116  double Pij_t (size_t i, size_t j, double d) const override;
117  double dPij_dt (size_t i, size_t j, double d) const override;
118  double d2Pij_dt2(size_t i, size_t j, double d) const override;
119  const Matrix<double>& getPij_t (double d) const override;
120  const Matrix<double>& getdPij_dt (double d) const override;
121  const Matrix<double>& getd2Pij_dt2(double d) const override;
122 
123  std::string getName() const override { return "TN93"; }
124 
128  void setFreq(std::map<int, double>& freqs) override;
129 
130 protected:
131  void updateMatrices_() override;
132 };
133 } // end of namespace bpp.
134 #endif // BPP_PHYL_MODEL_NUCLEOTIDE_TN93_H
Specialisation abstract class for reversible nucleotide substitution model.
The Tamura and Nei (1993) substitution model for nucleotides.
Definition: TN93.h:95
double Pij_t(size_t i, size_t j, double d) const override
Definition: TN93.cpp:129
double r_
Definition: TN93.h:97
double k2_
Definition: TN93.h:97
const Matrix< double > & getdPij_dt(double d) const override
Definition: TN93.cpp:319
double l_
Definition: TN93.h:98
double k1_
Definition: TN93.h:97
std::string getName() const override
Get the name of the model.
Definition: TN93.h:123
double kappa2_
Definition: TN93.h:97
void setFreq(std::map< int, double > &freqs) override
This method is over-defined to actualize the corresponding parameters piA, piT, piG and piC too.
Definition: TN93.cpp:392
double piC_
Definition: TN93.h:97
const Matrix< double > & getd2Pij_dt2(double d) const override
Definition: TN93.cpp:353
double exp22_
Definition: TN93.h:98
RowMatrix< double > p_
Definition: TN93.h:99
double piR_
Definition: TN93.h:97
double piY_
Definition: TN93.h:97
double piG_
Definition: TN93.h:97
double theta_
Definition: TN93.h:97
void updateMatrices_() override
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Definition: TN93.cpp:47
double piT_
Definition: TN93.h:97
double exp21_
Definition: TN93.h:98
double kappa1_
Definition: TN93.h:97
TN93(std::shared_ptr< const NucleicAlphabet > alpha, double kappa1=1., double kappa2=1., double piA=0.25, double piC=0.25, double piG=0.25, double piT=0.25)
Definition: TN93.cpp:20
double piA_
Definition: TN93.h:97
double theta1_
Definition: TN93.h:97
double dPij_dt(size_t i, size_t j, double d) const override
Definition: TN93.cpp:180
TN93 * clone() const override
Definition: TN93.h:113
double d2Pij_dt2(size_t i, size_t j, double d) const override
Definition: TN93.cpp:231
double theta2_
Definition: TN93.h:97
const Matrix< double > & getPij_t(double d) const override
Definition: TN93.cpp:285
double exp1_
Definition: TN93.h:98
virtual ~TN93()
Definition: TN93.h:111
Defines the basic types of data flow nodes.