bpp-phyl3  3.0.0
AutoCorrelationSequenceEvolution.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 
7 using namespace std;
8 using namespace bpp;
9 
10 /******************************************************************************/
11 
12 AutoCorrelationSequenceEvolution::AutoCorrelationSequenceEvolution(
13  std::shared_ptr<SubstitutionProcessCollection> processColl,
14  std::vector<size_t>& nProc) :
15  MultiProcessSequenceEvolution(processColl, nProc),
16  hmmAlph_(),
17  autoCorrTransMat_()
18 {
19  hmmAlph_ = make_unique<HmmProcessAlphabet>(processColl_, nProc);
20 
21  autoCorrTransMat_ = make_unique<AutoCorrelationTransitionMatrix>(hmmAlph_, "AutoCorr.");
22 
23  // initialize parameters:
24  addParameters_(hmmAlph_->getParameters());
25  addParameters_(autoCorrTransMat_->getParameters());
26 }
27 
28 
29 void AutoCorrelationSequenceEvolution::setNamespace(const std::string& nameSpace)
30 {
31  deleteParameters_(hmmAlph_->getParameters().getParameterNames());
32  deleteParameters_(autoCorrTransMat_->getParameters().getParameterNames());
33 
34  hmmAlph_->setNamespace(nameSpace);
35  autoCorrTransMat_->setNamespace(nameSpace);
36 
37  addParameters_(hmmAlph_->getParameters());
38  addParameters_(autoCorrTransMat_->getParameters());
39 }
40 
41 
43 {
45 
46  hmmAlph_->matchParametersValues(parameters);
47  autoCorrTransMat_->matchParametersValues(parameters);
48 }
49 
51 {
53 
54  pl.includeParameters(autoCorrTransMat_->getParameters());
55 
56  return pl;
57 }
void addParameters_(const ParameterList &parameters)
void deleteParameters_(const std::vector< std::string > &names)
std::shared_ptr< HmmProcessAlphabet > hmmAlph_
ParameterList getNonDerivableParameters() const
All non derivable parameters.
void fireParameterChanged(const ParameterList &parameters)
std::shared_ptr< AutoCorrelationTransitionMatrix > autoCorrTransMat_
Partial implementation of multiple processes of sequences.
virtual void fireParameterChanged(const ParameterList &parameters)
std::shared_ptr< SubstitutionProcessCollection > processColl_
virtual ParameterList getNonDerivableParameters() const
All non derivable parameters.
virtual void includeParameters(const ParameterList &params)
Defines the basic types of data flow nodes.