公有成员 | 保护成员 | 保护属性

CDistance类参考


详细描述

class Distance

All distance classes are derived from this base class.

在文件Distance.h55行定义。

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

所有成员的列表。

公有成员

 CDistance ()
 CDistance (CFeatures *lhs, CFeatures *rhs)
virtual ~CDistance ()
float64_t distance (int32_t idx_a, int32_t idx_b)
void get_distance_matrix (float64_t **dst, int32_t *m, int32_t *n)
virtual float64_tget_distance_matrix_real (int32_t &m, int32_t &n, float64_t *target)
virtual float32_tget_distance_matrix_shortreal (int32_t &m, int32_t &n, float32_t *target)
virtual bool init (CFeatures *lhs, CFeatures *rhs)
virtual void cleanup ()=0
void load (CFile *loader)
void save (CFile *writer)
CFeaturesget_lhs ()
CFeaturesget_rhs ()
CFeaturesreplace_rhs (CFeatures *rhs)
virtual void remove_lhs_and_rhs ()
virtual void remove_lhs ()
 takes all necessary steps if the lhs is removed from distance matrix
virtual void remove_rhs ()
 takes all necessary steps if the rhs is removed from distance matrix
virtual EDistanceType get_distance_type ()=0
virtual EFeatureType get_feature_type ()=0
virtual EFeatureClass get_feature_class ()=0
bool get_precompute_matrix ()
virtual void set_precompute_matrix (bool flag)
int32_t get_num_vec_lhs ()
int32_t get_num_vec_rhs ()
bool has_features ()
bool lhs_equals_rhs ()

保护成员

virtual float64_t compute (int32_t x, int32_t y)=0
void do_precompute_matrix ()
 matrix precomputation

保护属性

float32_tprecomputed_matrix
bool precompute_matrix
CFeatureslhs
 feature vectors to occur on left hand side
CFeaturesrhs
 feature vectors to occur on right hand side

构造及析构函数文档

CDistance (  ) 

default constructor

在文件Distance.cpp32行定义。

CDistance ( CFeatures lhs,
CFeatures rhs 
)

init distance

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

在文件Distance.cpp39行定义。

~CDistance (  )  [virtual]

在文件Distance.cpp46行定义。


成员函数文档

virtual void cleanup (  )  [pure virtual]
virtual float64_t compute ( int32_t  x,
int32_t  y 
) [protected, pure virtual]

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

CBrayCurtisDistanceCCanberraMetricCCanberraWordDistanceCChebyshewMetricCChiSquareDistanceCCosineDistanceCEuclidianDistanceCGeodesicMetricCHammingWordDistanceCJensenMetricCManhattanMetricCManhattanWordDistanceCMinkowskiMetricCSparseEuclidianDistanceCTanimotoDistance内被实现。

float64_t distance ( int32_t  idx_a,
int32_t  idx_b 
)

get distance function for lhs feature vector a and rhs feature vector b

参数:
idx_a feature vector a at idx_a
idx_b feature vector b at idx_b
返回:
distance value

在文件Distance.h77行定义。

void do_precompute_matrix (  )  [protected]

matrix precomputation

在文件Distance.cpp132行定义。

void get_distance_matrix ( float64_t **  dst,
int32_t *  m,
int32_t *  n 
)

get distance matrix

参数:
dst distance matrix is stored in here
m dimension m of matrix is stored in here
n dimension n of matrix is stored in here

在文件Distance.cpp156行定义。

float64_t * get_distance_matrix_real ( int32_t &  m,
int32_t &  n,
float64_t target 
) [virtual]

get distance matrix real

参数:
m dimension m
n dimension n
target target matrix
返回:
target matrix

在文件Distance.cpp292行定义。

float32_t * get_distance_matrix_shortreal ( int32_t &  m,
int32_t &  n,
float32_t target 
) [virtual]

get distance matrix short real

参数:
m dimension m
n dimension n
target target matrix
返回:
target matrix

在文件Distance.cpp223行定义。

