Abstract Class representing all FULLY Discrete Conditional PDF's. More...
#include <discreteconditionalpdf.h>
Public Member Functions | |
virtual DiscreteConditionalPdf * | Clone () const |
Clone function. More... | |
DiscreteConditionalPdf (int num_states=1, int num_conditional_arguments=1, int cond_arg_dimensions[]=NULL) | |
Constructor. More... | |
DiscreteConditionalPdf (const DiscreteConditionalPdf &pdf) | |
Copy constructor. More... | |
unsigned int | NumStatesGet () const |
Get the number of discrete states. More... | |
Probability | ProbabilityGet (const int &input) const |
Get the probability of a certain argument. More... | |
void | ProbabilitySet (const double &prob, const int &input, const std::vector< int > &condargs) const |
Set the probability (Typical for discrete Pdf's) More... | |
virtual bool | SampleFrom (Sample< int > &one_sample, int method, void *args) const |
Draw 1 sample from the Pdf: More... | |
virtual bool | SampleFrom (vector< Sample< int > > &list_samples, int num_samples, int method, void *args) const |
virtual | ~DiscreteConditionalPdf () |
Destructor. More... | |
Public Member Functions inherited from BFL::ConditionalPdf< int, int > | |
const int & | ConditionalArgumentGet (unsigned int n_argument) const |
Get the n-th argument of the list. More... | |
virtual void | ConditionalArgumentSet (unsigned int n_argument, const int &argument) |
Set the n-th argument of the list. More... | |
const std::vector< int > & | ConditionalArgumentsGet () const |
Get the whole list of conditional arguments. More... | |
virtual void | ConditionalArgumentsSet (std::vector< int > ConditionalArguments) |
Set the whole list of conditional arguments. More... | |
ConditionalPdf (int dimension=0, unsigned int num_conditional_arguments=0) | |
Constructor. More... | |
unsigned int | NumConditionalArgumentsGet () const |
Get the Number of conditional arguments. More... | |
virtual void | NumConditionalArgumentsSet (unsigned int numconditionalarguments) |
Set the Number of conditional arguments. More... | |
virtual | ~ConditionalPdf () |
Destructor. More... | |
Public Member Functions inherited from BFL::BFL::Pdf< int > | |
virtual MatrixWrapper::SymmetricMatrix | CovarianceGet () const |
Get the Covariance Matrix E[(x - E[x])^2] of the Analytic pdf. More... | |
unsigned int | DimensionGet () const |
Get the dimension of the argument. More... | |
virtual void | DimensionSet (unsigned int dim) |
Set the dimension of the argument. More... | |
virtual int | ExpectedValueGet () const |
Get the expected value E[x] of the pdf. More... | |
Pdf (unsigned int dimension=0) | |
Constructor. More... | |
virtual bool | SampleFrom (vector< Sample< int > > &list_samples, const unsigned int num_samples, int method=DEFAULT, void *args=NULL) const |
Draw multiple samples from the Pdf (overloaded) More... | |
virtual | ~Pdf () |
Destructor. More... | |
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) More... | |
Protected Attributes | |
int * | _cond_arg_dims_p |
"Possible discrete states" of all the conditional arguments More... | |
unsigned int | _num_states |
number of discrete states More... | |
double * | _probability_p |
Pointer to the probability values. More... | |
std::vector< double > | _probs |
int | _total_dimension |
Total dimension of the likelihoodtable. More... | |
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.
BFL::DiscreteConditionalPdf::DiscreteConditionalPdf | ( | const DiscreteConditionalPdf & | ) |
Copy constructor.
Definition at line 61 of file discreteconditionalpdf.cpp.
|
virtual |
Destructor.
Definition at line 51 of file discreteconditionalpdf.cpp.
|
virtual |
Clone function.
Reimplemented from BFL::ConditionalPdf< int, int >.
Definition at line 84 of file discreteconditionalpdf.cpp.
|
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.
|
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.
|
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.
|
virtual |
Definition at line 179 of file discreteconditionalpdf.cpp.
|
protected |
"Possible discrete states" of all the conditional arguments
Definition at line 65 of file discreteconditionalpdf.h.
|
protected |
number of discrete states
Definition at line 57 of file discreteconditionalpdf.h.
|
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.
|
mutableprotected |
Definition at line 75 of file discreteconditionalpdf.h.
|
protected |
Total dimension of the likelihoodtable.
Definition at line 68 of file discreteconditionalpdf.h.
|
mutableprotected |
Definition at line 76 of file discreteconditionalpdf.h.