23 #include "../wrappers/matrix/vector_wrapper.h" 24 #include "../wrappers/matrix/matrix_wrapper.h" 83 const unsigned int num_samples,
85 void * args = NULL)
const;
105 #endif // DISCRETEPDF_H Class representing a PDF on a discrete variable.
virtual ~DiscretePdf()
Destructor.
Class PDF: Virtual Base class representing Probability Density Functions.
bool ProbabilitiesSet(vector< Probability > &values)
Set all probabilities.
virtual DiscretePdf * Clone() const
Clone function.
bool ProbabilitySet(int state, Probability a)
Function to change/set the probability of a single state.
unsigned int _num_states
The number of discrete state.
bool CumPDFUpdate()
Updates the cumPDF.
vector< Probability > * _Values_p
Pointer to the discrete PDF-values, the sum of the elements = 1.
int MostProbableStateGet()
Get the index of the most probable state.
bool SampleFrom(vector< Sample< int > > &list_samples, const unsigned int num_samples, int method=DEFAULT, void *args=NULL) const
vector< double > _CumPDF
STL-vector containing the Cumulative PDF (for efficient sampling)
Probability ProbabilityGet(const int &state) const
Implementation of virtual base class method.
unsigned int NumStatesGet() const
Get the number of discrete States.
vector< Probability > ProbabilitiesGet() const
Get all probabilities.
Class representing a probability (a double between 0 and 1)
bool NormalizeProbs()
Normalize all the probabilities (eg. after setting a probability)
DiscretePdf(unsigned int num_states=0)
Constructor (dimension = number of classes) An equal probability is set for all classes.