CByteFeatures Class Reference

Inheritance diagram for CByteFeatures:

Inheritance graph
[legend]

List of all members.


Detailed Description

class ByteFeatures

Definition at line 20 of file ByteFeatures.h.


Public Member Functions

 CByteFeatures (E_ALPHABET alpha, INT size=0)
 CByteFeatures (CAlphabet *alpha, INT size=0)
 CByteFeatures (const CByteFeatures &orig)
 CByteFeatures (E_ALPHABET alphabet, BYTE *feature_matrix, INT num_feat, INT num_vec)
 CByteFeatures (E_ALPHABET alphabet, CHAR *fname)
 ~CByteFeatures ()
CAlphabetget_alphabet ()
virtual void copy_feature_matrix (BYTE *src, INT num_feat, INT num_vec)
virtual EFeatureType get_feature_type ()
virtual bool load (CHAR *fname)
virtual bool save (CHAR *fname)
virtual CFeaturesduplicate () const
void free_feature_matrix ()
void free_features ()
ST * get_feature_vector (INT num, INT &len, bool &dofree)
void free_feature_vector (ST *feat_vec, INT num, bool dofree)
void get_fm (ST **dst, INT *d1, INT *d2)
ST * get_feature_matrix (INT &num_feat, INT &num_vec)
virtual void set_feature_matrix (ST *fm, INT num_feat, INT num_vec)
virtual void copy_feature_matrix (ST *src, INT num_feat, INT num_vec)
virtual bool apply_preproc (bool force_preprocessing=false)
virtual INT get_size ()
virtual INT get_num_vectors ()
INT get_num_features ()
void set_num_features (INT num)
void set_num_vectors (INT num)
virtual EFeatureClass get_feature_class ()
virtual bool reshape (INT p_num_features, INT p_num_vectors)
virtual INT add_preproc (CPreProc *p)
 set preprocessor
virtual CPreProcdel_preproc (INT num)
 del current preprocessor
CPreProcget_preproc (INT num)
 get current preprocessor
void set_preprocessed (INT num)
bool is_preprocessed (INT num)
INT get_num_preprocessed ()
 get whether specified preprocessor (or all if num=1) was/were already applied
INT get_num_preproc ()
void clean_preprocs ()
 clears all preprocs
INT get_cache_size ()
void list_feature_obj ()
bool check_feature_compatibility (CFeatures *f)

Static Public Attributes

static CParallel parallel
static CIO io
static CVersion version

Protected Member Functions

virtual ST * compute_feature_vector (INT num, INT &len, ST *target=NULL)

Protected Attributes

CAlphabetalphabet
INT num_vectors
 number of vectors in cache
INT num_features
 number of features in cache
ST * feature_matrix
CCache< ST > * feature_cache

Constructor & Destructor Documentation

CByteFeatures::CByteFeatures ( E_ALPHABET  alpha,
INT  size = 0 
)

constructor

Parameters:
alpha alphabet (type) to use
size cache size

Definition at line 15 of file ByteFeatures.cpp.

CByteFeatures::CByteFeatures ( CAlphabet alpha,
INT  size = 0 
)

constructor

Parameters:
alpha alphabet to use
size cache size

Definition at line 21 of file ByteFeatures.cpp.

CByteFeatures::CByteFeatures ( const CByteFeatures orig  ) 

copy constructor

Definition at line 27 of file ByteFeatures.cpp.

CByteFeatures::CByteFeatures ( E_ALPHABET  alphabet,
BYTE feature_matrix,
INT  num_feat,
INT  num_vec 
)

constructor

Parameters:
alphabet alphabet to use
feature_matrix feature matrix to use
num_feat number of features in matrix
num_vec number of vectors in matrix

Definition at line 33 of file ByteFeatures.cpp.

CByteFeatures::CByteFeatures ( E_ALPHABET  alphabet,
CHAR fname 
)

constructor

Parameters:
alphabet alphabet (type) to use
fname filename to load features from

Definition at line 39 of file ByteFeatures.cpp.

CByteFeatures::~CByteFeatures (  ) 

Definition at line 46 of file ByteFeatures.cpp.


Member Function Documentation

CAlphabet* CByteFeatures::get_alphabet (  ) 

get alphabet

Returns:
alphabet

Definition at line 62 of file ByteFeatures.h.

virtual void CByteFeatures::copy_feature_matrix ( BYTE src,
INT  num_feat,
INT  num_vec 
) [virtual]

copy feature matrix

wrapper to base class' method

Parameters:
src feature matrix to copy
num_feat number of features
num_vec number of vectors

