LocalityImprovedStringKernel.h

Go to the documentation of this file.
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 Gunnar Raetsch
00008  * Written (W) 1999-2008 Soeren Sonnenburg
00009  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
00010  */
00011 
00012 #ifndef _LOCALITYIMPROVEDSTRINGKERNEL_H___
00013 #define _LOCALITYIMPROVEDSTRINGKERNEL_H___
00014 
00015 #include "lib/common.h"
00016 #include "kernel/StringKernel.h"
00017 
00019 class CLocalityImprovedStringKernel: public CStringKernel<CHAR>
00020 {
00021     public:
00029         CLocalityImprovedStringKernel(INT size, INT length,
00030             INT inner_degree, INT outer_degree);
00031 
00040         CLocalityImprovedStringKernel(
00041             CStringFeatures<CHAR>* l, CStringFeatures<CHAR>* r,
00042             INT length, INT inner_degree, INT outer_degree);
00043 
00044         virtual ~CLocalityImprovedStringKernel();
00045 
00052         virtual bool init(CFeatures* l, CFeatures* r);
00053 
00059         bool load_init(FILE* src);
00060 
00066         bool save_init(FILE* dest);
00067 
00072         virtual EKernelType get_kernel_type() { return K_LOCALITYIMPROVED; }
00073 
00078         virtual const CHAR* get_name() { return "LocalityImproved"; }
00079 
00080     protected:
00089         DREAL compute(INT idx_a, INT idx_b);
00090 
00091     protected:
00093         INT length;
00095         INT inner_degree;
00097         INT outer_degree;
00098 };
00099 
00100 #endif /* _LOCALITYIMPROVEDSTRINGKERNEL_H__ */
00101 

SHOGUN Machine Learning Toolbox - Documentation