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