LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::mahalanobisDistance Class Reference

This class computes the mahalanobis distance. More...

#include <ltiMahalanobisDistance.h>

Inheritance diagram for lti::mahalanobisDistance:
Inheritance graph
[legend]
Collaboration diagram for lti::mahalanobisDistance:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 mahalanobisDistance ()
 mahalanobisDistance (const mahalanobisDistance &other)
virtual ~mahalanobisDistance ()
virtual const char * getTypeName () const
bool apply (const dvector &p1, const dvector &p2, const dmatrix &coV, double &distance) const
double apply (const dvector &p1, const dvector &p2, const dmatrix &coV) const
bool apply (const dvector &p1, const dmatrix &cluster, double &distance) const
double apply (const dvector &p1, const dmatrix &cluster) const
mahalanobisDistancecopy (const mahalanobisDistance &other)
mahalanobisDistanceoperator= (const mahalanobisDistance &other)
virtual functorclone () const
const parametersgetParameters () const

Detailed Description

This class computes the mahalanobis distance.

The distance can either be computed as distance between a point and a matrix with a distribution or direct from two points and a given covariance matrix, where one point is expected to be the mean of the distribution.

The mahalanobis distance is defined as follows:

\[ d=\sqrt{(z_1-z_2)^T\Sigma^{-1}(z_1-z_2)} \]

where $ \Sigma $ is the covariance matrix of the distribution.


Constructor & Destructor Documentation

lti::mahalanobisDistance::mahalanobisDistance (  ) 

default constructor

lti::mahalanobisDistance::mahalanobisDistance ( const mahalanobisDistance other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::mahalanobisDistance::~mahalanobisDistance (  )  [virtual]

destructor


Member Function Documentation

double lti::mahalanobisDistance::apply ( const dvector p1,
const dmatrix cluster 
) const

computes the mahalanobis distance between the point p1 and the given distribution

Parameters:
p1 the point whose distance to the distribution is computed.
cluster the mean of the distribution .
Returns:
the mahalanobis distance.
bool lti::mahalanobisDistance::apply ( const dvector p1,
const dmatrix cluster,
double &  distance 
) const

computes the mahalanobis distance between the point p1 and the given distribution

Parameters:
p1 the point whose distance to the distribution is computed.
cluster the distribution.
distance the mahalanobis distance.
Returns:
true if apply successful or false otherwise.
double lti::mahalanobisDistance::apply ( const dvector p1,
const dvector p2,
const dmatrix coV 
) const

computes the mahalanobis distance between the point p1 and the given distribution

Parameters:
p1 the point whose distance to the distribution is computed.
p2 the mean of the distribution .
coV the covarianz matrix of the distribution .
Returns:
the mahalanobis distance.
bool lti::mahalanobisDistance::apply ( const dvector p1,
const dvector p2,
const dmatrix coV,
double &  distance 
) const

computes the mahalanobis distance between the point p1 and the given distribution

Parameters:
p1 the point whose distance to the distribution is computed.
p2 the mean of the distribution .
coV the covarianz matrix of the distribution .
distance the mahalanobis distance.
Returns:
true if apply successful or false otherwise.
virtual functor* lti::mahalanobisDistance::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

mahalanobisDistance& lti::mahalanobisDistance::copy ( const mahalanobisDistance other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

const parameters& lti::mahalanobisDistance::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

virtual const char* lti::mahalanobisDistance::getTypeName (  )  const [virtual]

returns the name of this type ("mahalanobisDistance")

Reimplemented from lti::linearAlgebraFunctor.

mahalanobisDistance& lti::mahalanobisDistance::operator= ( const mahalanobisDistance other  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:28:30 2010 for LTI-Lib by Doxygen 1.6.1