CSparseDistance< ST > Class Template Reference

Inheritance diagram for CSparseDistance< ST >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class ST>
class CSparseDistance< ST >

template class SparseDistance

Definition at line 18 of file SparseDistance.h.


Public Member Functions

 CSparseDistance ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual EFeatureClass get_feature_class ()
virtual EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
template<>
EFeatureType get_feature_type ()
DREAL distance (INT idx_a, INT idx_b)
void get_distance_matrix (DREAL **dst, INT *m, INT *n)
virtual DREALget_distance_matrix_real (int &m, int &n, DREAL *target)
virtual SHORTREALget_distance_matrix_shortreal (int &m, int &n, SHORTREAL *target)
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
CFeaturesget_lhs ()
CFeaturesget_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 const CHARget_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

SHORTREALprecomputed_matrix
bool precompute_matrix
CFeatureslhs
 feature vectors to occur on left hand side
CFeaturesrhs
 feature vectors to occur on right hand side

Constructor & Destructor Documentation

template<class ST>
CSparseDistance< ST >::CSparseDistance (  ) 

default constructor

Definition at line 22 of file SparseDistance.h.


Member Function Documentation

template<class ST>
virtual bool CSparseDistance< ST >::init ( CFeatures l,
CFeatures r 
) [virtual]

init distance

Parameters:
l features of left-hand side
r features of right-hand side
Returns:
if init was successful

Reimplemented from CDistance.

Reimplemented in CSparseEuclidianDistance.

Definition at line 30 of file SparseDistance.h.

template<class ST>
virtual EFeatureClass CSparseDistance< ST >::get_feature_class (  )  [virtual]

get feature class the distance can deal with

Returns:
feature class SPARSE

Implements CDistance.

Definition at line 51 of file SparseDistance.h.

template<class ST>
virtual EFeatureType CSparseDistance< ST >::get_feature_type (  )  [virtual]

get feature type the distance can deal with

Returns:
template-specific feature type

Implements CDistance.

Reimplemented in CSparseEuclidianDistance.

template<>
EFeatureType CSparseDistance< DREAL >::get_feature_type (  )  [virtual]

get feature type the DREAL distance can deal with

Returns:
feature type DREAL

Implements CDistance.

Reimplemented in CSparseEuclidianDistance.

Definition at line 64 of file SparseDistance.h.

template<>
EFeatureType CSparseDistance< ULONG >::get_feature_type (  )  [virtual]

get feature type the ULONG distance can deal with

Returns:
feature type ULONG

Implements CDistance.

Reimplemented in CSparseEuclidianDistance.

Definition at line 70 of file SparseDistance.h.

template<>
EFeatureType CSparseDistance< INT >::get_feature_type (  )  [virtual]

get feature type the INT distance can deal with

Returns:
feature type INT

Implements CDistance.

Reimplemented in CSparseEuclidianDistance.

Definition at line 76 of file SparseDistance.h.

template<>
EFeatureType CSparseDistance< WORD >::get_feature_type (  )  [virtual]

get feature type the WORD distance can deal with

Returns:
feature type WORD

Implements CDistance.

Reimplemented in CSparseEuclidianDistance.

Definition at line 82 of file SparseDistance.h.

template<>
EFeatureType CSparseDistance< SHORT >::get_feature_type (  )  [virtual]

get feature type the SHORT distance can deal with

Returns:
feature type SHORT

Implements CDistance.

Reimplemented in CSparseEuclidianDistance.

Definition at line 88 of file SparseDistance.h.

template<>
EFeatureType CSparseDistance< BYTE >::get_feature_type (  )  [virtual]

get feature type the BYTE distance can deal with

Returns:
feature type BYTE

Implements CDistance.

Reimplemented in CSparseEuclidianDistance.

Definition at line 94 of file SparseDistance.h.

template<>
EFeatureType CSparseDistance< CHAR >::get_feature_type (  )  [virtual]

get feature type the CHAR distance can deal with

Returns:
feature type CHAR

Implements CDistance.

Reimplemented in CSparseEuclidianDistance.

Definition at line 100 of file SparseDistance.h.

