bpp-phyl3 3.0.0
AbstractFromSubstitutionModelTransitionModel.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: The Bio++ Development Group
2//
3// SPDX-License-Identifier: CECILL-2.1
4
6
7using namespace bpp;
8using namespace std;
9
10/******************************************************************************/
11
12AbstractFromSubstitutionModelTransitionModel::AbstractFromSubstitutionModelTransitionModel(
13 unique_ptr<SubstitutionModelInterface> subModel,
14 const std::string& prefix) :
15 // AbstractParameterAliasable(prefix + subModel->getNamespace()),
16 subModel_(std::move(subModel)),
17 size_(subModel_->getNumberOfStates()),
18 pij_t(size_, size_),
19 dpij_t(size_, size_),
20 d2pij_t(size_, size_),
21 nestedPrefix_(subModel_->getNamespace())
22{
23 subModel_->setNamespace(getNamespace() + nestedPrefix_);
24 addParameters_(subModel_->getParameters());
25}
26
27
28/******************************************************************************/
29
31 // AbstractParameterAliasable(fmsm),
32 subModel_(fmsm.subModel_->clone()),
33 size_(fmsm.size_),
34 pij_t(fmsm.pij_t),
35 dpij_t(fmsm.dpij_t),
36 d2pij_t(fmsm.d2pij_t),
37 nestedPrefix_(fmsm.nestedPrefix_)
38{}
39
40
41/******************************************************************************/
42
44{
46
47 subModel_ = std::unique_ptr<SubstitutionModelInterface>(fmsm.subModel_->clone());
48 size_ = fmsm.size_;
49 pij_t = fmsm.pij_t;
50 dpij_t = fmsm.dpij_t;
51 d2pij_t = fmsm.d2pij_t;
53
54 return *this;
55}
Virtual class of a Transition Model related to a given SubstitutionModel.
std::unique_ptr< SubstitutionModelInterface > subModel_
The related model.
AbstractFromSubstitutionModelTransitionModel & operator=(const AbstractFromSubstitutionModelTransitionModel &fmsm)
void addParameters_(const ParameterList &parameters)
AbstractParameterAliasable & operator=(const AbstractParameterAliasable &ap)
std::string getNamespace() const override
Defines the basic types of data flow nodes.