SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleLocalityImprovedStringKernel.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 1999-2008 Gunnar Raetsch
8  * Written (W) 2013 Soeren Sonnenburg
9  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
10  * Copyright (C) 2013 Soeren Sonnenburg
11  */
12 
13 #ifndef _SIMPLELOCALITYIMPROVEDSTRINGKERNEL_H___
14 #define _SIMPLELOCALITYIMPROVEDSTRINGKERNEL_H___
15 
16 #include <shogun/lib/config.h>
17 
18 #include <shogun/lib/common.h>
20 
21 namespace shogun
22 {
35 {
36  public:
39 
47  CSimpleLocalityImprovedStringKernel(int32_t size, int32_t length,
48  int32_t inner_degree, int32_t outer_degree);
49 
60  int32_t length, int32_t inner_degree, int32_t outer_degree);
61 
63 
70  virtual bool init(CFeatures *l, CFeatures *r);
71 
73  virtual void cleanup();
74 
80  {
82  }
83 
88  virtual const char* get_name() const
89  {
90  return "SimpleLocalityImprovedStringKernel";
91  }
92 
93  private:
105  float64_t dot_pyr (const char* const x1, const char* const x2,
106  const int32_t NOF_NTS, const int32_t NTWIDTH,
107  const int32_t DEGREE1, const int32_t DEGREE2, float64_t *pyra);
108 
109  protected:
118  float64_t compute(int32_t idx_a, int32_t idx_b);
119 
120  private:
121  void init();
122 
123  protected:
125  int32_t length;
127  int32_t inner_degree;
129  int32_t outer_degree;
130 
133 };
134 }
135 #endif /* _SIMPLELOCALITYIMPROVEDSTRINGKERNEL_H___ */

SHOGUN Machine Learning Toolbox - Documentation