bpp-phyl3  3.0.0
HmmProcessAlphabet.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_LIKELIHOOD_HMMPROCESSALPHABET_H
6 #define BPP_PHYL_LIKELIHOOD_HMMPROCESSALPHABET_H
7 
8 
9 // From Numeric
11 
13 
14 
15 namespace bpp
16 {
24  public virtual HmmStateAlphabet,
26 {
27 private:
28  std::shared_ptr<const SubstitutionProcessCollection> processColl_;
29 
33  std::vector<size_t> nProc_;
34 
35 public:
37  std::shared_ptr<const SubstitutionProcessCollection> pSub,
38  std::vector<size_t> nProc) :
40  processColl_(pSub),
41  nProc_(nProc)
42  {}
43 
47  nProc_(hpa.nProc_)
48  {}
49 
51  {
52  AbstractParametrizable::operator=(*this);
54  nProc_ = hpa.nProc_;
55 
56  return *this;
57  }
58 
59  HmmProcessAlphabet* clone() const override {return new HmmProcessAlphabet(*this);}
60 
61  virtual ~HmmProcessAlphabet() {}
62 
68  const Clonable& getState(size_t stateIndex) const override
69  {
70  return processColl_->substitutionProcess(nProc_[stateIndex]);
71  }
72 
73  size_t getNumberOfStates() const override
74  {
75  return nProc_.size();
76  }
77 
86  bool worksWith(const HmmStateAlphabet& stateAlphabet) const override
87  {
88  return &stateAlphabet == this;
89  }
90 };
91 }
92 #endif // BPP_PHYL_LIKELIHOOD_HMMPROCESSALPHABET_H
Hidden states alphabet.
size_t getNumberOfStates() const override
std::vector< size_t > nProc_
the vector of the substitution process numbers.
HmmProcessAlphabet(const HmmProcessAlphabet &hpa)
HmmProcessAlphabet * clone() const override
std::shared_ptr< const SubstitutionProcessCollection > processColl_
bool worksWith(const HmmStateAlphabet &stateAlphabet) const override
Tell if this instance can work with the instance of alphabet given as input.
HmmProcessAlphabet & operator=(const HmmProcessAlphabet &hpa)
const Clonable & getState(size_t stateIndex) const override
HmmProcessAlphabet(std::shared_ptr< const SubstitutionProcessCollection > pSub, std::vector< size_t > nProc)
Defines the basic types of data flow nodes.