SimplePreProc.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-2009 Soeren Sonnenburg
00008  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #ifndef _CSIMPLEPREPROC__H__
00012 #define _CSIMPLEPREPROC__H__
00013 
00014 #include "features/Features.h"
00015 #include "features/SimpleFeatures.h"
00016 #include "lib/common.h"
00017 #include "preproc/PreProc.h"
00018 
00019 template <class ST> class CSimpleFeatures;
00020 
00029 template <class ST> class CSimplePreProc : public CPreProc
00030 {
00031     public:
00037         CSimplePreProc(const char *name, const char* id) : CPreProc(name,id) {}
00038 
00042         virtual ST* apply_to_feature_matrix(CFeatures* f)=0;
00043 
00046 
00047         virtual ST* apply_to_feature_vector(ST* f, int32_t &len)=0;
00048 
00050         inline virtual EFeatureClass get_feature_class() { return C_SIMPLE; }
00052         inline virtual EFeatureType get_feature_type();
00053 };
00054 
00055 template<> inline EFeatureType CSimplePreProc<float64_t>::get_feature_type()
00056 {
00057     return F_DREAL;
00058 }
00059 
00060 template<> inline EFeatureType CSimplePreProc<int16_t>::get_feature_type()
00061 {
00062     return F_SHORT;
00063 }
00064 
00065 template<> inline EFeatureType CSimplePreProc<uint16_t>::get_feature_type()
00066 {
00067     return F_WORD;
00068 }
00069 
00070 template<> inline EFeatureType CSimplePreProc<char>::get_feature_type()
00071 {
00072     return F_CHAR;
00073 }
00074 
00075 template<> inline EFeatureType CSimplePreProc<uint8_t>::get_feature_type()
00076 {
00077     return F_BYTE;
00078 }
00079 
00080 template<> inline EFeatureType CSimplePreProc<uint64_t>::get_feature_type()
00081 {
00082     return F_ULONG;
00083 }
00084 
00085 #endif

SHOGUN Machine Learning Toolbox - Documentation