A generic DistanceMachine interface.
A distance machine is based on a a-priori choosen distance.
Definition at line 32 of file DistanceMachine.h.
Public Member Functions | |
CDistanceMachine () | |
virtual | ~CDistanceMachine () |
void | set_distance (CDistance *d) |
CDistance * | get_distance () |
void | distances_lhs (float64_t *result, int32_t idx_a1, int32_t idx_a2, int32_t idx_b) |
void | distances_rhs (float64_t *result, int32_t idx_b1, int32_t idx_b2, int32_t idx_a) |
virtual const char * | get_name (void) const |
virtual CLabels * | classify ()=0 |
virtual CLabels * | classify (CFeatures *data)=0 |
Static Protected Member Functions | |
static void * | run_distance_thread_lhs (void *p) |
static void * | run_distance_thread_rhs (void *p) |
Protected Attributes | |
CDistance * | distance |
CDistanceMachine | ( | ) |
default constructor
Definition at line 27 of file DistanceMachine.cpp.
~CDistanceMachine | ( | ) | [virtual] |
Definition at line 32 of file DistanceMachine.cpp.
virtual CLabels* classify | ( | ) | [pure virtual] |
classify objects using the currently set features
Implements CClassifier.
Implemented in CKNN, CHierarchical, and CKMeans.
classify objects
data | (test)data to be classified |
Implements CClassifier.
Implemented in CKNN, CHierarchical, and CKMeans.
void distances_lhs | ( | float64_t * | result, | |
int32_t | idx_a1, | |||
int32_t | idx_a2, | |||
int32_t | idx_b | |||
) |
get distance functions for lhs feature vectors going from a1 to a2 and rhs feature vector b
result | array of distance values | |
idx_a1 | first feature vector a1 at idx_a1 | |
idx_a2 | last feature vector a2 at idx_a2 | |
idx_b | feature vector b at idx_b |
Definition at line 37 of file DistanceMachine.cpp.
void distances_rhs | ( | float64_t * | result, | |
int32_t | idx_b1, | |||
int32_t | idx_b2, | |||
int32_t | idx_a | |||
) |
get distance functions for rhs feature vectors going from b1 to b2 and lhs feature vector a
result | array of distance values | |
idx_b1 | first feature vector a1 at idx_b1 | |
idx_b2 | last feature vector a2 at idx_b2 | |
idx_a | feature vector a at idx_a |
Definition at line 99 of file DistanceMachine.cpp.
CDistance* get_distance | ( | ) |
virtual const char* get_name | ( | void | ) | const [virtual] |
Returns the name of the SGSerializable instance. It MUST BE the CLASS NAME without the prefixed `C'.
Implements CSGObject.
Reimplemented in CKNN, CHierarchical, and CKMeans.
Definition at line 83 of file DistanceMachine.h.
void * run_distance_thread_lhs | ( | void * | p | ) | [static, protected] |
pthread function for compute distance values
p | thread parameter |
Definition at line 161 of file DistanceMachine.cpp.
void * run_distance_thread_rhs | ( | void * | p | ) | [static, protected] |
pthread function for compute distance values
p | thread parameter |
Definition at line 177 of file DistanceMachine.cpp.
void set_distance | ( | CDistance * | d | ) |
the distance
Definition at line 101 of file DistanceMachine.h.