SHOGUN  v3.0.0
 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/common.h>
18 
19 namespace shogun
20 {
33 {
34  public:
37 
45  CSimpleLocalityImprovedStringKernel(int32_t size, int32_t length,
46  int32_t inner_degree, int32_t outer_degree);
47 
58  int32_t length, int32_t inner_degree, int32_t outer_degree);
59 
61 
68  virtual bool init(CFeatures *l, CFeatures *r);
69 
71  virtual void cleanup();
72 
78  {
80  }
81 
86  virtual const char* get_name() const
87  {
88  return "SimpleLocalityImprovedStringKernel";
89  }
90 
91  private:
103  float64_t dot_pyr (const char* const x1, const char* const x2,
104  const int32_t NOF_NTS, const int32_t NTWIDTH,
105  const int32_t DEGREE1, const int32_t DEGREE2, float64_t *pyra);
106 
107  protected:
116  float64_t compute(int32_t idx_a, int32_t idx_b);
117 
118  private:
119  void init();
120 
121  protected:
123  int32_t length;
125  int32_t inner_degree;
127  int32_t outer_degree;
128 
131 };
132 }
133 #endif /* _SIMPLELOCALITYIMPROVEDSTRINGKERNEL_H___ */

SHOGUN Machine Learning Toolbox - Documentation