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.
Probability ProbabilityGet(const int &state) const
Implementation of virtual base class method.
bool ProbabilitiesSet(vector< Probability > &values)
Set all probabilities.
bool ProbabilitySet(int state, Probability a)
Function to change/set the probability of a single state.
unsigned int NumStatesGet() const
Get the number of discrete States.
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.
vector< Probability > ProbabilitiesGet() const
Get all probabilities.
int MostProbableStateGet()
Get the index of the most probable state.
vector< double > _CumPDF
STL-vector containing the Cumulative PDF (for efficient sampling)
virtual DiscretePdf * Clone() const
Clone function.
Class representing a probability (a double between 0 and 1)
bool NormalizeProbs()
Normalize all the probabilities (eg. after setting a probability)
bool SampleFrom(vector< Sample< int > > &list_samples, const unsigned int num_samples, int method=DEFAULT, void *args=NULL) const
DiscretePdf(unsigned int num_states=0)
Constructor (dimension = number of classes) An equal probability is set for all classes.