Public Member Functions | Protected Member Functions

CGeodesicMetric Class Reference


Detailed Description

class GeodesicMetric

The Geodesic distance (Great circle distance) computes the shortest path between two data points on a sphere (the radius is set to one for the evaluation).

\[\displaystyle d(\bf{x},\bf{x'}) = arccos\sum_{i=1}^{n} \frac{\bf{x_{i}}\cdot\bf{x'_{i}}} {\sqrt{x_{i}x_{i} x'_{i}x'_{i}}} \]

See also:
Wikipedia: Geodesic distance

Definition at line 35 of file GeodesicMetric.h.

Inheritance diagram for CGeodesicMetric:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CGeodesicMetric ()
 CGeodesicMetric (CSimpleFeatures< float64_t > *l, CSimpleFeatures< float64_t > *r)
virtual ~CGeodesicMetric ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
virtual EDistanceType get_distance_type ()
virtual const char * get_name () const

Protected Member Functions

virtual float64_t compute (int32_t idx_a, int32_t idx_b)

Constructor & Destructor Documentation

CGeodesicMetric (  ) 

default constructor

Definition at line 20 of file GeodesicMetric.cpp.

constructor

Parameters:
l features of left-hand side
r features of right-hand side

Definition at line 24 of file GeodesicMetric.cpp.

~CGeodesicMetric (  )  [virtual]

Definition at line 30 of file GeodesicMetric.cpp.


Member Function Documentation

void cleanup (  )  [virtual]

cleanup distance

Implements CSimpleDistance< float64_t >.

Definition at line 42 of file GeodesicMetric.cpp.

float64_t compute ( int32_t  idx_a,
int32_t  idx_b 
) [protected, virtual]

compute distance for features a and b idx_{a,b} denote the index of the feature vectors in the corresponding feature object

Implements CDistance.

Definition at line 46 of file GeodesicMetric.cpp.

virtual EDistanceType get_distance_type (  )  [virtual]

get distance type we are

Returns:
distance type GEODESIC

Implements CSimpleDistance< float64_t >.

Definition at line 64 of file GeodesicMetric.h.

virtual const char* get_name ( void   )  const [virtual]

get name of the distance

Returns:
name Chebyshew-Metric

Reimplemented from CSimpleDistance< float64_t >.

Definition at line 70 of file GeodesicMetric.h.

bool init ( CFeatures l,
CFeatures r 
) [virtual]

init distance

Parameters:
l features of left-hand side
r features of right-hand side
Returns:
if init was successful

Reimplemented from CSimpleDistance< float64_t >.

Definition at line 35 of file GeodesicMetric.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation