Public Member Functions | Protected Member Functions | Protected Attributes
BFL::DiscreteConditionalPdf Class Reference

Abstract Class representing all _FULLY_ Discrete Conditional PDF's. More...

#include <discreteconditionalpdf.h>

Inheritance diagram for BFL::DiscreteConditionalPdf:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual DiscreteConditionalPdfClone () 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

Detailed Description

Abstract Class representing all _FULLY_ Discrete Conditional PDF's.

This class inherits only from ConditionalPdf (not from DiscretePdf, avoiding a circular class structure

            ------
            |    |
            ------
           /      \
      -----        -----
      |   |        |   |
      -----        -----
           \      /
            ------
	    |    |
	    ------
      
Todo:
Check if this is the best way to implement this.
Note:
that the name of this class could be better chosen. Something like Discrete-DiscreteConditionalPdf would maybe be more clear (???), but quite long...
See also:
ConditionalPdf

Definition at line 53 of file discreteconditionalpdf.h.


Constructor & Destructor Documentation

BFL::DiscreteConditionalPdf::DiscreteConditionalPdf ( int  num_states = 1,
int  num_conditional_arguments = 1,
int  cond_arg_dimensions[] = NULL 
)

Constructor.

Precondition:
The number of elements of cond_arg_dimensions should be equal to num_conditional_arguments, otherwise -> Segfaults
Parameters:
num_statesint representing the number of possible states
num_conditional_argumentsthe number of arguments behind the |
cond_arg_dimensions[]possible number of states of the different conditional arguments
See also:
ConditionalPdf
Todo:
Get cleaner api and implementation

Definition at line 28 of file discreteconditionalpdf.cpp.

Copy constructor.

Definition at line 61 of file discreteconditionalpdf.cpp.

Destructor.

Definition at line 51 of file discreteconditionalpdf.cpp.


Member Function Documentation

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.

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.

Parameters:
inputT argument of the Pdf
Returns:
the probability value of the argument

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!

Parameters:
one_samplesample that will contain result of sampling
methodSampling method to be used. Each sampling method is currently represented by a #define statement, eg. #define BOXMULLER 1
argsPointer to a struct representing extra sample arguments
See also:
SampleFrom()
Bug:
Sometimes the compiler doesn't know which method to choose!

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.


Member Data Documentation

"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.

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.

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.


The documentation for this class was generated from the following files:


bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Thu Feb 11 2016 22:31:57