Abstract Class representing all _FULLY_ Discrete Conditional PDF's. More...
#include <discreteconditionalpdf.h>
Public Member Functions | |
virtual DiscreteConditionalPdf * | Clone () const |
Clone function. | |
DiscreteConditionalPdf (int num_states=1, int num_conditional_arguments=1, int cond_arg_dimensions[]=NULL) | |
Constructor. | |
DiscreteConditionalPdf (const DiscreteConditionalPdf &pdf) | |
Copy constructor. | |
unsigned int | NumStatesGet () const |
Get the number of discrete states. | |
Probability | ProbabilityGet (const int &input) const |
Get the probability of a certain argument. | |
void | ProbabilitySet (const double &prob, const int &input, const std::vector< int > &condargs) const |
Set the probability (Typical for discrete Pdf's) | |
virtual bool | SampleFrom (Sample< int > &one_sample, int method, void *args) const |
Draw 1 sample from the Pdf: | |
virtual bool | SampleFrom (vector< Sample< int > > &list_samples, int num_samples, int method, void *args) const |
virtual | ~DiscreteConditionalPdf () |
Destructor. | |
Protected Member Functions | |
int | IndexGet (const int &input, const std::vector< int > &condargs) const |
Get the correct index in the row of doubles (double * probability) | |
Protected Attributes | |
int * | _cond_arg_dims_p |
"Possible discrete states" of all the conditional arguments | |
unsigned int | _num_states |
number of discrete states | |
double * | _probability_p |
Pointer to the probability values. | |
std::vector< double > | _probs |
int | _total_dimension |
Total dimension of the likelihoodtable. | |
std::vector< double > | _valuelist |
Abstract Class representing all _FULLY_ Discrete Conditional PDF's.
This class inherits only from ConditionalPdf (not from DiscretePdf, avoiding a circular class structure
------ | | ------ / \ ----- ----- | | | | ----- ----- \ / ------ | | ------
Definition at line 53 of file discreteconditionalpdf.h.
BFL::DiscreteConditionalPdf::DiscreteConditionalPdf | ( | int | num_states = 1 , |
int | num_conditional_arguments = 1 , |
||
int | cond_arg_dimensions[] = NULL |
||
) |
Constructor.
num_states | int representing the number of possible states |
num_conditional_arguments | the number of arguments behind the | |
cond_arg_dimensions[] | possible number of states of the different conditional arguments |
Definition at line 28 of file discreteconditionalpdf.cpp.
Copy constructor.
Definition at line 61 of file discreteconditionalpdf.cpp.
BFL::DiscreteConditionalPdf::~DiscreteConditionalPdf | ( | ) | [virtual] |
Destructor.
Definition at line 51 of file discreteconditionalpdf.cpp.
DiscreteConditionalPdf * BFL::DiscreteConditionalPdf::Clone | ( | ) | const [virtual] |
Clone function.
Reimplemented from BFL::ConditionalPdf< int, int >.
Definition at line 84 of file discreteconditionalpdf.cpp.
int BFL::DiscreteConditionalPdf::IndexGet | ( | const int & | input, |
const std::vector< int > & | condargs | ||
) | const [protected] |
Get the correct index in the row of doubles (double * probability)
Definition at line 96 of file discreteconditionalpdf.cpp.
unsigned int BFL::DiscreteConditionalPdf::NumStatesGet | ( | ) | const |
Get the number of discrete states.
Definition at line 90 of file discreteconditionalpdf.cpp.
Probability BFL::DiscreteConditionalPdf::ProbabilityGet | ( | const int & | input | ) | const [virtual] |
Get the probability of a certain argument.
input | T argument of the Pdf |
Reimplemented from BFL::BFL::Pdf< int >.
Definition at line 119 of file discreteconditionalpdf.cpp.
void BFL::DiscreteConditionalPdf::ProbabilitySet | ( | const double & | prob, |
const int & | input, | ||
const std::vector< int > & | condargs | ||
) | const |
Set the probability (Typical for discrete Pdf's)
Definition at line 127 of file discreteconditionalpdf.cpp.
bool BFL::DiscreteConditionalPdf::SampleFrom | ( | Sample< int > & | one_sample, |
int | method, | ||
void * | args | ||
) | const [virtual] |
Draw 1 sample from the Pdf:
There's no need to create a list for only 1 sample!
one_sample | sample that will contain result of sampling |
method | Sampling method to be used. Each sampling method is currently represented by a #define statement, eg. #define BOXMULLER 1 |
args | Pointer to a struct representing extra sample arguments |
Reimplemented from BFL::BFL::Pdf< int >.
Definition at line 135 of file discreteconditionalpdf.cpp.
bool BFL::DiscreteConditionalPdf::SampleFrom | ( | vector< Sample< int > > & | list_samples, |
int | num_samples, | ||
int | method, | ||
void * | args | ||
) | const [virtual] |
Definition at line 179 of file discreteconditionalpdf.cpp.
int* BFL::DiscreteConditionalPdf::_cond_arg_dims_p [protected] |
"Possible discrete states" of all the conditional arguments
Definition at line 65 of file discreteconditionalpdf.h.
unsigned int BFL::DiscreteConditionalPdf::_num_states [protected] |
number of discrete states
Definition at line 57 of file discreteconditionalpdf.h.
double* BFL::DiscreteConditionalPdf::_probability_p [protected] |
Pointer to the probability values.
For now we implement this using a simple row of doubles, this should probably become a tensor in the future
Definition at line 63 of file discreteconditionalpdf.h.
std::vector<double> BFL::DiscreteConditionalPdf::_probs [mutable, protected] |
Definition at line 75 of file discreteconditionalpdf.h.
int BFL::DiscreteConditionalPdf::_total_dimension [protected] |
Total dimension of the likelihoodtable.
Definition at line 68 of file discreteconditionalpdf.h.
std::vector<double> BFL::DiscreteConditionalPdf::_valuelist [mutable, protected] |
Definition at line 76 of file discreteconditionalpdf.h.