bpp-phyl3  3.0.0
GTR.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_GTR_H
6 #define BPP_PHYL_MODEL_NUCLEOTIDE_GTR_H
7 
9 
10 #include "../AbstractSubstitutionModel.h"
12 
13 // From SeqLib:
15 
16 namespace bpp
17 {
103 class GTR :
105 {
106 protected:
107  double a_, b_, c_, d_, e_, piA_, piC_, piG_, piT_, theta_, theta1_, theta2_, p_;
108 
109 public:
110  GTR(
111  std::shared_ptr<const NucleicAlphabet> alpha,
112  double a = 1.,
113  double b = 1.,
114  double c = 1.,
115  double d = 1.,
116  double e = 1.,
117  double piA = 0.25,
118  double piC = 0.25,
119  double piG = 0.25,
120  double piT = 0.25);
121 
122  virtual ~GTR() {}
123 
124  GTR* clone() const override { return new GTR(*this); }
125 
126 public:
127  std::string getName() const override { return "GTR"; }
128 
132  void setFreq(std::map<int, double>& freqs) override;
133 
134 protected:
135  void updateMatrices_() override;
136 };
137 } // end of namespace bpp.
138 #endif // BPP_PHYL_MODEL_NUCLEOTIDE_GTR_H
Specialisation abstract class for reversible nucleotide substitution model.
The General Time-Reversible substitution model for nucleotides.
Definition: GTR.h:105
double piT_
Definition: GTR.h:107
virtual ~GTR()
Definition: GTR.h:122
double e_
Definition: GTR.h:107
double theta1_
Definition: GTR.h:107
double piA_
Definition: GTR.h:107
double piC_
Definition: GTR.h:107
double theta2_
Definition: GTR.h:107
double piG_
Definition: GTR.h:107
double p_
Definition: GTR.h:107
double d_
Definition: GTR.h:107
double c_
Definition: GTR.h:107
double theta_
Definition: GTR.h:107
void updateMatrices_() override
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Definition: GTR.cpp:46
GTR * clone() const override
Definition: GTR.h:124
double b_
Definition: GTR.h:107
std::string getName() const override
Get the name of the model.
Definition: GTR.h:127
GTR(std::shared_ptr< const NucleicAlphabet > alpha, double a=1., double b=1., double c=1., double d=1., double e=1., double piA=0.25, double piC=0.25, double piG=0.25, double piT=0.25)
Definition: GTR.cpp:18
void setFreq(std::map< int, double > &freqs) override
This method is redefined to actualize the corresponding parameters piA, piT, piG and piC too.
Definition: GTR.cpp:90
double a_
Definition: GTR.h:107
Defines the basic types of data flow nodes.