$search

pbl::Uniform Class Reference

This class represents a hyper-cube shaped uniform distribution. More...

#include <Uniform.h>

Inheritance diagram for pbl::Uniform:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Uniformclone () 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.
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.
double getLikelihood (const PDF &pdf) const
double getMaxDensity () const
 Returns the maximum density of this distribution, which always equals 1 / volume.
Uniformoperator= (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.
void setDensity (const double &density)
 Sets the density of the uniform distribution.
void setMean (const pbl::Vector mean)
 Set the mean of the volume representing this uniform distribution.
void setSize (const pbl::Vector size)
 Set the size of the volume representing this uniform distribution.
std::string toString (const std::string &indent="") const
 Represents the uniform distribution as a string for easier console output.
 Uniform (const Uniform &pdf)
 Copy constructor.
 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.
 Uniform (int dim, double density)
 Constructs a uniform distribution with known dimensionality and density, but unknown shape. Will become obsolete in the future.
 Uniform (int dim)
 Constructs a uniform distribution with known dimensionality but unknown size and density.
virtual ~Uniform ()
 Destructor.

Protected Member Functions

void calculateUniformDensity ()

Protected Attributes

pbl::Vector mean_
pbl::Vector size_
bool size_is_set_
double uniform_probability_

Detailed Description

This class represents a hyper-cube shaped uniform distribution.

Author:
Sjoerd van den Dries
Date:
December, 2012
Version:
1.0

Definition at line 51 of file Uniform.h.


Constructor & Destructor Documentation

Uniform::Uniform ( int  dim  ) 

Constructs a uniform distribution with known dimensionality but unknown size and density.

Parameters:
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.

Parameters:
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.

Parameters:
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 pdf  ) 

Copy constructor.

Definition at line 52 of file Uniform.cpp.

Uniform::~Uniform (  )  [virtual]

Destructor.

Definition at line 56 of file Uniform.cpp.


Member Function Documentation

void Uniform::calculateUniformDensity (  )  [protected]

Definition at line 145 of file Uniform.cpp.

Uniform * Uniform::clone (  )  const [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.

Parameters:
v The point to calculate the density for
Returns:
The density of the distribution at point v

Definition at line 128 of file Uniform.cpp.

double Uniform::getLikelihood ( const PDF pdf  )  const [virtual]

Implements pbl::PDF.

Definition at line 74 of file Uniform.cpp.

double Uniform::getMaxDensity (  )  const [virtual]

Returns the maximum density of this distribution, which always equals 1 / volume.

Returns:
The maximum density of this distribution

Implements pbl::PDF.

Definition at line 132 of file Uniform.cpp.

Uniform & 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.

Definition at line 59 of file Uniform.cpp.

void Uniform::setDensity ( const double &  density  ) 

Sets the density of the uniform distribution.

Note:
Only makes sense if the size of the volume is not set
Parameters:
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.

Parameters:
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.

Parameters:
size The size of the volumne

Definition at line 140 of file Uniform.cpp.

std::string Uniform::toString ( const std::string &  indent = ""  )  const [virtual]

Represents the uniform distribution as a string for easier console output.

Note:
Should be changed into stream operator <<
Returns:
The Gaussian as string

Implements pbl::PDF.

Definition at line 154 of file Uniform.cpp.


Member Data Documentation

Definition at line 148 of file Uniform.h.

Definition at line 150 of file Uniform.h.

bool pbl::Uniform::size_is_set_ [protected]

Definition at line 154 of file Uniform.h.

Definition at line 152 of file Uniform.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


problib
Author(s): Sjoerd van den Dries
autogenerated on Tue Mar 5 12:28:33 2013