virtual EDistanceType get_distance_type (  )  [pure virtual]
virtual EFeatureClass get_feature_class (  )  [pure virtual]

get feature class the distance can deal with

abstract base method

返回:
feature class

CSimpleDistance< ST >CSparseDistance< ST >CStringDistance< ST >CSimpleDistance< float64_t >CSparseDistance< float64_t >CStringDistance< uint16_t >内被实现。

virtual EFeatureType get_feature_type (  )  [pure virtual]
CFeatures* get_lhs (  ) 

get left-hand side features used in distance matrix

返回:
left-hand side features

在文件Distance.h171行定义。

int32_t get_num_vec_lhs (  ) 

get number of vectors of lhs features

返回:
number of vectors of left-hand side

在文件Distance.h249行定义。

int32_t get_num_vec_rhs (  ) 

get number of vectors of rhs features

返回:
number of vectors of right-hand side

在文件Distance.h261行定义。

bool get_precompute_matrix (  ) 

FIXME: precompute matrix should be dropped, handling should be via customdistance

返回:
if precompute_matrix

在文件Distance.h227行定义。

CFeatures* get_rhs (  ) 

get right-hand side features used in distance matrix

返回:
right-hand side features

在文件Distance.h177行定义。

bool has_features (  ) 

test whether features have been assigned to lhs and rhs

返回:
true if features are assigned

在文件Distance.h273行定义。

bool init ( CFeatures lhs,
CFeatures rhs 
) [virtual]

init distance

make sure to check that your distance can deal with the supplied features (!)

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

CBrayCurtisDistanceCCanberraMetricCCanberraWordDistanceCChebyshewMetricCChiSquareDistanceCCosineDistanceCEuclidianDistanceCGeodesicMetricCHammingWordDistanceCJensenMetricCManhattanMetricCManhattanWordDistanceCMinkowskiMetricCRealDistanceCSimpleDistance< ST >CSparseDistance< ST >CSparseEuclidianDistanceCStringDistance< ST >CTanimotoDistanceCSimpleDistance< float64_t >CSparseDistance< float64_t >CStringDistance< uint16_t >重载。

在文件Distance.cpp54行定义。

bool lhs_equals_rhs (  ) 

test whether features on lhs and rhs are the same

返回:
true if features are the same

在文件Distance.h282行定义。

void load ( CFile loader  ) 

load the kernel matrix

参数:
loader File object via which to load data

在文件Distance.cpp81行定义。

void remove_lhs (  )  [virtual]

takes all necessary steps if the lhs is removed from distance matrix

在文件Distance.cpp99行定义。

void remove_lhs_and_rhs (  )  [virtual]

remove lhs and rhs from distance

在文件Distance.cpp89行定义。

void remove_rhs (  )  [virtual]

takes all necessary steps if the rhs is removed from distance matrix

takes all necessary steps if the rhs is removed from kernel

在文件Distance.cpp106行定义。

CFeatures * replace_rhs ( CFeatures rhs  ) 

replace right-hand side features used in distance matrix

make sure to check that your distance can deal with the supplied features (!)

参数:
rhs features of right-hand side
返回:
replaced right-hand side features

在文件Distance.cpp112行定义。

void save ( CFile writer  ) 

save kernel matrix

参数:
writer File object via which to save data

在文件Distance.cpp85行定义。

virtual void set_precompute_matrix ( bool  flag  )  [virtual]

FIXME: precompute matrix should be dropped, handling should be via customdistance

参数:
flag if precompute_matrix

在文件Distance.h234行定义。


成员数据文档

CFeatures* lhs [protected]

feature vectors to occur on left hand side

在文件Distance.h308行定义。

bool precompute_matrix [protected]

FIXME: precompute matrix should be dropped, handling should be via customdistance

在文件Distance.h305行定义。

FIXME: precompute matrix should be dropped, handling should be via customdistance

在文件Distance.h300行定义。

CFeatures* rhs [protected]

feature vectors to occur on right hand side

在文件Distance.h310行定义。


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

SHOGUN Machine Learning Toolbox - Documentation