bpp-phyl3  3.0.0
F84.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_F84_H
6 #define BPP_PHYL_MODEL_NUCLEOTIDE_F84_H
7 
9 
11 
12 // From bpp-seq:
14 
15 namespace bpp
16 {
141 class F84 :
143 {
144 private:
146  mutable double l_, exp1_, exp2_;
148 
149 public:
150  F84(
151  std::shared_ptr<const NucleicAlphabet> alpha,
152  double kappa = 1.,
153  double piA = 0.25,
154  double piC = 0.25,
155  double piG = 0.25,
156  double piT = 0.25);
157 
158  virtual ~F84() {}
159 
160  F84* clone() const { return new F84(*this); }
161 
162 public:
163  double Pij_t (size_t i, size_t j, double d) const;
164  double dPij_dt (size_t i, size_t j, double d) const;
165  double d2Pij_dt2(size_t i, size_t j, double d) const;
166  const Matrix<double>& getPij_t (double d) const;
167  const Matrix<double>& getdPij_dt (double d) const;
168  const Matrix<double>& getd2Pij_dt2(double d) const;
169 
170  std::string getName() const { return "F84"; }
171 
175  void setFreq(std::map<int, double>&);
176 
177 protected:
178  void updateMatrices_();
179 };
180 } // end of namespace bpp.
181 #endif // BPP_PHYL_MODEL_NUCLEOTIDE_F84_H
Specialisation abstract class for reversible nucleotide substitution model.
The Felsenstein (1984) substitution model for nucleotides.
Definition: F84.h:143
RowMatrix< double > p_
Definition: F84.h:147
double kappa_
Definition: F84.h:145
const Matrix< double > & getdPij_dt(double d) const
Definition: F84.cpp:343
double k1_
Definition: F84.h:145
const Matrix< double > & getd2Pij_dt2(double d) const
Definition: F84.cpp:376
double exp2_
Definition: F84.h:146
double piC_
Definition: F84.h:145
double exp1_
Definition: F84.h:146
const Matrix< double > & getPij_t(double d) const
Definition: F84.cpp:310
void updateMatrices_()
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Definition: F84.cpp:40
double theta_
Definition: F84.h:145
double piG_
Definition: F84.h:145
double Pij_t(size_t i, size_t j, double d) const
Definition: F84.cpp:157
double piY_
Definition: F84.h:145
void setFreq(std::map< int, double > &)
This method is redefined to actualize the corresponding parameters piA, piT, piG and piC too.
Definition: F84.cpp:413
double dPij_dt(size_t i, size_t j, double d) const
Definition: F84.cpp:207
double theta2_
Definition: F84.h:145
double piT_
Definition: F84.h:145
double k2_
Definition: F84.h:145
double piA_
Definition: F84.h:145
virtual ~F84()
Definition: F84.h:158
double r_
Definition: F84.h:145
F84(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: F84.cpp:18
std::string getName() const
Get the name of the model.
Definition: F84.h:170
double l_
Definition: F84.h:146
double theta1_
Definition: F84.h:145
double piR_
Definition: F84.h:145
F84 * clone() const
Definition: F84.h:160
double d2Pij_dt2(size_t i, size_t j, double d) const
Definition: F84.cpp:257
Defines the basic types of data flow nodes.