bpp-phyl3  3.0.0
HKY85.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_HKY85_H
6 #define BPP_PHYL_MODEL_NUCLEOTIDE_HKY85_H
7 
9 
10 #include "../AbstractSubstitutionModel.h"
12 
13 // From SeqLib:
15 
16 namespace bpp
17 {
143 class HKY85 :
145 {
146 private:
148  mutable double exp1_, exp21_, exp22_, l_;
150 
151 public:
152  HKY85(
153  std::shared_ptr<const NucleicAlphabet> alpha,
154  double kappa = 1.,
155  double piA = 0.25,
156  double piC = 0.25,
157  double piG = 0.25,
158  double piT = 0.25);
159 
160  virtual ~HKY85() {}
161 
162  HKY85* clone() const { return new HKY85(*this); }
163 
164 public:
165  double Pij_t (size_t i, size_t j, double d) const;
166  double dPij_dt (size_t i, size_t j, double d) const;
167  double d2Pij_dt2(size_t i, size_t j, double d) const;
168  const Matrix<double>& getPij_t (double d) const;
169  const Matrix<double>& getdPij_dt (double d) const;
170  const Matrix<double>& getd2Pij_dt2(double d) const;
171 
172  std::string getName() const { return "HKY85"; }
173 
177  void setFreq(std::map<int, double>& freqs);
178 
179  void updateMatrices_();
180 };
181 } // end of namespace bpp.
182 #endif // BPP_PHYL_MODEL_NUCLEOTIDE_HKY85_H
Specialisation abstract class for reversible nucleotide substitution model.
The Hasegawa M, Kishino H and Yano T (1985) substitution model for nucleotides.
Definition: HKY85.h:145
double piY_
Definition: HKY85.h:147
double piC_
Definition: HKY85.h:147
double piG_
Definition: HKY85.h:147
std::string getName() const
Get the name of the model.
Definition: HKY85.h:172
double theta1_
Definition: HKY85.h:147
double dPij_dt(size_t i, size_t j, double d) const
Definition: HKY85.cpp:208
void updateMatrices_()
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Definition: HKY85.cpp:42
HKY85(std::shared_ptr< const NucleicAlphabet > alpha, double kappa=1., double piA=0.25, double piC=0.25, double piG=0.25, double piT=0.25)
Definition: HKY85.cpp:19
double k1_
Definition: HKY85.h:147
double Pij_t(size_t i, size_t j, double d) const
Definition: HKY85.cpp:157
const Matrix< double > & getPij_t(double d) const
Definition: HKY85.cpp:313
double k2_
Definition: HKY85.h:147
double d2Pij_dt2(size_t i, size_t j, double d) const
Definition: HKY85.cpp:259
double exp21_
Definition: HKY85.h:148
double kappa_
Definition: HKY85.h:147
double exp1_
Definition: HKY85.h:148
double l_
Definition: HKY85.h:148
double piA_
Definition: HKY85.h:147
double theta2_
Definition: HKY85.h:147
double exp22_
Definition: HKY85.h:148
RowMatrix< double > p_
Definition: HKY85.h:149
double theta_
Definition: HKY85.h:147
void setFreq(std::map< int, double > &freqs)
This method is redefined to actualize the corresponding parameters piA, piT, piG and piC too.
Definition: HKY85.cpp:420
double r_
Definition: HKY85.h:147
virtual ~HKY85()
Definition: HKY85.h:160
double piT_
Definition: HKY85.h:147
const Matrix< double > & getdPij_dt(double d) const
Definition: HKY85.cpp:347
const Matrix< double > & getd2Pij_dt2(double d) const
Definition: HKY85.cpp:381
HKY85 * clone() const
Definition: HKY85.h:162
double piR_
Definition: HKY85.h:147
Defines the basic types of data flow nodes.