bpp-core3  3.0.0
HmmEmissionProbabilities.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_NUMERIC_HMM_HMMEMISSIONPROBABILITIES_H
6 #define BPP_NUMERIC_HMM_HMMEMISSIONPROBABILITIES_H
7 
8 
9 #include "../Parametrizable.h"
10 #include "HmmExceptions.h"
11 #include "HmmStateAlphabet.h"
12 
13 // From the STL:
14 #include <vector>
15 
16 namespace bpp
17 {
30  public virtual Parametrizable
31 {
32 public:
33  virtual HmmEmissionProbabilities* clone() const override = 0;
34 
38  virtual const HmmStateAlphabet& hmmStateAlphabet() const = 0;
39 
43  virtual std::shared_ptr<const HmmStateAlphabet> getHmmStateAlphabet() const = 0;
44 
50  virtual void setHmmStateAlphabet(std::shared_ptr<const HmmStateAlphabet> stateAlphabet) = 0;
51 
61  virtual double operator()(size_t pos, size_t state) const = 0;
62 
63  virtual void computeDEmissionProbabilities(std::string& variable) const
64  {
65  throw (NotImplementedException("HmmEmissionProbabilities::computeDEmissionProbabilities is not overdefined."));
66  }
67 
68  virtual void computeD2EmissionProbabilities(std::string& variable) const
69  {
70  throw (NotImplementedException("HmmEmissionProbabilities::computeD2EmissionProbabilities is not overdefined."));
71  }
72 
73  virtual const std::vector<double>& getDEmissionProbabilities(size_t pos) const
74  {
75  throw (NotImplementedException("HmmEmissionProbabilities::getDEmissionProbability is not overdefined."));
76  }
77 
78  virtual const std::vector<double>& getD2EmissionProbabilities(size_t pos) const
79  {
80  throw (NotImplementedException("HmmEmissionProbabilities::getD2EmissionProbability is not overdefined."));
81  }
82 
92  virtual const std::vector<double>& operator()(size_t pos) const = 0;
93 
97  virtual size_t getNumberOfPositions() const = 0;
98 };
99 } // end of namespace bpp.
100 #endif // BPP_NUMERIC_HMM_HMMEMISSIONPROBABILITIES_H
Hidden states alphabet.
virtual const std::vector< double > & getDEmissionProbabilities(size_t pos) const
Interface for computing emission probabilities in a Hidden Markov Model.
This is the interface for all objects that imply parameters.
virtual double operator()(size_t pos, size_t state) const =0
Operator access to the emission probabilities.
This exception is sent when a given method is not implemented.
Definition: Exceptions.h:191
virtual HmmEmissionProbabilities * clone() const override=0
Create a copy of this object and send a pointer to it.
virtual void computeDEmissionProbabilities(std::string &variable) const
virtual size_t getNumberOfPositions() const =0
virtual const std::vector< double > & getD2EmissionProbabilities(size_t pos) const
virtual std::shared_ptr< const HmmStateAlphabet > getHmmStateAlphabet() const =0
virtual const HmmStateAlphabet & hmmStateAlphabet() const =0
virtual void computeD2EmissionProbabilities(std::string &variable) const
virtual void setHmmStateAlphabet(std::shared_ptr< const HmmStateAlphabet > stateAlphabet)=0
Set the new hidden state alphabet.