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 namespace shogun
00020 {
00021 template <class ST> class CSimpleFeatures;
00022 
00031 template <class ST> class CSimplePreProc : public CPreProc
00032 {
00033     public:
00039         CSimplePreProc(const char *name, const char* id) : CPreProc(name,id) {}
00040 
00044         virtual ST* apply_to_feature_matrix(CFeatures* f)=0;
00045 
00048 
00049         virtual ST* apply_to_feature_vector(ST* f, int32_t &len)=0;
00050 
00052         inline virtual EFeatureClass get_feature_class() { return C_SIMPLE; }
00054         inline virtual EFeatureType get_feature_type();
00055 };
00056 
00057 template<> inline EFeatureType CSimplePreProc<float64_t>::get_feature_type()
00058 {
00059     return F_DREAL;
00060 }
00061 
00062 template<> inline EFeatureType CSimplePreProc<int16_t>::get_feature_type()
00063 {
00064     return F_SHORT;
00065 }
00066 
00067 template<> inline EFeatureType CSimplePreProc<uint16_t>::get_feature_type()
00068 {
00069     return F_WORD;
00070 }
00071 
00072 template<> inline EFeatureType CSimplePreProc<char>::get_feature_type()
00073 {
00074     return F_CHAR;
00075 }
00076 
00077 template<> inline EFeatureType CSimplePreProc<uint8_t>::get_feature_type()
00078 {
00079     return F_BYTE;
00080 }
00081 
00082 template<> inline EFeatureType CSimplePreProc<uint64_t>::get_feature_type()
00083 {
00084     return F_ULONG;
00085 }
00086 }
00087 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation