SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BesselKernel.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) 2011 Ziyuan Lin
8  * Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
9  */
10 
11 #ifndef BESSELKERNEL_H_
12 #define BESSELKERNEL_H_
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/common.h>
17 #include <shogun/kernel/Kernel.h>
19 
20 namespace shogun
21 {
22 class CDistance;
35 {
36  public:
38  CBesselKernel();
39 
48  CBesselKernel(int32_t size, float64_t order,
49  float64_t width, int32_t degree,
50  CDistance* dist);
51 
63  float64_t order, float64_t width, int32_t degree,
64  CDistance* dist, int32_t size=10);
65 
69  virtual ~CBesselKernel();
70 
77  virtual bool init(CFeatures* l, CFeatures* r);
78 
80  virtual void cleanup();
81 
87  {
88  return K_BESSEL;
89  }
90 
95  {
96  return distance->get_feature_type();
97  }
98 
103  {
104  return distance->get_feature_class();
105  }
106 
111  virtual const char* get_name() const
112  {
113  return "BesselKernel";
114  }
115 
120  virtual void set_order(float64_t v)
121  {
122  order = v;
123  }
124 
129  virtual float64_t get_order() const
130  {
131  return order;
132  }
133 
138  virtual void set_width(float64_t tau)
139  {
140  width = tau;
141  }
142 
147  virtual float64_t get_width() const
148  {
149  return width;
150  }
151 
156  virtual void set_degree(int32_t n)
157  {
158  degree = n;
159  }
160 
165  virtual int32_t get_degree() const
166  {
167  return degree;
168  }
169 
170  protected:
171  float64_t compute(int32_t idx_a, int32_t idx_b);
172 
173  private:
174  void init();
175 
176  protected:
180  int32_t degree;
181 };
182 
183 }
184 
185 #endif /* BESSELKERNEL_H_ */

SHOGUN Machine Learning Toolbox - Documentation