bpp-phyl3  3.0.0
K80.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_K80_H
6 #define BPP_PHYL_MODEL_NUCLEOTIDE_K80_H
7 
8 
9 #include "../AbstractSubstitutionModel.h"
11 
12 // From bpp-seq:
14 
15 namespace bpp
16 {
114 class K80 :
116 {
117 private:
118  double kappa_, r_;
119  mutable double l_, k_, exp1_, exp2_;
121 
122 public:
123  K80(std::shared_ptr<const NucleicAlphabet> alpha, double kappa = 1.);
124 
125  virtual ~K80() {}
126 
127  K80* clone() const override { return new K80(*this); }
128 
129 public:
130  double Pij_t (size_t i, size_t j, double d) const override;
131  double dPij_dt (size_t i, size_t j, double d) const override;
132  double d2Pij_dt2(size_t i, size_t j, double d) const override;
133  const Matrix<double>& getPij_t (double d) const override;
134  const Matrix<double>& getdPij_dt (double d) const override;
135  const Matrix<double>& getd2Pij_dt2(double d) const override;
136 
137  std::string getName() const override { return "K80"; }
138 
147  void setFreqFromData(const SequenceDataInterface& data, double pseudoCount = 0) override {}
148 
149 protected:
150  void updateMatrices_() override;
151 };
152 } // end of namespace bpp.
153 #endif // BPP_PHYL_MODEL_NUCLEOTIDE_K80_H
Specialisation abstract class for reversible nucleotide substitution model.
The Kimura 2-rates substitution model for nucleotides.
Definition: K80.h:116
K80 * clone() const override
Definition: K80.h:127
double k_
Definition: K80.h:119
RowMatrix< double > p_
Definition: K80.h:120
const Matrix< double > & getd2Pij_dt2(double d) const override
Definition: K80.cpp:327
double exp2_
Definition: K80.h:119
double kappa_
Definition: K80.h:118
K80(std::shared_ptr< const NucleicAlphabet > alpha, double kappa=1.)
Definition: K80.cpp:18
double d2Pij_dt2(size_t i, size_t j, double d) const override
Definition: K80.cpp:209
virtual ~K80()
Definition: K80.h:125
std::string getName() const override
Get the name of the model.
Definition: K80.h:137
double dPij_dt(size_t i, size_t j, double d) const override
Definition: K80.cpp:159
double Pij_t(size_t i, size_t j, double d) const override
Definition: K80.cpp:109
double l_
Definition: K80.h:119
double exp1_
Definition: K80.h:119
double r_
Definition: K80.h:118
const Matrix< double > & getPij_t(double d) const override
Definition: K80.cpp:262
void updateMatrices_() override
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Definition: K80.cpp:29
void setFreqFromData(const SequenceDataInterface &data, double pseudoCount=0) override
This method is disabled in this model since frequencies are not free parameters.
Definition: K80.h:147
const Matrix< double > & getdPij_dt(double d) const override
Definition: K80.cpp:295
Defines the basic types of data flow nodes.