SimpleLocalityImprovedStringKernel.h
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
00028 class CSimpleLocalityImprovedStringKernel: public CStringKernel<char>
00029 {
00030 public:
00038 CSimpleLocalityImprovedStringKernel(int32_t size, int32_t length,
00039 int32_t inner_degree, int32_t outer_degree);
00040
00049 CSimpleLocalityImprovedStringKernel(
00050 CStringFeatures<char>* l, CStringFeatures<char>* r,
00051 int32_t length, int32_t inner_degree, int32_t outer_degree);
00052
00053 virtual ~CSimpleLocalityImprovedStringKernel();
00054
00061 virtual bool init(CFeatures *l, CFeatures *r);
00062
00064 virtual void cleanup();
00065
00071 bool load_init(FILE *src);
00072
00078 bool save_init(FILE *dest);
00079
00084 virtual EKernelType get_kernel_type()
00085 {
00086 return K_SIMPLELOCALITYIMPROVED;
00087 }
00088
00093 virtual const char* get_name() const { return "SimpleLocalityImproved"; }
00094
00095 private:
00107 float64_t dot_pyr (const char* const x1, const char* const x2,
00108 const int32_t NOF_NTS, const int32_t NTWIDTH,
00109 const int32_t DEGREE1, const int32_t DEGREE2, float64_t *pyra);
00110
00111 protected:
00120 float64_t compute(int32_t idx_a, int32_t idx_b);
00121
00122 protected:
00124 int32_t length;
00126 int32_t inner_degree;
00128 int32_t outer_degree;
00130 float64_t *pyramid_weights;
00131 };
00132
00133 #endif