SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PolyMatchStringKernel.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-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _POLYMATCHSTRINGKERNEL_H___
12 #define _POLYMATCHSTRINGKERNEL_H___
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/common.h>
18 
19 namespace shogun
20 {
39 {
40  public:
43 
50  CPolyMatchStringKernel(int32_t size, int32_t degree, bool inhomogene);
51 
61  int32_t degree, bool inhomogene);
62 
63  virtual ~CPolyMatchStringKernel();
64 
71  virtual bool init(CFeatures* l, CFeatures* r);
72 
74  virtual void cleanup();
75 
81  {
82  return K_POLYMATCH;
83  }
84 
89  virtual const char* get_name() const { return "PolyMatchStringKernel"; }
90 
95  void set_rescaling_enabled(bool n)
96  {
97  rescaling=n;
98  }
99 
105  {
106  return rescaling;
107  }
108 
109  protected:
118  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
119 
120  private:
121  void init();
122 
123  protected:
125  int32_t degree;
129  bool rescaling;
130 };
131 }
132 #endif /* _POLYMATCHSTRINGKERNEL_H___ */

SHOGUN Machine Learning Toolbox - Documentation