bpp-phyl3  3.0.0
AbstractDFPSubstitutionModel.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_CODON_ABSTRACTDFPSUBSTITUTIONMODEL_H
6 #define BPP_PHYL_MODEL_CODON_ABSTRACTDFPSUBSTITUTIONMODEL_H
7 
8 
9 #include "../AbstractSubstitutionModel.h"
10 #include "CodonSubstitutionModel.h"
11 
12 // From SeqLib:
14 
15 namespace bpp
16 {
42  public virtual CodonSubstitutionModelInterface,
44 {
45 private:
46  std::shared_ptr<const GeneticCode> gCode_;
47 
48  double tr_, trr_, tvv_, trv_, tsub_;
49 
50 public:
55  std::shared_ptr<const GeneticCode> gCode,
56  const std::string& prefix = "AbstractDFP. ");
57 
61  gCode_(mod.gCode_),
62  tr_(mod.tr_), trr_(mod.trr_), tvv_(mod.tvv_), trv_(mod.trv_), tsub_(mod.tsub_)
63  {}
64 
66  {
68  gCode_ = mod.gCode_;
69  tr_ = mod.tr_;
70  trr_ = mod.trr_;
71  tvv_ = mod.tvv_;
72  trv_ = mod.trv_;
73  tsub_ = mod.tsub_;
74 
75  return *this;
76  }
77 
79 
80  AbstractDFPSubstitutionModel* clone() const override = 0;
81 
82 public:
83  std::shared_ptr<const GeneticCode> getGeneticCode() const override { return gCode_; }
84 
85  void fireParameterChanged(const ParameterList& parameters) override;
86 
88 
89  size_t getNumberOfStates() { return 64; }
90 
94  double getCodonsMulRate(size_t i, size_t j) const override;
95 
96 protected:
103  void updateMatrices_() override;
104 };
105 } // end of namespace bpp.
106 #endif // BPP_PHYL_MODEL_CODON_ABSTRACTDFPSUBSTITUTIONMODEL_H
Class for neutral substitution models on triplets, following the mutation process proposed in Doron-F...
AbstractDFPSubstitutionModel(const AbstractDFPSubstitutionModel &mod)
AbstractDFPSubstitutionModel(std::shared_ptr< const GeneticCode > gCode, const std::string &prefix="AbstractDFP. ")
Build a new AbstractDFPSubstitutionModel object.
double getCodonsMulRate(size_t i, size_t j) const override
Calls the multiplication by the specific codon-codon rate.
void fireParameterChanged(const ParameterList &parameters) override
Tells the model that a parameter value has changed.
AbstractDFPSubstitutionModel * clone() const override=0
std::shared_ptr< const GeneticCode > getGeneticCode() const override
void updateMatrices_() override
Method inherited from AbstractSubstitutionModel.
std::shared_ptr< const GeneticCode > gCode_
AbstractDFPSubstitutionModel & operator=(const AbstractDFPSubstitutionModel &mod)
AbstractSubstitutionModel & operator=(const AbstractSubstitutionModel &model)
virtual size_t getNumberOfStates() const =0
Get the number of states.
Defines the basic types of data flow nodes.