SHOGUN  v2.0.0
 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/common.h>
16 
17 namespace shogun
18 {
37 {
38  public:
41 
48  CPolyMatchStringKernel(int32_t size, int32_t degree, bool inhomogene);
49 
59  int32_t degree, bool inhomogene);
60 
61  virtual ~CPolyMatchStringKernel();
62 
69  virtual bool init(CFeatures* l, CFeatures* r);
70 
72  virtual void cleanup();
73 
79  {
80  return K_POLYMATCH;
81  }
82 
87  virtual const char* get_name() const { return "PolyMatchStringKernel"; }
88 
93  void set_rescaling_enabled(bool n)
94  {
95  rescaling=n;
96  }
97 
103  {
104  return rescaling;
105  }
106 
107  protected:
116  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
117 
118  private:
119  void init();
120 
121  protected:
123  int32_t degree;
127  bool rescaling;
128 };
129 }
130 #endif /* _POLYMATCHSTRINGKERNEL_H___ */

SHOGUN Machine Learning Toolbox - Documentation