latest version v1.9 - last update 10 Apr 2010 |
Quadratic Cosinus Similarity. More...
#include <ltiCosinusSimilarity.h>
Public Member Functions | |
cosinus2Similarity () | |
cosinus2Similarity (const cosinus2Similarity< T > &other) | |
virtual | ~cosinus2Similarity () |
virtual const char * | getTypeName () const |
T | apply (const vector< T > &a, const vector< T > &b) const |
T | apply (const matrix< T > &a, const matrix< T > &b) const |
vector< T > & | apply (const matrix< T > &a, const vector< T > &b, vector< T > &dest) const |
cosinus2Similarity & | copy (const cosinus2Similarity &other) |
virtual functor * | clone () const |
Quadratic Cosinus Similarity.
This class computes the similarity of two vectors or matrices by means of the quadratic cosinus of the angle between the two vectors.
lti::cosinus2Similarity< T >::cosinus2Similarity | ( | ) |
default constructor
lti::cosinus2Similarity< T >::cosinus2Similarity | ( | const cosinus2Similarity< T > & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::cosinus2Similarity< T >::~cosinus2Similarity | ( | ) | [virtual] |
destructor
vector<T>& lti::cosinus2Similarity< T >::apply | ( | const matrix< T > & | a, | |
const vector< T > & | b, | |||
vector< T > & | dest | |||
) | const |
T lti::cosinus2Similarity< T >::apply | ( | const matrix< T > & | a, | |
const matrix< T > & | b | |||
) | const [virtual] |
Take the matrices as vectors and compute the similarity of them.
Implements lti::similarityFunctor< T >.
T lti::cosinus2Similarity< T >::apply | ( | const vector< T > & | a, | |
const vector< T > & | b | |||
) | const [virtual] |
calculates the quadratic cosinus-type of similarity of the vectors a and b.
If both vectors have different sizes, the returned value will be negative!
a | the first vector<T> | |
b | the second vector<T> |
Implements lti::similarityFunctor< T >.
virtual functor* lti::cosinus2Similarity< T >::clone | ( | ) | const [virtual] |
returns a pointer to a clone of this functor.
Implements lti::functor.
cosinus2Similarity& lti::cosinus2Similarity< T >::copy | ( | const cosinus2Similarity< T > & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::similarityFunctor< T >.
virtual const char* lti::cosinus2Similarity< T >::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("cosinus2Similarity")
Reimplemented from lti::similarityFunctor< T >.