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
00027 class CSimpleLocalityImprovedStringKernel: public CStringKernel<char>
00028 {
00029 public:
00037 CSimpleLocalityImprovedStringKernel(int32_t size, int32_t length,
00038 int32_t inner_degree, int32_t outer_degree);
00039
00048 CSimpleLocalityImprovedStringKernel(
00049 CStringFeatures<char>* l, CStringFeatures<char>* r,
00050 int32_t length, int32_t inner_degree, int32_t outer_degree);
00051
00052 virtual ~CSimpleLocalityImprovedStringKernel();
00053
00060 virtual bool init(CFeatures *l, CFeatures *r);
00061
00063 virtual void cleanup();
00064
00070 bool load_init(FILE *src);
00071
00077 bool save_init(FILE *dest);
00078
00083 virtual EKernelType get_kernel_type()
00084 {
00085 return K_SIMPLELOCALITYIMPROVED;
00086 }
00087
00092 virtual const char *get_name()
00093 {
00094 return "SimpleLocalityImproved";
00095 }
00096
00097 private:
00109 float64_t dot_pyr (const char* const x1, const char* const x2,
00110 const int32_t NOF_NTS, const int32_t NTWIDTH,
00111 const int32_t DEGREE1, const int32_t DEGREE2, float64_t *pyra);
00112
00113 protected:
00122 float64_t compute(int32_t idx_a, int32_t idx_b);
00123
00124 protected:
00126 int32_t length;
00128 int32_t inner_degree;
00130 int32_t outer_degree;
00132 float64_t *pyramid_weights;
00133 };
00134
00135 #endif