Unified interface for HMMs, independant of the observation type.
More...
#include <Markov.hpp>
|
using | Proba = double |
| Return a list of chord progressions with scores. More...
|
|
using | ObsId = unsigned |
|
using | StateId = unsigned |
|
using | Score = double |
|
Unified interface for HMMs, independant of the observation type.
Return a list of chord progressions with scores.
Scores are non negative. It is guaranted that at least one progression has a score different than 0.
- Parameters
-
n | Number of chord progressions wanted (n > 0 ) |
- Exceptions
-
std::domain_error | If the number of chords requested is higher than what can be generated, an exception is thrown |
- Returns
- A list of n chord progressions, along with their scores, in decreasing order.
virtual std::vector<std::pair<ChordProgression,Score> > HMM::getBestProgressions |
( |
Melody |
M, |
|
|
unsigned |
n = 1 |
|
) |
| const |
|
pure virtual |
Return a list of chord progressions with scores.
Scores are non negative. It is guaranted that at least one progression has a score different than 0.
- Parameters
-
M | Observed melody from which we want to generate chords |
n | Number of chord progressions wanted (n > 0 ) |
- Exceptions
-
std::domain_error | If the number of chords requested is higher than what can be generated, an exception is thrown |
- Returns
- A list of n chord progressions, along with their scores, in decreasing order.
Implemented in HMM_backend< Obs >.
virtual unsigned HMM::getMaxProgressionsNbr |
( |
| ) |
const |
|
pure virtual |
Return the maximal number of distinct progressions that can be generated
- Returns
- a non negative integer, the maximal number of progressions
Implemented in HMM_backend< Obs >.
virtual void HMM::saveToFile |
( |
const std::string & |
fname | ) |
const |
|
pure virtual |
Save the class to a given file.
- Parameters
-
fname | Name of the target file |
Implemented in HMM_backend< Obs >.
HMM* loadFromFile |
( |
std::string |
fname | ) |
|
|
friend |
Load the HMM from a given file.
Be careful, this function erase all the existing data of the class
- Parameters
-
The documentation for this class was generated from the following file: