ShortFeatures.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _SHORTFEATURES__H__
00013 #define _SHORTFEATURES__H__
00014
00015 #include "features/SimpleFeatures.h"
00016 #include "features/CharFeatures.h"
00017 #include "lib/common.h"
00018
00023 class CShortFeatures : public CSimpleFeatures<int16_t>
00024 {
00025 public:
00030 CShortFeatures(int32_t size=0);
00031
00033 CShortFeatures(const CShortFeatures & orig);
00034
00042 inline CShortFeatures(int16_t* src, int32_t num_feat, int32_t num_vec): CSimpleFeatures<int16_t>(0)
00043 {
00044 CSimpleFeatures<int16_t>::copy_feature_matrix(src, num_feat, num_vec);
00045 }
00046
00051 CShortFeatures(char* fname);
00052
00061 bool obtain_from_char_features(CCharFeatures* cf, int32_t start, int32_t order, int32_t gap=0);
00062
00067 virtual EFeatureType get_feature_type() { return F_SHORT; }
00068
00077 inline virtual void copy_feature_matrix(int16_t* src, int32_t num_feat, int32_t num_vec)
00078 {
00079 CSimpleFeatures<int16_t>::copy_feature_matrix(src, num_feat, num_vec);
00080 }
00081
00087 virtual bool load(char* fname);
00088
00094 virtual bool save(char* fname);
00095 protected:
00105 void translate_from_single_order(int16_t* obs, int32_t sequence_length, int32_t start, int32_t order, int32_t max_val, int32_t gap);
00106 };
00107 #endif