class EuclidianDistance
The familiar Euclidian distance for real valued features computes the square root of the sum of squared disparity between the corresponding feature dimensions of two data points.
This special case of Minkowski metric is invariant to an arbitrary translation or rotation in feature space.
The Euclidian Squared distance does not take the square root:
Definition at line 43 of file EuclidianDistance.h.
Public Member Functions | |
CEuclidianDistance () | |
CEuclidianDistance (CSimpleFeatures< float64_t > *l, CSimpleFeatures< float64_t > *r) | |
virtual | ~CEuclidianDistance () |
virtual bool | init (CFeatures *l, CFeatures *r) |
virtual void | cleanup () |
virtual EDistanceType | get_distance_type () |
virtual EFeatureType | get_feature_type () |
virtual const char * | get_name () const |
virtual bool | get_disable_sqrt () |
virtual void | set_disable_sqrt (bool state) |
Protected Member Functions | |
virtual float64_t | compute (int32_t idx_a, int32_t idx_b) |
Protected Attributes | |
bool | disable_sqrt |
default constructor
Definition at line 19 of file EuclidianDistance.cpp.
CEuclidianDistance | ( | CSimpleFeatures< float64_t > * | l, | |
CSimpleFeatures< float64_t > * | r | |||
) |
constructor
l | features of left-hand side | |
r | features of right-hand side |
Definition at line 24 of file EuclidianDistance.cpp.
~CEuclidianDistance | ( | ) | [virtual] |
Definition at line 31 of file EuclidianDistance.cpp.
void cleanup | ( | ) | [virtual] |
float64_t compute | ( | int32_t | idx_a, | |
int32_t | idx_b | |||
) | [protected, virtual] |
compute kernel function for features a and b idx_{a,b} denote the index of the feature vectors in the corresponding feature object
Implements CRealDistance.
Definition at line 47 of file EuclidianDistance.cpp.
virtual bool get_disable_sqrt | ( | ) | [virtual] |
disable application of sqrt on matrix computation the matrix can then also be named norm squared
Definition at line 91 of file EuclidianDistance.h.
virtual EDistanceType get_distance_type | ( | ) | [virtual] |
get distance type we are
Implements CRealDistance.
Definition at line 72 of file EuclidianDistance.h.
virtual EFeatureType get_feature_type | ( | ) | [virtual] |
get feature type the distance can deal with
Reimplemented from CRealDistance.
Definition at line 78 of file EuclidianDistance.h.
virtual const char* get_name | ( | ) | const [virtual] |
get name of the distance
Reimplemented from CRealDistance.
Definition at line 84 of file EuclidianDistance.h.
init distance
l | features of left-hand side | |
r | features of right-hand side |
Reimplemented from CRealDistance.
Definition at line 36 of file EuclidianDistance.cpp.
virtual void set_disable_sqrt | ( | bool | state | ) | [virtual] |
disable application of sqrt on matrix computation the matrix can then also be named norm squared
state | new disable_sqrt |
Definition at line 98 of file EuclidianDistance.h.
bool disable_sqrt [protected] |
if application of sqrt on matrix computation is disabled
Definition at line 111 of file EuclidianDistance.h.