CVR-Lib last update 20 Sep 2009

cvr::euclideanDistanceFunctor< T > Class Template Reference

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

#include <cvrEuclideanDistanceFunctor.h>

Inheritance diagram for cvr::euclideanDistanceFunctor< T >:

Inheritance graph
[legend]
Collaboration diagram for cvr::euclideanDistanceFunctor< T >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef distanceFunctor< T >
::parameters 
parameters

Public Member Functions

 euclideanDistanceFunctor ()
 euclideanDistanceFunctor (const euclideanDistanceFunctor< T > &other)
virtual ~euclideanDistanceFunctor ()
virtual bool apply (const vector< T > &a, const vector< T > &b, T &dist) const
virtual bool apply (const matrix< T > &a, const matrix< T > &b, vector< T > &dists) const
virtual bool apply (const matrix< T > &m, const vector< T > &v, vector< T > &dest) const
virtual bool apply (const matrix< T > &a, const matrix< T > &b, T &dist) const
euclideanDistanceFunctor< T > & copy (const euclideanDistanceFunctor< T > &other)
virtual
euclideanDistanceFunctor< T > * 
clone () const
virtual
euclideanDistanceFunctor< T > * 
newInstance () const
virtual const std::string & name () const
const parametersgetParameters () const


Detailed Description

template<typename T>
class cvr::euclideanDistanceFunctor< T >

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

See also:
similarityFunctor
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.

Member Typedef Documentation

template<typename T>
typedef distanceFunctor<T>::parameters cvr::euclideanDistanceFunctor< T >::parameters

The parameters of euclideanDistanceFunctor are equivalent to those of distanceFunctor.


Constructor & Destructor Documentation

template<typename T>
cvr::euclideanDistanceFunctor< T >::euclideanDistanceFunctor (  ) 

default constructor

template<typename T>
cvr::euclideanDistanceFunctor< T >::euclideanDistanceFunctor ( const euclideanDistanceFunctor< T > &  other  ) 

copy constructor

Parameters:
other the object to be copied

template<typename T>
virtual cvr::euclideanDistanceFunctor< T >::~euclideanDistanceFunctor (  )  [virtual]

destructor


Member Function Documentation

template<typename T>
virtual bool cvr::euclideanDistanceFunctor< T >::apply ( const matrix< T > &  a,
const matrix< T > &  b,
T &  dist 
) const [virtual]

calculate something like the distance between the matrices a and b: both matrices are seen as vectors.

By default uses the distance() member function.

Parameters:
a the first matrix<T>
b the second matrix<T>
dist the 'distance' between the matrices
Returns:
false on error -> see status string

Implements cvr::distanceFunctor< T >.

template<typename T>
virtual bool cvr::euclideanDistanceFunctor< T >::apply ( const matrix< T > &  m,
const vector< T > &  v,
vector< T > &  dest 
) const [virtual]

Calculate the distance between each row or column of m depending on the value of rowWise and the vector v.

By default uses the distance() member function.

Parameters:
m the matrix<T>
v the vector to be compared with
dest the vector with the distances to the vector v
Returns:
false on error

Implements cvr::distanceFunctor< T >.

template<typename T>
virtual bool cvr::euclideanDistanceFunctor< T >::apply ( const matrix< T > &  a,
const matrix< T > &  b,
vector< T > &  dists 
) const [virtual]

calculate the distances between the rows or columns of the matrices a and b, determined by the parameters rowWise.

By default uses the distance() member function.

Parameters:
a the first vector<T>
b the second vector<T>
dists the distances between the matrices
Returns:
false on error -> see status string

Implements cvr::distanceFunctor< T >.

template<typename T>
virtual bool cvr::euclideanDistanceFunctor< T >::apply ( const vector< T > &  a,
const vector< T > &  b,
T &  dist 
) const [virtual]

calculate the distance between the vectors a and b.

By default uses the distance member function.

Parameters:
a the first vector<T>
b the second vector<T>
dist the distance between the vectors
Returns:
false on error -> see status string

Implements cvr::distanceFunctor< T >.

template<typename T>
virtual euclideanDistanceFunctor<T>* cvr::euclideanDistanceFunctor< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements cvr::distanceFunctor< T >.

template<typename T>
euclideanDistanceFunctor<T>& cvr::euclideanDistanceFunctor< T >::copy ( const euclideanDistanceFunctor< T > &  other  ) 

copy data of "other" functor.

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

template<typename T>
const parameters& cvr::euclideanDistanceFunctor< T >::getParameters (  )  const

returns used parameters

Reimplemented from cvr::distanceFunctor< T >.

template<typename T>
virtual const std::string& cvr::euclideanDistanceFunctor< T >::name (  )  const [virtual]

Return the name of the class.

Reimplemented from cvr::distanceFunctor< T >.

template<typename T>
virtual euclideanDistanceFunctor<T>* cvr::euclideanDistanceFunctor< T >::newInstance (  )  const [virtual]

returns a pointer to a new instance of this functor.

Implements cvr::distanceFunctor< T >.


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

Generated on Sun Sep 20 22:08:57 2009 for CVR-Lib by Doxygen 1.5.8