CWordFeatures Class Reference

Inheritance diagram for CWordFeatures:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 CWordFeatures (int32_t size=0, int32_t num_symbols=(1<< 16))
 CWordFeatures (const CWordFeatures &orig)
 CWordFeatures (uint16_t *src, int32_t num_feat, int32_t num_vec)
 CWordFeatures (char *fname, int32_t num_sym=(1<< 16))
virtual ~CWordFeatures ()
bool obtain_from_char_features (CCharFeatures *cf, int32_t start, int32_t order, int32_t gap=0)
virtual void get_fm (uint16_t **dst, int32_t *d1, int32_t *d2)
virtual void copy_feature_matrix (uint16_t *src, int32_t num_feat, int32_t num_vec)
virtual bool load (char *fname)
virtual bool save (char *fname)
int32_t get_num_symbols ()
int32_t get_original_num_symbols ()
int32_t get_order ()
uint16_t get_masked_symbols (uint16_t symbol, uint8_t mask)

Protected Member Functions

void translate_from_single_order (uint16_t *obs, int32_t sequence_length, int32_t start, int32_t order, int32_t max_val, int32_t gap=0)

Protected Attributes

int32_t num_symbols
 number of used symbols
int32_t original_num_symbols
 original number of used symbols (before higher order mapping)
int32_t order
 order used in higher order mapping
uint16_t * symbol_mask_table
 order used in higher order mapping


Detailed Description

The class WordFeatures implements a dense word (16bit unsigned) matrix. It inherits its functionality from CSimpleFeatures, which should be consulted for further reference.

Definition at line 23 of file WordFeatures.h.


Constructor & Destructor Documentation

CWordFeatures::CWordFeatures ( int32_t  size = 0,
int32_t  num_symbols = (1<<16) 
)

constructor

Parameters:
size cache size
num_symbols number of symbols

Definition at line 16 of file WordFeatures.cpp.

CWordFeatures::CWordFeatures ( const CWordFeatures orig  ) 

copy constructor

Definition at line 22 of file WordFeatures.cpp.

CWordFeatures::CWordFeatures ( uint16_t *  src,
int32_t  num_feat,
int32_t  num_vec 
)

constructor that copies feature matrix from pointer num_feat,num_vec pair

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

Definition at line 43 of file WordFeatures.h.

CWordFeatures::CWordFeatures ( char *  fname,
int32_t  num_sym = (1<<16) 
)

constructor

Parameters:
fname filename to load features from
num_sym number of symbols

Definition at line 27 of file WordFeatures.cpp.

CWordFeatures::~CWordFeatures (  )  [virtual]

Definition at line 33 of file WordFeatures.cpp.


Member Function Documentation

virtual void CWordFeatures::copy_feature_matrix ( uint16_t *  src,
int32_t  num_feat,
int32_t  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

Reimplemented from CSimpleFeatures< uint16_t >.

Definition at line 89 of file WordFeatures.h.

virtual void CWordFeatures::get_fm ( uint16_t **  dst,
int32_t *  d1,
int32_t *  d2 
) [virtual]

get feature matrix

Parameters:
dst destination where matrix will be stored
d1 dimension 1 of matrix
d2 dimension 2 of matrix

Reimplemented from CSimpleFeatures< uint16_t >.

Definition at line 75 of file WordFeatures.h.

uint16_t CWordFeatures::get_masked_symbols ( uint16_t  symbol,
uint8_t  mask 
)

a higher order mapped symbol will be shaped such that the symbols in specified by bits in the mask will be returned.

Parameters:
symbol symbol to mask
mask mask to apply
Returns:
masked symbol

Definition at line 135 of file WordFeatures.h.

int32_t CWordFeatures::get_num_symbols (  ) 

get number of symbols

Returns:
number of symbols

Definition at line 112 of file WordFeatures.h.

int32_t CWordFeatures::get_order (  ) 

order used for higher order mapping

Returns:
order

Definition at line 126 of file WordFeatures.h.

int32_t CWordFeatures::get_original_num_symbols (  ) 

number of symbols before higher order mapping

Returns:
original number of symbols

Definition at line 120 of file WordFeatures.h.

bool CWordFeatures::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 192 of file WordFeatures.cpp.

bool CWordFeatures::obtain_from_char_features ( CCharFeatures cf,
int32_t  start,
int32_t  order,
int32_t  gap = 0 
)

obtain from char features

Parameters:
cf char features
start start
order order
gap gap
Returns:
if obtaining was successful

Definition at line 38 of file WordFeatures.cpp.

bool CWordFeatures::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 197 of file WordFeatures.cpp.

void CWordFeatures::translate_from_single_order ( uint16_t *  obs,
int32_t  sequence_length,
int32_t  start,
int32_t  order,
int32_t  max_val,
int32_t  gap = 0 
) [protected]

translate from single order

Parameters:
obs observation
sequence_length length of sequence
start start
order order
max_val how many bits does the largest symbol require to be stored without loss
gap gap

Definition at line 136 of file WordFeatures.cpp.


Member Data Documentation

int32_t CWordFeatures::num_symbols [protected]

number of used symbols

Definition at line 156 of file WordFeatures.h.

int32_t CWordFeatures::order [protected]

order used in higher order mapping

Definition at line 162 of file WordFeatures.h.

original number of used symbols (before higher order mapping)

Definition at line 159 of file WordFeatures.h.

uint16_t* CWordFeatures::symbol_mask_table [protected]

order used in higher order mapping

Definition at line 165 of file WordFeatures.h.


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

SHOGUN Machine Learning Toolbox - Documentation