SHOGUN v0.9.0
公有成员 | 保护成员 | 保护属性
CDistance类参考

详细描述

class Distance

All distance classes are derived from this base class.

在文件Distance.h第56行定义。

继承图,类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_t * get_distance_matrix_real (int32_t &m, int32_t &n, float64_t *target)
virtual float32_t * get_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)
CFeatures * get_lhs ()
CFeatures * get_rhs ()
CFeatures * replace_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_t * precomputed_matrix
bool precompute_matrix
CFeatures * lhs
 feature vectors to occur on left hand side
CFeatures * rhs
 feature vectors to occur on right hand side

构造及析构函数文档

CDistance ( )

default constructor

在文件Distance.cpp第32行定义。

CDistance ( CFeatures *  lhs,
CFeatures *  rhs 
)

init distance

参数:
lhsfeatures of left-hand side
rhsfeatures of right-hand side
返回:
if init was successful

在文件Distance.cpp第38行定义。

~CDistance ( ) [virtual]

在文件Distance.cpp第44行定义。


成员函数文档

virtual void cleanup ( ) [pure virtual]
virtual float64_t compute ( int32_t  x,
int32_t  y 
) [protected, pure virtual]
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_afeature vector a at idx_a
idx_bfeature vector b at idx_b
返回:
distance value

在文件Distance.h第78行定义。

void do_precompute_matrix ( ) [protected]

matrix precomputation

在文件Distance.cpp第133行定义。

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

get distance matrix

参数:
dstdistance matrix is stored in here
mdimension m of matrix is stored in here
ndimension n of matrix is stored in here

在文件Distance.cpp第157行定义。

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

get distance matrix real

参数:
mdimension m
ndimension n
targettarget matrix
返回:
target matrix

在文件Distance.cpp第293行定义。

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

get distance matrix short real

参数:
mdimension m
ndimension n
targettarget matrix
返回:
target matrix

在文件Distance.cpp第224行定义。

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

在CCustomDistance、CKernelDistance、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.h第172行定义。

int32_t get_num_vec_lhs ( )

get number of vectors of lhs features

返回:
number of vectors of left-hand side

被CCustomDistance重载。

在文件Distance.h第250行定义。

int32_t get_num_vec_rhs ( )

get number of vectors of rhs features

返回:
number of vectors of right-hand side

被CCustomDistance重载。

在文件Distance.h第262行定义。

bool get_precompute_matrix ( )

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

返回:
if precompute_matrix

在文件Distance.h第228行定义。

CFeatures* get_rhs ( )

get right-hand side features used in distance matrix

返回:
right-hand side features

在文件Distance.h第178行定义。

bool has_features ( )

test whether features have been assigned to lhs and rhs

返回:
true if features are assigned

被CCustomDistance重载。

在文件Distance.h第274行定义。

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

test whether features on lhs and rhs are the same

返回:
true if features are the same

在文件Distance.h第283行定义。

void load ( CFile *  loader)

load the kernel matrix

参数:
loaderFile object via which to load data

在文件Distance.cpp第78行定义。

void remove_lhs ( ) [virtual]

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

在文件Distance.cpp第99行定义。

void remove_lhs_and_rhs ( ) [virtual]

remove lhs and rhs from distance

在文件Distance.cpp第90行定义。

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.cpp第106行定义。

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 (!)

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

在文件Distance.cpp第112行定义。

void save ( CFile *  writer)

save kernel matrix

参数:
writerFile object via which to save data

在文件Distance.cpp第84行定义。

virtual void set_precompute_matrix ( bool  flag) [virtual]

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

参数:
flagif precompute_matrix

在文件Distance.h第235行定义。


成员数据文档

CFeatures* lhs [protected]

feature vectors to occur on left hand side

在文件Distance.h第312行定义。

bool precompute_matrix [protected]

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

在文件Distance.h第309行定义。

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

在文件Distance.h第304行定义。

CFeatures* rhs [protected]

feature vectors to occur on right hand side

在文件Distance.h第314行定义。


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

SHOGUN Machine Learning Toolbox - Documentation