5 #include "../Matrix/MatrixTools.h" 6 #include "../Random/RandomTools.h" 7 #include "../VectorTools.h" 15 pij_(static_cast<size_t>(alph->getNumberOfStates()), static_cast<size_t>(alph->getNumberOfStates())),
16 tmpmat_(static_cast<size_t>(alph->getNumberOfStates()), static_cast<size_t>(alph->getNumberOfStates())),
17 eqFreq_(static_cast<size_t>(alph->getNumberOfStates())),
42 if (stateAlphabet ==
nullptr)
45 alph_ = stateAlphabet;
62 for (
size_t i = 0; i < nbStates; ++i)
74 for (
size_t pos = 1; pos < size; pos++)
80 for (
size_t i = 0; i < nbStates; ++i)
AbstractHmmTransitionMatrix(std::shared_ptr< const HmmStateAlphabet > alph, const std::string &prefix="")
const HmmStateAlphabet & hmmStateAlphabet() const
virtual const Matrix< double > & getPij() const =0
Get all transition probabilities as a matrix.
RowMatrix< double > tmpmat_
Partial implementation of HmmTransitionMatrix.
std::shared_ptr< const HmmStateAlphabet > alph_
std::vector< size_t > sample(size_t size) const
sampling of a sequence of states. Starting point is sampled from the equilibrium distribution.
virtual size_t getNumberOfStates() const =0
const std::vector< Scalar > & getRow(size_t i) const
void setHmmStateAlphabet(std::shared_ptr< const HmmStateAlphabet > stateAlphabet)
Set the new hidden state alphabet.
AbstractHmmTransitionMatrix & operator=(const AbstractHmmTransitionMatrix &hptm)
Exception thrown when an unvalid alphabet is specified.