SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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_ */
virtual EFeatureClass get_feature_class()=0
EKernelType
Definition: Kernel.h:57
virtual const char * get_name() const
Definition: BesselKernel.h:111
virtual void cleanup()
Class Distance, a base class for all the distances used in the Shogun toolbox.
Definition: Distance.h:87
virtual void set_order(float64_t v)
Definition: BesselKernel.h:120
virtual bool init(CFeatures *l, CFeatures *r)
virtual EKernelType get_kernel_type()
Definition: BesselKernel.h:86
EFeatureClass
shogun feature class
Definition: FeatureTypes.h:38
the class Bessel kernel
Definition: BesselKernel.h:34
virtual float64_t get_width() const
Definition: BesselKernel.h:147
virtual void set_width(float64_t tau)
Definition: BesselKernel.h:138
double float64_t
Definition: common.h:50
virtual EFeatureClass get_feature_class()
Definition: BesselKernel.h:102
virtual void set_degree(int32_t n)
Definition: BesselKernel.h:156
virtual EFeatureType get_feature_type()
Definition: BesselKernel.h:94
The Distance kernel takes a distance as input.
EFeatureType
shogun feature type
Definition: FeatureTypes.h:19
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
float64_t compute(int32_t idx_a, int32_t idx_b)
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual EFeatureType get_feature_type()=0
virtual float64_t get_order() const
Definition: BesselKernel.h:129
virtual int32_t get_degree() const
Definition: BesselKernel.h:165

SHOGUN Machine Learning Toolbox - Documentation