公有成员 | 保护成员

CManhattanMetric类参考


详细描述

class ManhattanMetric

The Manhattan distance (city block distance, $L_{1}$ norm, rectilinear distance or taxi cab metric ) is a special case of general Minkowski metric and computes the absolute differences between the feature dimensions of two data points.

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

参见:
CMinkowskiMetric
Wikipedia: Manhattan distance

在文件ManhattanMetric.h36行定义。

继承图,类CManhattanMetric
Inheritance graph
[图例]

所有成员的列表。

公有成员

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

保护成员

virtual float64_t compute (int32_t idx_a, int32_t idx_b)

构造及析构函数文档

default constructor

在文件ManhattanMetric.cpp20行定义。

constructor

参数:
l features of left-hand side
r features of right-hand side

在文件ManhattanMetric.cpp25行定义。

~CManhattanMetric (  )  [virtual]

在文件ManhattanMetric.cpp31行定义。


成员函数文档

void cleanup (  )  [virtual]

cleanup distance

实现了CDistance

在文件ManhattanMetric.cpp43行定义。

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

实现了CDistance

在文件ManhattanMetric.cpp47行定义。

virtual EDistanceType get_distance_type (  )  [virtual]

get distance type we are

返回:
distance type MANHATTAN

实现了CDistance

在文件ManhattanMetric.h65行定义。

virtual const char* get_name (  )  const [virtual]

get name of the distance

返回:
name Manhattan-Metric

实现了CSGObject

在文件ManhattanMetric.h71行定义。

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

init distance

参数:
l features of left-hand side
r features of right-hand side
返回:
if init was successful

重载CSimpleDistance< float64_t >

在文件ManhattanMetric.cpp36行定义。


该类的文档由以下文件生成:

SHOGUN Machine Learning Toolbox - Documentation