This class represents a hyper-cube shaped uniform distribution. More...
#include <Uniform.h>

Public Member Functions | |
| Uniform * | clone () const |
| Creates a clone of the object. The clone method is cheap since it only copies a pointer. A deep clone will only be created if the original object is modified. More... | |
| double | getDensity (const arma::vec &vec) const |
| Calculates the density of the distribution at point v. Will always return the same density if v is inside the volume, and 0 otherwise. More... | |
| double | getLikelihood (const PDF &pdf) const |
| double | getMaxDensity () const |
| Returns the maximum density of this distribution, which always equals 1 / volume. More... | |
| Uniform & | operator= (const Uniform &other) |
| Assignment operator. The operation is cheap since it only copies a pointer. A deep clone will only be created if the original object is modified. More... | |
| void | setDensity (const double &density) |
| Sets the density of the uniform distribution. More... | |
| void | setMean (const pbl::Vector mean) |
| Set the mean of the volume representing this uniform distribution. More... | |
| void | setSize (const pbl::Vector size) |
| Set the size of the volume representing this uniform distribution. More... | |
| std::string | toString (const std::string &indent="") const |
| Represents the uniform distribution as a string for easier console output. More... | |
| Uniform (int dim) | |
| Constructs a uniform distribution with known dimensionality but unknown size and density. More... | |
| Uniform (int dim, double density) | |
| Constructs a uniform distribution with known dimensionality and density, but unknown shape. Will become obsolete in the future. More... | |
| Uniform (pbl::Vector mean, pbl::Vector size) | |
| Constructs a uniform distribution with given mean value and size. The density of the distribution equals 1 / Volume, with the volume being determined by the size vector. More... | |
| Uniform (const Uniform &pdf) | |
| Copy constructor. More... | |
| virtual | ~Uniform () |
| Destructor. More... | |
Public Member Functions inherited from pbl::PDF | |
| int | dimensions () const |
| virtual bool | getExpectedValue (std::string &v) const |
| virtual bool | getExpectedValue (arma::vec &v) const |
| PDF (int dimensions, PDFType type) | |
| PDF (const PDF &orig) | |
| PDFType | type () const |
| virtual | ~PDF () |
Protected Member Functions | |
| void | calculateUniformDensity () |
Protected Attributes | |
| pbl::Vector | mean_ |
| pbl::Vector | size_ |
| bool | size_is_set_ |
| double | uniform_probability_ |
Protected Attributes inherited from pbl::PDF | |
| int | dimensions_ |
| PDFType | type_ |
Additional Inherited Members | |
Public Types inherited from pbl::PDF | |
| enum | PDFType { GAUSSIAN, MIXTURE, UNIFORM, DISCRETE, EXACT, HYBRID, UNKNOWN } |
This class represents a hyper-cube shaped uniform distribution.
| Uniform::Uniform | ( | int | dim | ) |
Constructs a uniform distribution with known dimensionality but unknown size and density.
| dim | The dimensionality of the uniform distribution |
Definition at line 42 of file Uniform.cpp.
| Uniform::Uniform | ( | int | dim, |
| double | density | ||
| ) |
Constructs a uniform distribution with known dimensionality and density, but unknown shape. Will become obsolete in the future.
| dim | The dimensionality of the uniform distribution |
| density | The density of the uniform distribution |
Definition at line 45 of file Uniform.cpp.
| Uniform::Uniform | ( | pbl::Vector | mean, |
| pbl::Vector | size | ||
| ) |
Constructs a uniform distribution with given mean value and size. The density of the distribution equals 1 / Volume, with the volume being determined by the size vector.
| mean | The mean of the uniform distribution |
| size | The size of the uniform distribution |
Definition at line 48 of file Uniform.cpp.
| Uniform::Uniform | ( | const Uniform & | ) |
Copy constructor.
Definition at line 52 of file Uniform.cpp.
|
virtual |
Destructor.
Definition at line 56 of file Uniform.cpp.
|
protected |
Definition at line 145 of file Uniform.cpp.
|
virtual |
Creates a clone of the object. The clone method is cheap since it only copies a pointer. A deep clone will only be created if the original object is modified.
Implements pbl::PDF.
Definition at line 70 of file Uniform.cpp.
| double Uniform::getDensity | ( | const arma::vec & | vec | ) | const |
Calculates the density of the distribution at point v. Will always return the same density if v is inside the volume, and 0 otherwise.
| v | The point to calculate the density for |
Definition at line 128 of file Uniform.cpp.
|
virtual |
Implements pbl::PDF.
Definition at line 74 of file Uniform.cpp.
|
virtual |
Returns the maximum density of this distribution, which always equals 1 / volume.
Implements pbl::PDF.
Definition at line 132 of file Uniform.cpp.
Assignment operator. The operation is cheap since it only copies a pointer. A deep clone will only be created if the original object is modified.
Definition at line 59 of file Uniform.cpp.
| void Uniform::setDensity | ( | const double & | density | ) |
Sets the density of the uniform distribution.
| density | The uniform density of the distribution |
Definition at line 123 of file Uniform.cpp.
| void Uniform::setMean | ( | const pbl::Vector | mean | ) |
Set the mean of the volume representing this uniform distribution.
| mean | The mean of the volumne |
Definition at line 136 of file Uniform.cpp.
| void Uniform::setSize | ( | const pbl::Vector | size | ) |
Set the size of the volume representing this uniform distribution.
| size | The size of the volumne |
Definition at line 140 of file Uniform.cpp.
|
virtual |
Represents the uniform distribution as a string for easier console output.
Implements pbl::PDF.
Definition at line 154 of file Uniform.cpp.
|
protected |
|
protected |