DREAL CDistance::distance ( INT  idx_a,
INT  idx_b 
) [inherited]

get distance function for lhs feature vector a and rhs feature vector b

Parameters:
idx_a feature vector a at idx_a
idx_b feature vector b at idx_b
Returns:
distance value

Definition at line 45 of file Distance.h.

void CDistance::get_distance_matrix ( DREAL **  dst,
INT m,
INT n 
) [inherited]

get distance matrix

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

DREAL * CDistance::get_distance_matrix_real ( int &  m,
int &  n,
DREAL target 
) [virtual, inherited]

get distance matrix real

Parameters:
m dimension m
n dimension n
target target matrix
Returns:
target matrix

Definition at line 278 of file Distance.cpp.

SHORTREAL * CDistance::get_distance_matrix_shortreal ( int &  m,
int &  n,
SHORTREAL target 
) [virtual, inherited]

get distance matrix short real

Parameters:
m dimension m
n dimension n
target target matrix
Returns:
target matrix

Definition at line 210 of file Distance.cpp.

virtual void CDistance::cleanup (  )  [pure virtual, inherited]

bool CDistance::load ( CHAR fname  )  [inherited]

load distance matrix from file

Parameters:
fname filename to load from
Returns:
if loading was successful

Definition at line 69 of file Distance.cpp.

bool CDistance::save ( CHAR fname  )  [inherited]

save distance matrix to file

Parameters:
fname filename to save to
Returns:
if saving was successful

Definition at line 74 of file Distance.cpp.

virtual bool CDistance::load_init ( FILE *  src  )  [pure virtual, inherited]

load init data from file

abstract base method

Parameters:
src file to load from
Returns:
if loading was successful

Implemented in CCanberraMetric, CCanberraWordDistance, CChebyshewMetric, CEuclidianDistance, CGeodesicMetric, CHammingWordDistance, CJensenMetric, CManhattanMetric, CManhattanWordDistance, CMinkowskiMetric, and CSparseEuclidianDistance.

virtual bool CDistance::save_init ( FILE *  dest  )  [pure virtual, inherited]

save init data to file

abstrace base method

Parameters:
dest file to save to
Returns:
if saving was successful

Implemented in CCanberraMetric, CCanberraWordDistance, CChebyshewMetric, CEuclidianDistance, CGeodesicMetric, CHammingWordDistance, CJensenMetric, CManhattanMetric, CManhattanWordDistance, CMinkowskiMetric, and CSparseEuclidianDistance.

CFeatures* CDistance::get_lhs (  )  [inherited]

get left-hand side features used in distance matrix

Returns:
left-hand side features

Definition at line 157 of file Distance.h.

CFeatures* CDistance::get_rhs (  )  [inherited]

get right-hand side features used in distance matrix

Returns:
right-hand side features

Definition at line 163 of file Distance.h.

void CDistance::remove_lhs (  )  [virtual, inherited]

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, inherited]

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, inherited]

virtual const CHAR* CDistance::get_name (  )  [pure virtual, inherited]

bool CDistance::get_precompute_matrix (  )  [inherited]

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

Returns:
if precompute_matrix

Definition at line 209 of file Distance.h.

virtual void CDistance::set_precompute_matrix ( bool  flag  )  [virtual, inherited]

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

Parameters:
flag if precompute_matrix

Definition at line 216 of file Distance.h.

virtual DREAL CDistance::compute ( INT  x,
INT  y 
) [protected, pure virtual, inherited]

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, inherited]

matrix precomputation

Definition at line 119 of file Distance.cpp.


Member Data Documentation

SHORTREAL* CDistance::precomputed_matrix [protected, inherited]

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

Definition at line 240 of file Distance.h.

bool CDistance::precompute_matrix [protected, inherited]

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

Definition at line 245 of file Distance.h.

CFeatures* CDistance::lhs [protected, inherited]

feature vectors to occur on left hand side

Definition at line 248 of file Distance.h.

CFeatures* CDistance::rhs [protected, inherited]

feature vectors to occur on right hand side

Definition at line 250 of file Distance.h.

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.


The documentation for this class was generated from the following file:

SHOGUN Machine Learning Toolbox - Documentation