Definition at line 75 of file ByteFeatures.h.

virtual EFeatureType CByteFeatures::get_feature_type (  )  [virtual]

get feature type

Returns:
feature type BYTE

Reimplemented from CSimpleFeatures< ST >.

Definition at line 84 of file ByteFeatures.h.

bool CByteFeatures::load ( CHAR fname  )  [virtual]

load features from file

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

Reimplemented from CFeatures.

Definition at line 52 of file ByteFeatures.cpp.

bool CByteFeatures::save ( CHAR fname  )  [virtual]

save features to file

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

Reimplemented from CFeatures.

Definition at line 103 of file ByteFeatures.cpp.

template<class ST>
virtual CFeatures* CSimpleFeatures< ST >::duplicate (  )  const [virtual, inherited]

duplicate feature object

Returns:
feature object

Implements CFeatures.

Definition at line 83 of file SimpleFeatures.h.

template<class ST>
void CSimpleFeatures< ST >::free_feature_matrix (  )  [inherited]

free feature matrix

Definition at line 97 of file SimpleFeatures.h.

template<class ST>
void CSimpleFeatures< ST >::free_features (  )  [inherited]

free feature matrix and cache

Definition at line 108 of file SimpleFeatures.h.

template<class ST>
ST* CSimpleFeatures< ST >::get_feature_vector ( INT  num,
INT len,
bool &  dofree 
) [inherited]

get feature vector for sample num from the matrix as it is if matrix is initialized, else return preprocessed compute_feature_vector

Parameters:
num index of feature vector
len length is returned by reference
dofree whether returned vector must be freed by caller via free_feature_vector
Returns:
feature vector

Definition at line 125 of file SimpleFeatures.h.

template<class ST>
void CSimpleFeatures< ST >::free_feature_vector ( ST *  feat_vec,
INT  num,
bool  dofree 
) [inherited]

free feature vector

Parameters:
feat_vec feature vector to free
num index in feature cache
dofree if vector should be really deleted

Definition at line 189 of file SimpleFeatures.h.

template<class ST>
void CSimpleFeatures< ST >::get_fm ( ST **  dst,
INT d1,
INT d2 
) [inherited]

get the pointer to the feature matrix num_feat,num_vectors are returned by reference

Parameters:
dst destination to store matrix in
d1 dimension 1 of matrix
d2 dimension 2 of matrix

Definition at line 205 of file SimpleFeatures.h.

template<class ST>
ST* CSimpleFeatures< ST >::get_feature_matrix ( INT num_feat,
INT num_vec 
) [inherited]

get the pointer to the feature matrix num_feat,num_vectors are returned by reference

Parameters:
num_feat number of features in matrix
num_vec number of vectors in matrix
Returns:
feature matrix

Definition at line 223 of file SimpleFeatures.h.

template<class ST>
virtual void CSimpleFeatures< ST >::set_feature_matrix ( ST *  fm,
INT  num_feat,
INT  num_vec 
) [virtual, inherited]

set feature matrix necessary to set feature_matrix, num_features, num_vectors, where num_features is the column offset, and columns are linear in memory see below for definition of feature_matrix

Parameters:
fm feature matrix to se
num_feat number of features in matrix
num_vec number of vectors in matrix

Definition at line 240 of file SimpleFeatures.h.

template<class ST>
virtual void CSimpleFeatures< ST >::copy_feature_matrix ( ST *  src,
INT  num_feat,
INT  num_vec 
) [virtual, inherited]

copy feature matrix store copy of feature_matrix, where num_features is the column offset, and columns are linear in memory see below for definition of feature_matrix

Parameters:
src feature matrix to copy
num_feat number of features in matrix
num_vec number of vectors in matrix

Definition at line 257 of file SimpleFeatures.h.

template<class ST>
virtual bool CSimpleFeatures< ST >::apply_preproc ( bool  force_preprocessing = false  )  [virtual, inherited]

apply preprocessor

Parameters:
force_preprocessing if preprocssing shall be forced
Returns:
if applying was successful

Definition at line 272 of file SimpleFeatures.h.

template<class ST>
virtual INT CSimpleFeatures< ST >::get_size (  )  [virtual, inherited]

get memory footprint of one feature

Returns:
memory footprint of one feature

Implements CFeatures.

Definition at line 308 of file SimpleFeatures.h.

template<class ST>
virtual INT CSimpleFeatures< ST >::get_num_vectors (  )  [virtual, inherited]

get number of feature vectors

Returns:
number of feature vectors

Implements CFeatures.

Definition at line 315 of file SimpleFeatures.h.

