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

lti::similarityFunctor< T > Class Template Reference

This class is the base class for all functors which compute similarity measures between two vectors or matrices. More...

#include <ltiSimilarityFunctor.h>

Inheritance diagram for lti::similarityFunctor< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::similarityFunctor< T >:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class similarityFunctor More...

Public Member Functions

 similarityFunctor ()
 similarityFunctor (const similarityFunctor< T > &other)
virtual ~similarityFunctor ()
virtual const char * getTypeName () const
virtual T apply (const vector< T > &a, const vector< T > &b) const =0
virtual T apply (const matrix< T > &a, const matrix< T > &b) const =0
similarityFunctor< T > & copy (const similarityFunctor< T > &other)
const parametersgetParameters () const

Detailed Description

template<class T>
class lti::similarityFunctor< T >

This class is the base class for all functors which compute similarity measures between two vectors or matrices.

It contains two apply functions, one for each type.

See also:
distanceFunctor

Be careful with the use of the parameters::rowWise. It indicates if the matrix should be considered as having row vectors (true) of columns vectors (false). Depending on that the computations will be very different.


Constructor & Destructor Documentation

template<class T>
lti::similarityFunctor< T >::similarityFunctor (  ) 

default constructor

template<class T>
lti::similarityFunctor< T >::similarityFunctor ( const similarityFunctor< T > &  other  ) 

copy constructor

Parameters:
other the object to be copied
template<class T>
virtual lti::similarityFunctor< T >::~similarityFunctor (  )  [virtual]

destructor


Member Function Documentation

template<class T>
virtual T lti::similarityFunctor< T >::apply ( const matrix< T > &  a,
const matrix< T > &  b 
) const [pure virtual]

calculate the similarity of the matrices a and b

Parameters:
a the first matrix<T>
b the second matrix<T>
Returns:
the similarity of the matrices

Implemented in lti::cosinus2Similarity< T >, and lti::euclideanSimilarity< T >.

template<class T>
virtual T lti::similarityFunctor< T >::apply ( const vector< T > &  a,
const vector< T > &  b 
) const [pure virtual]

calculate the similarity of the vectors a and b

Parameters:
a the first vector<T>
b the second vector<T>
Returns:
the similarity of the vectors

Implemented in lti::cosinus2Similarity< T >, and lti::euclideanSimilarity< T >.

template<class T>
similarityFunctor<T>& lti::similarityFunctor< T >::copy ( const similarityFunctor< T > &  other  ) 

copy data of "other" functor.

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

Reimplemented from lti::functor.

Reimplemented in lti::cosinus2Similarity< T >, and lti::euclideanSimilarity< T >.

template<class T>
const parameters& lti::similarityFunctor< T >::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

Reimplemented in lti::euclideanSimilarity< T >.

template<class T>
virtual const char* lti::similarityFunctor< T >::getTypeName (  )  const [virtual]

returns the name of this type ("distanceFunctor")

Reimplemented from lti::linearAlgebraFunctor.

Reimplemented in lti::cosinus2Similarity< T >, and lti::euclideanSimilarity< T >.


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

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