ShortFeatures.h

Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 1999-2008 Soeren Sonnenburg
00008  * Written (W) 1999-2008 Gunnar Raetsch
00009  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
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

SHOGUN Machine Learning Toolbox - Documentation