template<class ST>
INT CSimpleFeatures< ST >::get_num_features (  )  [inherited]

get number of features

Returns:
number of features

Definition at line 321 of file SimpleFeatures.h.

template<class ST>
void CSimpleFeatures< ST >::set_num_features ( INT  num  )  [inherited]

set number of features

Parameters:
num number to set

Definition at line 327 of file SimpleFeatures.h.

template<class ST>
void CSimpleFeatures< ST >::set_num_vectors ( INT  num  )  [inherited]

set number of vectors

Parameters:
num number to set

Definition at line 342 of file SimpleFeatures.h.

template<class ST>
virtual EFeatureClass CSimpleFeatures< ST >::get_feature_class (  )  [virtual, inherited]

get feature class

Returns:
feature class SIMPLE

Implements CFeatures.

Definition at line 356 of file SimpleFeatures.h.

template<class ST>
virtual bool CSimpleFeatures< ST >::reshape ( INT  p_num_features,
INT  p_num_vectors 
) [virtual, inherited]

reshape

Parameters:
p_num_features new number of features
p_num_vectors new number of vectors
Returns:
if reshaping was successful

Reimplemented from CFeatures.

Definition at line 370 of file SimpleFeatures.h.

template<class ST>
virtual ST* CSimpleFeatures< ST >::compute_feature_vector ( INT  num,
INT len,
ST *  target = NULL 
) [protected, virtual, inherited]

compute feature vector for sample num if target is set the vector is written to target len is returned by reference

NOT IMPLEMENTED!

Parameters:
num num
len len
target 
Returns:
feature vector

Definition at line 394 of file SimpleFeatures.h.

INT CFeatures::add_preproc ( CPreProc p  )  [virtual, inherited]

set preprocessor

add preprocessor

Parameters:
p preprocessor to set
Returns:
something inty

Definition at line 48 of file Features.cpp.

CPreProc * CFeatures::del_preproc ( INT  num  )  [virtual, inherited]

del current preprocessor

delete preprocessor from list caller has to clean up returned preproc

Parameters:
num index of preprocessor in list

Definition at line 107 of file Features.cpp.

CPreProc * CFeatures::get_preproc ( INT  num  )  [inherited]

get current preprocessor

get specified preprocessor

Parameters:
num index of preprocessor in list

Definition at line 78 of file Features.cpp.

void CFeatures::set_preprocessed ( INT  num  )  [inherited]

set applied flag for preprocessor

Parameters:
num index of preprocessor in list

Definition at line 95 of file Features.h.

bool CFeatures::is_preprocessed ( INT  num  )  [inherited]

get whether specified preprocessor was already applied

Parameters:
num index of preprocessor in list

Definition at line 101 of file Features.h.

INT CFeatures::get_num_preprocessed (  )  [inherited]

get whether specified preprocessor (or all if num=1) was/were already applied

get the number of applied preprocs

Returns:
number of applied preprocessors

Definition at line 87 of file Features.cpp.

INT CFeatures::get_num_preproc (  )  [inherited]

get number of preprocessors

Returns:
number of preprocessors

Definition at line 113 of file Features.h.

void CFeatures::clean_preprocs (  )  [inherited]

clears all preprocs

clears all preprocs

Definition at line 101 of file Features.cpp.

INT CFeatures::get_cache_size (  )  [inherited]

get cache size

Returns:
cache size

Definition at line 122 of file Features.h.

void CFeatures::list_feature_obj (  )  [inherited]

list feature object

Definition at line 152 of file Features.cpp.

bool CFeatures::check_feature_compatibility ( CFeatures f  )  [inherited]

check feature compatibility

Parameters:
f features to check for compatibility
Returns:
if features are compatible

Definition at line 223 of file Features.cpp.


Member Data Documentation

alphabet

Definition at line 102 of file ByteFeatures.h.

template<class ST>
INT CSimpleFeatures< ST >::num_vectors [protected, inherited]

number of vectors in cache

Definition at line 401 of file SimpleFeatures.h.

template<class ST>
INT CSimpleFeatures< ST >::num_features [protected, inherited]

number of features in cache

Definition at line 404 of file SimpleFeatures.h.

template<class ST>
ST* CSimpleFeatures< ST >::feature_matrix [protected, inherited]

feature matrix

Definition at line 407 of file SimpleFeatures.h.

template<class ST>
CCache<ST>* CSimpleFeatures< ST >::feature_cache [protected, inherited]

feature cache

Definition at line 410 of file SimpleFeatures.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 files:

SHOGUN Machine Learning Toolbox - Documentation