$search

pbl::Mixture Class Reference

This class represents the weighted sum of a finite set of probability density functions. More...

#include <Mixture.h>

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

List of all members.

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.
Mixtureclone () 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 PDFgetComponent (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.
Mixtureoperator= (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

MixtureStructptr_

Detailed Description

This class represents the weighted sum of a finite set of probability density functions.

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

Definition at line 54 of file Mixture.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

void Mixture::addComponent ( const PDF pdf,
double  w 
)

Adds a component pdf with given weight.

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

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.

Parameters:
i Index of the component
Returns:
A reference to the i'th component

Definition at line 139 of file Mixture.cpp.

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

Implements pbl::PDF.

Definition at line 87 of file Mixture.cpp.

double Mixture::getMaxDensity (  )  const [virtual]

NOT IMPLEMENTED FOR MIXTURE.

Implements pbl::PDF.

Definition at line 111 of file Mixture.cpp.

double Mixture::getWeight ( int  i  )  const

Returns the weight of the i'th component.

Parameters:
i Index of the component
Returns:
The weight of the i'th 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.

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

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.

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

Implements pbl::PDF.

Definition at line 162 of file Mixture.cpp.


Member Data Documentation

Definition at line 173 of file Mixture.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