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) 2008 Gunnar Raetsch 00008 * Copyright (C) 2008-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00009 */ 00010 00011 #ifndef _GAUSSIANSHIFTKERNEL_H___ 00012 #define _GAUSSIANSHIFTKERNEL_H___ 00013 00014 #include <shogun/lib/common.h> 00015 #include <shogun/kernel/GaussianKernel.h> 00016 #include <shogun/features/SimpleFeatures.h> 00017 00018 namespace shogun 00019 { 00037 class CGaussianShiftKernel: public CGaussianKernel 00038 { 00039 public: 00041 CGaussianShiftKernel(); 00042 00050 CGaussianShiftKernel( 00051 int32_t size, float64_t width, int32_t max_shift, 00052 int32_t shift_step); 00053 00063 CGaussianShiftKernel( 00064 CSimpleFeatures<float64_t>* l, CSimpleFeatures<float64_t>* r, 00065 float64_t width, int32_t max_shift, int32_t shift_step, 00066 int32_t size=10); 00067 00068 virtual ~CGaussianShiftKernel(); 00069 00074 virtual EKernelType get_kernel_type() { return K_GAUSSIANSHIFT; } 00075 00080 virtual const char* get_name() const { return "GaussianShiftKernel"; } 00081 00082 protected: 00091 virtual float64_t compute(int32_t idx_a, int32_t idx_b); 00092 00093 private: 00094 void init(); 00095 00096 protected: 00098 int32_t max_shift; 00100 int32_t shift_step; 00101 }; 00102 } 00103 #endif /* _GAUSSIANSHIFTKERNEL_H__ */