SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DistanceKernel.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) 2007-2009 Christian Gehl
8  * Copyright (C) 2007-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #include <shogun/lib/config.h>
12 
13 #ifndef _DISTANCEKERNEL_H___
14 #define _DISTANCEKERNEL_H___
15 
16 #include <shogun/lib/common.h>
17 #include <shogun/kernel/Kernel.h>
19 
20 namespace shogun
21 {
22  class CDistance;
23 
32 class CDistanceKernel: public CKernel
33 {
34  public:
37 
44  CDistanceKernel(int32_t cache, float64_t width, CDistance* dist);
45 
54  CFeatures *l, CFeatures *r, float64_t width, CDistance* dist);
55 
56  virtual ~CDistanceKernel();
57 
64  virtual bool init(CFeatures* l, CFeatures* r);
65 
69  virtual void register_params();
70 
75  virtual EKernelType get_kernel_type() { return K_DISTANCE; }
81 
87 
92  virtual const char* get_name() const { return "DistanceKernel"; }
93 
98  virtual void set_width(float64_t w)
99  {
100  width=w;
101  }
102 
107  virtual float64_t get_width() const
108  {
109  return width;
110  }
111 
112 
113  protected:
122  float64_t compute(int32_t idx_a, int32_t idx_b);
123 
128 };
129 }
130 #endif /* _DISTANCEKERNEL_H__ */
virtual EFeatureClass get_feature_class()=0
virtual void set_width(float64_t w)
EKernelType
Definition: Kernel.h:57
Class Distance, a base class for all the distances used in the Shogun toolbox.
Definition: Distance.h:87
virtual const char * get_name() const
virtual float64_t get_width() const
float64_t compute(int32_t idx_a, int32_t idx_b)
virtual EKernelType get_kernel_type()
EFeatureClass
shogun feature class
Definition: FeatureTypes.h:38
virtual void register_params()
double float64_t
Definition: common.h:50
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
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual EFeatureType get_feature_type()=0
The Kernel base class.
Definition: Kernel.h:159
virtual EFeatureClass get_feature_class()
virtual bool init(CFeatures *l, CFeatures *r)
virtual EFeatureType get_feature_type()

SHOGUN Machine Learning Toolbox - Documentation