bpp-phyl3 3.0.0
AbstractKroneckerCodonSubstitutionModel.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_ABSTRACTKRONECKERCODONSUBSTITUTIONMODEL_H
6#define BPP_PHYL_MODEL_CODON_ABSTRACTKRONECKERCODONSUBSTITUTIONMODEL_H
7
8
9#include "../AbstractKroneckerWordSubstitutionModel.h"
10#include "../Nucleotide/NucleotideSubstitutionModel.h"
12
13// From bpp-seq:
15
16// From the STL:
17#include <memory>
18#include <set>
19
20namespace bpp
21{
42{
43private:
44 std::shared_ptr<const GeneticCode> gCode_;
45
46public:
57 std::shared_ptr<const GeneticCode> gCode,
58 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod,
59 const std::string& st);
60
73 std::shared_ptr<const GeneticCode> gCode,
74 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod,
75 const std::vector<std::set<size_t>>& vPos,
76 const std::string& st);
77
91 std::shared_ptr<const GeneticCode> gCode,
92 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod1,
93 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod2,
94 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod3,
95 const std::string& st);
96
112 std::shared_ptr<const GeneticCode> gCode,
113 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod1,
114 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod2,
115 std::unique_ptr<NucleotideSubstitutionModelInterface> pmod3,
116 const std::vector<std::set< size_t>>& vPos,
117 const std::string& st);
118
120
124 gCode_(model.gCode_)
125 {}
126
128 {
131 gCode_ = model.gCode_;
132 return *this;
133 }
134
136
137protected:
144 void completeMatrices_() override;
145
146public:
147 std::shared_ptr<const GeneticCode> getGeneticCode() const override { return gCode_; }
148
155 virtual double getCodonsMulRate(size_t i, size_t j) const override { return 1.; }
156};
157} // end of namespace bpp.
158#endif // BPP_PHYL_MODEL_CODON_ABSTRACTKRONECKERCODONSUBSTITUTIONMODEL_H
Abstract class for substitution models on codons allowing multiple substitutions.
AbstractKroneckerCodonSubstitutionModel(std::shared_ptr< const GeneticCode > gCode, std::unique_ptr< NucleotideSubstitutionModelInterface > pmod, const std::string &st)
Build a new AbstractKroneckerCodonSubstitutionModel object from a pointer to a NucleotideSubstitution...
AbstractKroneckerCodonSubstitutionModel(const AbstractKroneckerCodonSubstitutionModel &model)
void completeMatrices_() override
Method inherited from AbstractWordSubstitutionModel.
AbstractKroneckerCodonSubstitutionModel * clone() const override=0
AbstractKroneckerCodonSubstitutionModel & operator=(const AbstractKroneckerCodonSubstitutionModel &model)
std::shared_ptr< const GeneticCode > getGeneticCode() const override
virtual double getCodonsMulRate(size_t i, size_t j) const override
Method inherited from CodonSubstitutionModel.
AbstractKroneckerWordSubstitutionModel & operator=(const AbstractKroneckerWordSubstitutionModel &)
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
Defines the basic types of data flow nodes.