$search
This class represents the weighted sum of a finite set of probability density functions. More...
#include <Mixture.h>
Classes | |
struct | MixtureStruct |
Public Member Functions | |
void | addComponent (const PDF &pdf, double w) |
Adds a component pdf with given weight. | |
void | clear () |
Removes all components. | |
Mixture * | 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. | |
int | components () const |
Returns the number of components. | |
const PDF & | getComponent (int i) const |
Returns a reference to the i'th component. | |
double | getLikelihood (const PDF &pdf) const |
double | getMaxDensity () const |
NOT IMPLEMENTED FOR MIXTURE. | |
double | getWeight (int i) const |
Returns the weight of the i'th component. | |
Mixture (const Mixture &orig) | |
Copy constructor. | |
Mixture () | |
Constructs a mixture pdf with no initial components. | |
void | normalizeWeights () |
Normalizes the weights of all components. | |
Mixture & | operator= (const Mixture &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. | |
std::string | toString (const std::string &indent="") const |
Represents the Mixture as a string for easier console output. | |
virtual | ~Mixture () |
Destructor. | |
Protected Member Functions | |
void | cloneStruct () |
Protected Attributes | |
MixtureStruct * | ptr_ |
This class represents the weighted sum of a finite set of probability density functions.
Definition at line 54 of file Mixture.h.
Mixture::Mixture | ( | ) |
Constructs a mixture pdf with no initial components.
Definition at line 41 of file Mixture.cpp.
Mixture::Mixture | ( | const Mixture & | orig | ) |
Copy constructor.
Definition at line 44 of file Mixture.cpp.
Mixture::~Mixture | ( | ) | [virtual] |
Destructor.
Definition at line 50 of file Mixture.cpp.
void Mixture::addComponent | ( | const PDF & | pdf, | |
double | w | |||
) |
Adds a component pdf with given weight.
The component pdf | ||
w | Weight of the component |
Definition at line 120 of file Mixture.cpp.
void Mixture::clear | ( | ) |
Removes all components.
Definition at line 101 of file Mixture.cpp.
Mixture * Mixture::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 76 of file Mixture.cpp.
void Mixture::cloneStruct | ( | ) | [protected] |
Definition at line 80 of file Mixture.cpp.
int Mixture::components | ( | ) | const |
Returns the number of components.
Definition at line 116 of file Mixture.cpp.
const PDF & Mixture::getComponent | ( | int | i | ) | const |
Returns a reference to the i'th component.
i | Index of the component |
Definition at line 139 of file Mixture.cpp.
double Mixture::getLikelihood | ( | const PDF & | ) | const [virtual] |
Implements pbl::PDF.
Definition at line 87 of file Mixture.cpp.
double Mixture::getMaxDensity | ( | ) | const [virtual] |
double Mixture::getWeight | ( | int | i | ) | const |
Returns the weight of the i'th component.
i | Index of the component |
Definition at line 144 of file Mixture.cpp.
void Mixture::normalizeWeights | ( | ) |
Normalizes the weights of all components.
Definition at line 149 of file Mixture.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 60 of file Mixture.cpp.
std::string Mixture::toString | ( | const std::string & | indent = "" |
) | const [virtual] |
Represents the Mixture as a string for easier console output.
Implements pbl::PDF.
Definition at line 162 of file Mixture.cpp.
MixtureStruct* pbl::Mixture::ptr_ [protected] |