Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _SIMPLELOCALITYIMPROVEDSTRINGKERNEL_H___
00012 #define _SIMPLELOCALITYIMPROVEDSTRINGKERNEL_H___
00013
00014 #include "lib/common.h"
00015 #include "kernel/StringKernel.h"
00016
00017 namespace shogun
00018 {
00030 class CSimpleLocalityImprovedStringKernel: public CStringKernel<char>
00031 {
00032 public:
00040 CSimpleLocalityImprovedStringKernel(int32_t size, int32_t length,
00041 int32_t inner_degree, int32_t outer_degree);
00042
00051 CSimpleLocalityImprovedStringKernel(
00052 CStringFeatures<char>* l, CStringFeatures<char>* r,
00053 int32_t length, int32_t inner_degree, int32_t outer_degree);
00054
00055 virtual ~CSimpleLocalityImprovedStringKernel();
00056
00063 virtual bool init(CFeatures *l, CFeatures *r);
00064
00066 virtual void cleanup();
00067
00072 virtual EKernelType get_kernel_type()
00073 {
00074 return K_SIMPLELOCALITYIMPROVED;
00075 }
00076
00081 virtual const char* get_name() const { return "SimpleLocalityImproved"; }
00082
00083 private:
00095 float64_t dot_pyr (const char* const x1, const char* const x2,
00096 const int32_t NOF_NTS, const int32_t NTWIDTH,
00097 const int32_t DEGREE1, const int32_t DEGREE2, float64_t *pyra);
00098
00099 protected:
00108 float64_t compute(int32_t idx_a, int32_t idx_b);
00109
00110 protected:
00112 int32_t length;
00114 int32_t inner_degree;
00116 int32_t outer_degree;
00118 float64_t *pyramid_weights;
00119 };
00120 }
00121 #endif