bpp-phyl3  3.0.0
HmmSequenceEvolution.cpp
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #include "HmmSequenceEvolution.h"
6 
7 using namespace std;
8 using namespace bpp;
9 
10 /******************************************************************************/
11 
12 HmmSequenceEvolution::HmmSequenceEvolution(
13  std::shared_ptr<SubstitutionProcessCollection> processColl,
14  vector<size_t>& nProc) :
15  MultiProcessSequenceEvolution(processColl, nProc),
16  hmmAlph_(),
17  hmmTransMat_()
18 {
19  hmmAlph_ = make_shared<HmmProcessAlphabet>(processColl_, nProc);
20 
21  hmmTransMat_ = make_shared<FullHmmTransitionMatrix>(hmmAlph_, "HMM.");
22 
23  // initialize parameters:
24  addParameters_(hmmAlph_->getParameters());
25  addParameters_(hmmTransMat_->getParameters());
26 }
27 
28 
29 void HmmSequenceEvolution::setNamespace(const std::string& nameSpace)
30 {
31  deleteParameters_(hmmAlph_->getParameters().getParameterNames());
32  deleteParameters_(hmmTransMat_->getParameters().getParameterNames());
33 
34  hmmAlph_->setNamespace(nameSpace);
35  hmmTransMat_->setNamespace(nameSpace);
36 
37  addParameters_(hmmAlph_->getParameters());
38  addParameters_(hmmTransMat_->getParameters());
39 }
40 
42 {
44  hmmAlph_->matchParametersValues(parameters);
45  hmmTransMat_->matchParametersValues(parameters);
46 }
void addParameters_(const ParameterList &parameters)
void deleteParameters_(const std::vector< std::string > &names)
std::shared_ptr< FullHmmTransitionMatrix > hmmTransMat_
void setNamespace(const std::string &nameSpace)
std::shared_ptr< HmmProcessAlphabet > hmmAlph_
void fireParameterChanged(const ParameterList &parameters)
Partial implementation of multiple processes of sequences.
virtual void fireParameterChanged(const ParameterList &parameters)
std::shared_ptr< SubstitutionProcessCollection > processColl_
Defines the basic types of data flow nodes.