Public Member Functions | Static Protected Member Functions | Protected Attributes

CDistanceMachine Class Reference


Detailed Description

A generic DistanceMachine interface.

A distance machine is based on a a-priori choosen distance.

Definition at line 32 of file DistanceMachine.h.

Inheritance diagram for CDistanceMachine:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CDistanceMachine ()
virtual ~CDistanceMachine ()
void set_distance (CDistance *d)
CDistanceget_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 CLabelsclassify ()=0
virtual CLabelsclassify (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

CDistancedistance

Constructor & Destructor Documentation

default constructor

Definition at line 27 of file DistanceMachine.cpp.

~CDistanceMachine (  )  [virtual]

Definition at line 32 of file DistanceMachine.cpp.


Member Function Documentation

virtual CLabels* classify (  )  [pure virtual]

classify objects using the currently set features

Returns:
classified labels

Implements CClassifier.

Implemented in CKNN, CHierarchical, and CKMeans.

virtual CLabels* classify ( CFeatures data  )  [pure virtual]

classify objects

Parameters:
data (test)data to be classified
Returns:
classified labels

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

Parameters:
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

Parameters:
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 (  ) 

get distance

Returns:
distance

Definition at line 54 of file DistanceMachine.h.

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'.

Returns:
name of the SGSerializable

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

Parameters:
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

Parameters:
p thread parameter

Definition at line 177 of file DistanceMachine.cpp.

void set_distance ( CDistance d  ) 

set distance

Parameters:
d distance to set

Definition at line 43 of file DistanceMachine.h.


Member Data Documentation

CDistance* distance [protected]

the distance

Definition at line 101 of file DistanceMachine.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation