latest version v1.9 - last update 10 Apr 2010 |
This class is the base class for all functors which compute distances between two vectors or matrices as well as norms of vectors and matrices. More...
#include <ltiDistanceFunctor.h>
Classes | |
class | parameters |
the parameters for the class distanceFunctor More... | |
Public Member Functions | |
distanceFunctor () | |
distanceFunctor (const distanceFunctor< T > &other) | |
virtual | ~distanceFunctor () |
virtual const char * | getTypeName () const |
virtual bool | apply (const vector< T > &v, T &norm) const =0 |
virtual T | apply (const vector< T > &v) const =0 |
virtual bool | apply (const matrix< T > &m, vector< T > &norms) const =0 |
virtual bool | apply (const matrix< T > &m, T &norm) const =0 |
virtual T | apply (const matrix< T > &m) const =0 |
virtual bool | apply (const vector< T > &a, const vector< T > &b, T &dist) const =0 |
virtual T | apply (const vector< T > &a, const vector< T > &b) const =0 |
virtual bool | apply (const matrix< T > &a, const matrix< T > &b, vector< T > &dists) const =0 |
virtual bool | apply (const matrix< T > &m, const vector< T > &v, vector< T > &dest) const =0 |
virtual bool | apply (const matrix< T > &a, const matrix< T > &b, T &dist) const =0 |
virtual T | apply (const matrix< T > &a, const matrix< T > &b) const =0 |
distanceFunctor< T > & | copy (const distanceFunctor< T > &other) |
virtual functor * | clone () const =0 |
const parameters & | getParameters () const |
This class is the base class for all functors which compute distances between two vectors or matrices as well as norms of vectors and matrices.
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.
lti::distanceFunctor< T >::distanceFunctor | ( | ) |
default constructor
lti::distanceFunctor< T >::distanceFunctor | ( | const distanceFunctor< T > & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::distanceFunctor< T >::~distanceFunctor | ( | ) | [virtual] |
destructor
virtual T lti::distanceFunctor< T >::apply | ( | const matrix< T > & | a, | |
const matrix< T > & | b | |||
) | const [pure virtual] |
calculate something like the distance between the matrices a and b: both matrices are seen as vectors.
a | the first matrix<T> | |
b | the second matrix<T> |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual bool lti::distanceFunctor< T >::apply | ( | const matrix< T > & | a, | |
const matrix< T > & | b, | |||
T & | dist | |||
) | const [pure virtual] |
calculate something like the distance between the matrices a and b: both matrices are seen as vectors.
a | the first matrix<T> | |
b | the second matrix<T> | |
dist | the 'distance' between the matrices |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual bool lti::distanceFunctor< T >::apply | ( | const matrix< T > & | m, | |
const vector< T > & | v, | |||
vector< T > & | dest | |||
) | const [pure virtual] |
Calculate the distance between each row or column of m depending on the value of rowWise and the vector v.
m | the matrix<T> | |
v | the vector to be compared with | |
dest | the vector with the distances to the vector v |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual bool lti::distanceFunctor< T >::apply | ( | const matrix< T > & | a, | |
const matrix< T > & | b, | |||
vector< T > & | dists | |||
) | const [pure virtual] |
calculate the distances between the rows or columns of the matrices a and b, determined by the parameters rowWise.
a | the first vector<T> | |
b | the second vector<T> | |
dists | the distances between the matrices |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual T lti::distanceFunctor< T >::apply | ( | const vector< T > & | a, | |
const vector< T > & | b | |||
) | const [pure virtual] |
calculate the distance between the vectors a and b
a | the first vector<T> | |
b | the second vector<T> |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual bool lti::distanceFunctor< T >::apply | ( | const vector< T > & | a, | |
const vector< T > & | b, | |||
T & | dist | |||
) | const [pure virtual] |
calculate the distance between the vectors a and b
a | the first vector<T> | |
b | the second vector<T> | |
dist | the distance between the vectors |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual T lti::distanceFunctor< T >::apply | ( | const matrix< T > & | m | ) | const [pure virtual] |
calculate something like the norm of the matrix: the matrix is seen as a vector.
m | the matrix<T> |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual bool lti::distanceFunctor< T >::apply | ( | const matrix< T > & | m, | |
T & | norm | |||
) | const [pure virtual] |
calculate something like the norm of the matrix: the matrix is seen as a vector.
m | the matrix<T> | |
norm | the 'norm' of the matrix |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual bool lti::distanceFunctor< T >::apply | ( | const matrix< T > & | m, | |
vector< T > & | norms | |||
) | const [pure virtual] |
calculate the norms of rows or columns of the matrix
m | the matrix<T> | |
norms | the norms of the rows/columns |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual T lti::distanceFunctor< T >::apply | ( | const vector< T > & | v | ) | const [pure virtual] |
calculate the norm of vector v
v | the vector<T> |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual bool lti::distanceFunctor< T >::apply | ( | const vector< T > & | v, | |
T & | norm | |||
) | const [pure virtual] |
calculate the norm of vector v.
v | the vector<T> | |
norm | the norm of the vector |
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
virtual functor* lti::distanceFunctor< T >::clone | ( | ) | const [pure virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
Implemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.
distanceFunctor<T>& lti::distanceFunctor< T >::copy | ( | const distanceFunctor< T > & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::functor.
Reimplemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, and lti::l2Distance< T >.
const parameters& lti::distanceFunctor< T >::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::functor.
Reimplemented in lti::earthMoversDistance< W, C, D >.
virtual const char* lti::distanceFunctor< T >::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("distanceFunctor")
Reimplemented from lti::linearAlgebraFunctor.
Reimplemented in lti::earthMoversDistance< W, C, D >, lti::l1Distance< T >, lti::l2Distance< T >, and lti::l2Distance< double >.