class Distance
All distance classes are derived from this base class.
在文件Distance.h第55行定义。

公有成员 | |
| 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行定义。
init distance
| lhs | features of left-hand side | |
| rhs | features of right-hand side |
在文件Distance.cpp第39行定义。
| ~CDistance | ( | ) | [virtual] |
在文件Distance.cpp第46行定义。
| virtual void cleanup | ( | ) | [pure virtual] |
cleanup distance
abstract base method
在CBrayCurtisDistance、CCanberraMetric、CCanberraWordDistance、CChebyshewMetric、CChiSquareDistance、CCosineDistance、CEuclidianDistance、CGeodesicMetric、CHammingWordDistance、CJensenMetric、CManhattanMetric、CManhattanWordDistance、CMinkowskiMetric、CSparseEuclidianDistance及CTanimotoDistance内被实现。
| 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
在CBrayCurtisDistance、CCanberraMetric、CCanberraWordDistance、CChebyshewMetric、CChiSquareDistance、CCosineDistance、CEuclidianDistance、CGeodesicMetric、CHammingWordDistance、CJensenMetric、CManhattanMetric、CManhattanWordDistance、CMinkowskiMetric、CSparseEuclidianDistance及CTanimotoDistance内被实现。
| 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.h第77行定义。
| void do_precompute_matrix | ( | ) | [protected] |
matrix precomputation
在文件Distance.cpp第132行定义。
| 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.cpp第156行定义。
get distance matrix real
| m | dimension m | |
| n | dimension n | |
| target | target matrix |
在文件Distance.cpp第292行定义。
| 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 |
在文件Distance.cpp第223行定义。
| virtual EDistanceType get_distance_type | ( | ) | [pure virtual] |
get distance type we are
abstrace base method
在CBrayCurtisDistance、CCanberraMetric、CCanberraWordDistance、CChebyshewMetric、CChiSquareDistance、CCosineDistance、CEuclidianDistance、CGeodesicMetric、CHammingWordDistance、CJensenMetric、CManhattanMetric、CManhattanWordDistance、CMinkowskiMetric、CSparseEuclidianDistance及CTanimotoDistance内被实现。
| virtual EFeatureClass get_feature_class | ( | ) | [pure virtual] |
get feature class the distance can deal with
abstract base method
在CSimpleDistance< ST >、CSparseDistance< ST >、CStringDistance< ST >、CSimpleDistance< float64_t >、CSparseDistance< float64_t >及CStringDistance< uint16_t >内被实现。
| virtual EFeatureType get_feature_type | ( | ) | [pure virtual] |
get feature type the distance can deal with
abstrace base method
在CEuclidianDistance、CRealDistance、CSimpleDistance< ST >、CSparseDistance< ST >、CSparseEuclidianDistance、CStringDistance< ST >、CSimpleDistance< float64_t >、CSparseDistance< float64_t >、CStringDistance< uint16_t >、CSimpleDistance< ST >、CSimpleDistance< ST >、CSimpleDistance< ST >、CSimpleDistance< ST >、CSimpleDistance< ST >、CSimpleDistance< ST >、CSimpleDistance< ST >、CSparseDistance< ST >、CSparseDistance< ST >、CSparseDistance< ST >、CSparseDistance< ST >、CSparseDistance< ST >、CSparseDistance< ST >、CSparseDistance< ST >、CStringDistance< ST >、CStringDistance< ST >、CStringDistance< ST >、CStringDistance< ST >、CStringDistance< ST >、CStringDistance< ST >及CStringDistance< ST >内被实现。
| CFeatures* get_lhs | ( | ) |
get left-hand side features used in distance matrix
在文件Distance.h第171行定义。
| int32_t get_num_vec_lhs | ( | ) |
| int32_t get_num_vec_rhs | ( | ) |
| bool get_precompute_matrix | ( | ) |
FIXME: precompute matrix should be dropped, handling should be via customdistance
在文件Distance.h第227行定义。
| CFeatures* get_rhs | ( | ) |
get right-hand side features used in distance matrix
在文件Distance.h第177行定义。
| bool has_features | ( | ) |
test whether features have been assigned to lhs and rhs
在文件Distance.h第273行定义。
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 |
被CBrayCurtisDistance、CCanberraMetric、CCanberraWordDistance、CChebyshewMetric、CChiSquareDistance、CCosineDistance、CEuclidianDistance、CGeodesicMetric、CHammingWordDistance、CJensenMetric、CManhattanMetric、CManhattanWordDistance、CMinkowskiMetric、CRealDistance、CSimpleDistance< ST >、CSparseDistance< ST >、CSparseEuclidianDistance、CStringDistance< ST >、CTanimotoDistance、CSimpleDistance< float64_t >、CSparseDistance< float64_t >及CStringDistance< uint16_t >重载。
在文件Distance.cpp第54行定义。
| bool lhs_equals_rhs | ( | ) |
test whether features on lhs and rhs are the same
在文件Distance.h第282行定义。
| void load | ( | CFile * | loader | ) |
| 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第89行定义。
| 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行定义。
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 |
在文件Distance.cpp第112行定义。
| void save | ( | CFile * | writer | ) |
| virtual void set_precompute_matrix | ( | bool | flag | ) | [virtual] |
FIXME: precompute matrix should be dropped, handling should be via customdistance
| flag | if precompute_matrix |
在文件Distance.h第234行定义。
feature vectors to occur on left hand side
在文件Distance.h第308行定义。
bool precompute_matrix [protected] |
FIXME: precompute matrix should be dropped, handling should be via customdistance
在文件Distance.h第305行定义。
float32_t* precomputed_matrix [protected] |
FIXME: precompute matrix should be dropped, handling should be via customdistance
在文件Distance.h第300行定义。
feature vectors to occur on right hand side
在文件Distance.h第310行定义。