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
00020 class CShortFeatures : public CSimpleFeatures<SHORT>
00021 {
00022 public:
00027 CShortFeatures(INT size=0);
00028
00030 CShortFeatures(const CShortFeatures & orig);
00031
00039 inline CShortFeatures(SHORT* src, INT num_feat, INT num_vec): CSimpleFeatures<SHORT>(0)
00040 {
00041 CSimpleFeatures<SHORT>::copy_feature_matrix(src, num_feat, num_vec);
00042 }
00043
00048 CShortFeatures(CHAR* fname);
00049
00058 bool obtain_from_char_features(CCharFeatures* cf, INT start, INT order, INT gap=0);
00059
00064 virtual EFeatureType get_feature_type() { return F_SHORT; }
00065
00074 inline virtual void copy_feature_matrix(SHORT* src, INT num_feat, INT num_vec)
00075 {
00076 CSimpleFeatures<SHORT>::copy_feature_matrix(src, num_feat, num_vec);
00077 }
00078
00084 virtual bool load(CHAR* fname);
00085
00091 virtual bool save(CHAR* fname);
00092 protected:
00102 void translate_from_single_order(SHORT* obs, INT sequence_length, INT start, INT order, INT max_val, INT gap);
00103 };
00104 #endif