Definition at line 23 of file Distance.h.
Public Member Functions | |
CDistance () | |
CDistance (CFeatures *lhs, CFeatures *rhs) | |
virtual | ~CDistance () |
DREAL | distance (INT idx_a, INT idx_b) |
void | get_distance_matrix (DREAL **dst, INT *m, INT *n) |
virtual DREAL * | get_distance_matrix_real (int &m, int &n, DREAL *target) |
virtual SHORTREAL * | get_distance_matrix_shortreal (int &m, int &n, SHORTREAL *target) |
virtual bool | init (CFeatures *lhs, CFeatures *rhs) |
virtual void | cleanup ()=0 |
bool | load (CHAR *fname) |
bool | save (CHAR *fname) |
virtual bool | load_init (FILE *src)=0 |
virtual bool | save_init (FILE *dest)=0 |
CFeatures * | get_lhs () |
CFeatures * | get_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 |
virtual const CHAR * | get_name ()=0 |
bool | get_precompute_matrix () |
virtual void | set_precompute_matrix (bool flag) |
Static Public Attributes | |
static CParallel | parallel |
static CIO | io |
static CVersion | version |
Protected Member Functions | |
virtual DREAL | compute (INT x, INT y)=0 |
void | do_precompute_matrix () |
matrix precomputation | |
Protected Attributes | |
SHORTREAL * | 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::CDistance | ( | ) |
default constructor
Definition at line 30 of file Distance.cpp.
init distance
lhs | features of left-hand side | |
rhs | features of right-hand side |
Definition at line 37 of file Distance.cpp.
CDistance::~CDistance | ( | ) | [virtual] |
Definition at line 44 of file Distance.cpp.
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 |
Definition at line 45 of file Distance.h.
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 |
Definition at line 143 of file Distance.cpp.
get distance matrix real
m | dimension m | |
n | dimension n | |
target | target matrix |
Definition at line 278 of file Distance.cpp.
SHORTREAL * CDistance::get_distance_matrix_shortreal | ( | int & | m, | |
int & | n, | |||
SHORTREAL * | target | |||
) | [virtual] |
get distance matrix short real
m | dimension m | |
n | dimension n | |
target | target matrix |
Definition at line 210 of file Distance.cpp.
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 |
Reimplemented in CCanberraMetric, CCanberraWordDistance, CChebyshewMetric, CEuclidianDistance, CGeodesicMetric, CHammingWordDistance, CJensenMetric, CManhattanMetric, CManhattanWordDistance, CMinkowskiMetric, CRealDistance, CSimpleDistance< ST >, CSparseDistance< ST >, CSparseEuclidianDistance, CStringDistance< ST >, CSimpleDistance< double >, CSparseDistance< double >, and CStringDistance< unsigned short int >.
Definition at line 50 of file Distance.cpp.
virtual void CDistance::cleanup | ( | ) | [pure virtual] |
cleanup distance
abstract base method
Implemented in CCanberraMetric, CCanberraWordDistance, CChebyshewMetric, CEuclidianDistance, CGeodesicMetric, CHammingWordDistance, CJensenMetric, CManhattanMetric, CManhattanWordDistance, CMinkowskiMetric, and CSparseEuclidianDistance.
bool CDistance::load | ( | CHAR * | fname | ) |
load distance matrix from file
fname | filename to load from |
Definition at line 69 of file Distance.cpp.
bool CDistance::save | ( | CHAR * | fname | ) |
save distance matrix to file
fname | filename to save to |
Definition at line 74 of file Distance.cpp.
virtual bool CDistance::load_init | ( | FILE * | src | ) | [pure virtual] |
load init data from file
abstract base method
src | file to load from |
Implemented in CCanberraMetric, CCanberraWordDistance, CChebyshewMetric, CEuclidianDistance, CGeodesicMetric, CHammingWordDistance, CJensenMetric, CManhattanMetric, CManhattanWordDistance, CMinkowskiMetric, and CSparseEuclidianDistance.
virtual bool CDistance::save_init | ( | FILE * | dest | ) | [pure virtual] |
save init data to file
abstrace base method
dest | file to save to |
Implemented in CCanberraMetric, CCanberraWordDistance, CChebyshewMetric, CEuclidianDistance, CGeodesicMetric, CHammingWordDistance, CJensenMetric, CManhattanMetric, CManhattanWordDistance, CMinkowskiMetric, and CSparseEuclidianDistance.
CFeatures* CDistance::get_lhs | ( | ) |
get left-hand side features used in distance matrix
Definition at line 157 of file Distance.h.
CFeatures* CDistance::get_rhs | ( | ) |
get right-hand side features used in distance matrix
Definition at line 163 of file Distance.h.
void CDistance::remove_lhs | ( | ) | [virtual] |
takes all necessary steps if the lhs is removed from distance matrix
Definition at line 105 of file Distance.cpp.
void CDistance::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
Definition at line 112 of file Distance.cpp.
virtual EDistanceType CDistance::get_distance_type | ( | ) | [pure virtual] |
get distance type we are
abstrace base method
Implemented in CCanberraMetric, CCanberraWordDistance, CChebyshewMetric, CEuclidianDistance, CGeodesicMetric, CHammingWordDistance, CJensenMetric, CManhattanMetric, CManhattanWordDistance, CMinkowskiMetric, and CSparseEuclidianDistance.
virtual EFeatureType CDistance::get_feature_type | ( | ) | [pure virtual] |
get feature type the distance can deal with
abstrace base method
Implemented in CEuclidianDistance, CRealDistance, CSimpleDistance< ST >, CSparseDistance< ST >, CSparseEuclidianDistance, CStringDistance< ST >, CSimpleDistance< double >, CSparseDistance< double >, CStringDistance< unsigned short int >, 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 >, and CStringDistance< ST >.
virtual EFeatureClass CDistance::get_feature_class | ( | ) | [pure virtual] |
get feature class the distance can deal with
abstract base method
Implemented in CSimpleDistance< ST >, CSparseDistance< ST >, CStringDistance< ST >, CSimpleDistance< double >, CSparseDistance< double >, and CStringDistance< unsigned short int >.
virtual const CHAR* CDistance::get_name | ( | ) | [pure virtual] |
get name of the distance
abstrace base method
Implemented in CCanberraMetric, CCanberraWordDistance, CChebyshewMetric, CEuclidianDistance, CGeodesicMetric, CHammingWordDistance, CJensenMetric, CManhattanMetric, CManhattanWordDistance, CMinkowskiMetric, and CSparseEuclidianDistance.
bool CDistance::get_precompute_matrix | ( | ) |
FIXME: precompute matrix should be dropped, handling should be via customdistance
Definition at line 209 of file Distance.h.
virtual void CDistance::set_precompute_matrix | ( | bool | flag | ) | [virtual] |
FIXME: precompute matrix should be dropped, handling should be via customdistance
flag | if precompute_matrix |
Definition at line 216 of file Distance.h.
compute distance function for features a and b idx_{a,b} denote the index of the feature vectors in the corresponding feature object
Implemented in CCanberraMetric, CCanberraWordDistance, CChebyshewMetric, CEuclidianDistance, CGeodesicMetric, CHammingWordDistance, CJensenMetric, CManhattanMetric, CManhattanWordDistance, CMinkowskiMetric, and CSparseEuclidianDistance.
void CDistance::do_precompute_matrix | ( | ) | [protected] |
SHORTREAL* CDistance::precomputed_matrix [protected] |
FIXME: precompute matrix should be dropped, handling should be via customdistance
Definition at line 240 of file Distance.h.
bool CDistance::precompute_matrix [protected] |
FIXME: precompute matrix should be dropped, handling should be via customdistance
Definition at line 245 of file Distance.h.
CFeatures* CDistance::lhs [protected] |
CFeatures* CDistance::rhs [protected] |
CParallel CSGObject::parallel [static, inherited] |
Definition at line 105 of file SGObject.h.
CIO CSGObject::io [static, inherited] |
Definition at line 106 of file SGObject.h.
CVersion CSGObject::version [static, inherited] |
Definition at line 107 of file SGObject.h.