bpp-phyl3 3.0.0
gBGC.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_GBGC_H
6#define BPP_PHYL_MODEL_NUCLEOTIDE_GBGC_H
7
9
10#include "../AbstractSubstitutionModel.h"
12
13// From SeqLib:
15
16// From Utils:
17
18using namespace std;
19
20namespace bpp
21{
45class gBGC :
47{
48private:
49 std::unique_ptr<NucleotideSubstitutionModelInterface> model_;
50 std::string nestedPrefix_;
51
55 double B_;
56
57public:
61 gBGC(
62 std::shared_ptr<const NucleicAlphabet>,
63 std::unique_ptr<NucleotideSubstitutionModelInterface>,
64 double B = 0);
65
66 gBGC(const gBGC&);
67
68 gBGC& operator=(const gBGC& gbgc);
69
70 gBGC* clone() const override { return new gBGC(*this); }
71
72 virtual ~gBGC() {}
73
74public:
75 std::string getName() const override
76 {
77 return model_->getName() + "+gBGC";
78 }
79
80 size_t getNumberOfStates() const override { return model_->getNumberOfStates(); }
81
82 void fireParameterChanged(const ParameterList&) override;
83
84 const SubstitutionModelInterface& nestedModel() const { return *model_; }
85
86 void setNamespace(const std::string&) override;
87
88protected:
89 void updateMatrices_() override;
90};
91}
92#endif // BPP_PHYL_MODEL_NUCLEOTIDE_GBGC_H
Specialisation abstract class for nucleotide substitution model.
Interface for all substitution models.
gBGC model.
Definition: gBGC.h:47
const SubstitutionModelInterface & nestedModel() const
Definition: gBGC.h:84
void setNamespace(const std::string &) override
Definition: gBGC.cpp:223
void updateMatrices_() override
Diagonalize the matrix, and fill the eigenValues_, iEigenValues_, leftEigenVectors_ and rightEigenVe...
Definition: gBGC.cpp:64
std::string nestedPrefix_
Definition: gBGC.h:50
std::unique_ptr< NucleotideSubstitutionModelInterface > model_
Definition: gBGC.h:49
std::string getName() const override
Get the name of the model.
Definition: gBGC.h:75
void fireParameterChanged(const ParameterList &) override
Tells the model that a parameter value has changed.
Definition: gBGC.cpp:57
gBGC & operator=(const gBGC &gbgc)
Definition: gBGC.cpp:47
size_t getNumberOfStates() const override
Get the number of states.
Definition: gBGC.h:80
gBGC * clone() const override
Definition: gBGC.h:70
virtual ~gBGC()
Definition: gBGC.h:72
gBGC(std::shared_ptr< const NucleicAlphabet >, std::unique_ptr< NucleotideSubstitutionModelInterface >, double B=0)
Build a new gBGC substitution model.
Definition: gBGC.cpp:18
double B_
the value of the bias.
Definition: gBGC.h:55
Defines the basic types of data flow nodes.