CChebyshewMetric Class Reference

Inheritance diagram for CChebyshewMetric:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 CChebyshewMetric ()
 CChebyshewMetric (CRealFeatures *l, CRealFeatures *r)
virtual ~CChebyshewMetric ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
virtual bool load_init (FILE *src)
virtual bool save_init (FILE *dest)
virtual EDistanceType get_distance_type ()
virtual const char * get_name ()

Protected Member Functions

virtual float64_t compute (int32_t idx_a, int32_t idx_b)


Detailed Description

class ChebyshewMetric

The Chebyshev distance ($L_{\infty}$ norm) returns the maximum of absolute feature dimension differences between two data points.

\[\displaystyle d(\bf{x},\bf{x'}) = max|\bf{x_{i}}-\bf{x'_{i}}| \quad x,x' \in R^{n} \]

See also:
Wikipedia: Chebyshev distance

Definition at line 29 of file ChebyshewMetric.h.


Constructor & Destructor Documentation

CChebyshewMetric::CChebyshewMetric (  ) 

default constructor

Definition at line 18 of file ChebyshewMetric.cpp.

CChebyshewMetric::CChebyshewMetric ( CRealFeatures l,
CRealFeatures r 
)

constructor

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

Definition at line 23 of file ChebyshewMetric.cpp.

CChebyshewMetric::~CChebyshewMetric (  )  [virtual]

Definition at line 29 of file ChebyshewMetric.cpp.


Member Function Documentation

void CChebyshewMetric::cleanup (  )  [virtual]

cleanup distance

Implements CDistance.

Definition at line 41 of file ChebyshewMetric.cpp.

float64_t CChebyshewMetric::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 55 of file ChebyshewMetric.cpp.

virtual EDistanceType CChebyshewMetric::get_distance_type (  )  [virtual]

get distance type we are

Returns:
distance type CHEBYSHEW

Implements CDistance.

Definition at line 72 of file ChebyshewMetric.h.

virtual const char* CChebyshewMetric::get_name (  )  [virtual]

get name of the distance

Returns:
name Chebyshew-Metric

Implements CDistance.

Definition at line 78 of file ChebyshewMetric.h.

bool CChebyshewMetric::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 34 of file ChebyshewMetric.cpp.

bool CChebyshewMetric::load_init ( FILE *  src  )  [virtual]

load init data from file

Parameters:
src file to load from
Returns:
if loading was successful

Implements CDistance.

Definition at line 45 of file ChebyshewMetric.cpp.

bool CChebyshewMetric::save_init ( FILE *  dest  )  [virtual]

save init data to file

Parameters:
dest file to save to
Returns:
if saving was successful

Implements CDistance.

Definition at line 50 of file ChebyshewMetric.cpp.


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

SHOGUN Machine Learning Toolbox - Documentation