gml_TGaussian2 Class Template Reference

#include <gml_Gaussian2.h>

Collaboration diagram for gml_TGaussian2:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T>
class gml_TGaussian2< T >

Compute and maintain a gaussian representation (approximation) of a set of 2-dimensionnal samples.


Public Member Functions

 gml_TGaussian2 ()
 Constructor: zero the fields.
gml_TError Init ()
 Setup the structure.
void Reset ()
 Zero the structure.
void Dispose ()
 Do nothing.
void Clone (gml_TGaussian2< T > *gauss)
 Set this to be the exact copy of gauss.
void Add (gml_TGaussian2< T > *gauss)
 Adds the distribution of gauss in this.
void AddSample (T *s)
 Adds a sample in the set. s must point to an array of two T values.
void AddSample (T x, T y)
 Adds a sample in the set.
void AddSample (T x, T y, T weight)
 Adds a weighted sample in the set.
Samples ()
 Return the total number of samples added.
gml_TError UpdateStats ()
 Compute mean, covariance, and inverse covariance. Returns an error if the covariance matrix could not be inverted.
GetMahaSquared (T x, T y)
 Returns the squared mahalanobis distance from (x, y) to the gaussian.
Value (T x, T y)
 Return the gaussian's value at (x, y).
void GetMean (T *m)
 Calculates the mean of the gaussian and puts the result in m. m must point to an array of two T values.
void GetVar (T *m)
 Calculates the covariance matrix of the gaussian and puts the result in m. m must point to an array of four T values.

Public Attributes

fCount
 number of samples added to set
fSum [2]
 sum of samples by components
fSumSq [2]
 sum of samples squared by components
fMixSum
 sum of component products
fMean [2]
fCovariance [4]
fInvCovariance [4]

Member Function Documentation

T GetMahaSquared ( x,
y 
) [inline]

Returns the squared mahalanobis distance from (x, y) to the gaussian.

Warning:
Call UpdateStats() before calling GetMahaSquared().

T Value ( x,
y 
) [inline]

Return the gaussian's value at (x, y).

Warning:
Call UpdateStats() before calling Value().


The documentation for this class was generated from the following file:
Generated on Tue Jun 12 14:03:28 2007 for gml by Doxygen 1.5.2.