bpp-phyl3 3.0.0
D1WalkSubstitutionModel.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_D1WALKSUBSTITUTIONMODEL_H
6#define BPP_PHYL_MODEL_D1WALKSUBSTITUTIONMODEL_H
7
9
11
12
13namespace bpp
14{
75{
76private:
82 std::shared_ptr<FullFrequencySet> freqSet_;
83
84public:
94 D1WalkSubstitutionModel(std::shared_ptr<const IntegerAlphabet> alpha, unsigned short method = 1);
95
99 freqSet_(model.freqSet_->clone())
100 {}
101
103 {
106 freqSet_ = std::shared_ptr<FullFrequencySet>(model.freqSet_->clone());
107 return *this;
108 }
109
111
112 D1WalkSubstitutionModel* clone() const override { return new D1WalkSubstitutionModel(*this); }
113
114public:
115 std::string getName() const override
116 {
117 return "D1Walk";
118 }
119
120 void fireParameterChanged(const ParameterList& parameters) override
121 {
122 freqSet_->matchParametersValues(parameters);
124 }
125
126 const FrequencySetInterface& frequencySet() const override
127 {
128 return *freqSet_;
129 }
130
131 void setFreq(std::map<int, double>& freq) override;
132
133protected:
139 void updateMatrices_() override;
140};
141} // end of namespace bpp.
142#endif // BPP_PHYL_MODEL_D1WALKSUBSTITUTIONMODEL_H
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
Partial implementation of the ReversibleSubstitutionModel interface.
AbstractSubstitutionModel & operator=(const AbstractSubstitutionModel &model)
virtual void fireParameterChanged(const ParameterList &parameters) override
Tells the model that a parameter value has changed.
virtual double freq(size_t i) const override
The D1Walk substitution model for Integer alphabet [0;N-1]. In this model, substitutions are possible...
void fireParameterChanged(const ParameterList &parameters) override
Tells the model that a parameter value has changed.
std::string getName() const override
Get the name of the model.
D1WalkSubstitutionModel & operator=(const D1WalkSubstitutionModel &model)
void setFreq(std::map< int, double > &freq) override
Set equilibrium frequencies.
D1WalkSubstitutionModel(std::shared_ptr< const IntegerAlphabet > alpha, unsigned short method=1)
Build a D1Walk model on a given IntegerAlphabet.
D1WalkSubstitutionModel * clone() const override
const FrequencySetInterface & frequencySet() const override
std::shared_ptr< FullFrequencySet > freqSet_
The Equilibrium Frequency Set.
D1WalkSubstitutionModel(const D1WalkSubstitutionModel &model)
Parametrize a set of state frequencies.
Definition: FrequencySet.h:29
Defines the basic types of data flow nodes.