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 * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society 00009 */ 00010 00011 #ifndef _GAUSSIANKERNEL_H___ 00012 #define _GAUSSIANKERNEL_H___ 00013 00014 #include "lib/common.h" 00015 #include "kernel/SimpleKernel.h" 00016 #include "features/RealFeatures.h" 00017 00027 class CGaussianKernel: public CSimpleKernel<float64_t> 00028 { 00029 public: 00035 CGaussianKernel(int32_t size, float64_t width); 00036 00044 CGaussianKernel(CRealFeatures* l, CRealFeatures* r, 00045 float64_t width, int32_t size=10); 00046 00047 virtual ~CGaussianKernel(); 00048 00055 virtual bool init(CFeatures* l, CFeatures* r); 00056 00062 virtual bool load_init(FILE* src); 00063 00069 virtual bool save_init(FILE* dest); 00070 00075 virtual EKernelType get_kernel_type() { return K_GAUSSIAN; } 00076 00081 virtual const char* get_name() { return "Gaussian"; } 00082 00083 protected: 00092 virtual float64_t compute(int32_t idx_a, int32_t idx_b); 00093 00094 protected: 00096 float64_t width; 00097 }; 00098 00099 #endif /* _GAUSSIANKERNEL_H__ */