SHOGUN  v3.1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KernelDistance.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) 2010 Christian Widmer
8  * Copyright (C) 2010 Max-Planck-Society
9  */
10 
11 #include <shogun/lib/config.h>
12 
13 
14 #ifndef _KERNELDISTANCE_H___
15 #define _KERNELDISTANCE_H___
16 
17 #include <shogun/lib/common.h>
19 #include <shogun/kernel/Kernel.h>
20 
21 namespace shogun
22 {
23  class CDistance;
24 
34 {
35  public:
38 
45 
54  CFeatures *l, CFeatures *r, float64_t width, CKernel* k);
55 
57  virtual ~CKernelDistance();
58 
65  virtual bool init(CFeatures* l, CFeatures* r);
66 
76  virtual EFeatureType get_feature_type() { return kernel->get_feature_type(); }
77 
82  virtual EFeatureClass get_feature_class() { return kernel->get_feature_class(); }
83 
88  virtual const char* get_name() const { return "KernelDistance"; }
89 
93  virtual void cleanup() { if (kernel) kernel->cleanup(); }
94 
95  protected:
104  float64_t compute(int32_t idx_a, int32_t idx_b);
105 
106  private:
107  void init();
108 
109  private:
111  CKernel* kernel;
113  float64_t width;
114 };
115 }
116 #endif /* _KERNELDISTANCE_H__ */
virtual void cleanup()
Definition: Kernel.cpp:147
virtual EFeatureClass get_feature_class()
Class Distance, a base class for all the distances used in the Shogun toolbox.
Definition: Distance.h:80
virtual void cleanup()
virtual EFeatureType get_feature_type()
The Kernel distance takes a distance as input.
EFeatureClass
shogun feature class
Definition: FeatureTypes.h:35
virtual EDistanceType get_distance_type()
float64_t compute(int32_t idx_a, int32_t idx_b)
EDistanceType
Definition: Distance.h:31
double float64_t
Definition: common.h:48
virtual EFeatureType get_feature_type()=0
virtual const char * get_name() const
EFeatureType
shogun feature type
Definition: FeatureTypes.h:16
The class Features is the base class of all feature objects.
Definition: Features.h:62
The Kernel base class.
Definition: Kernel.h:150
virtual bool init(CFeatures *l, CFeatures *r)
virtual EFeatureClass get_feature_class()=0

SHOGUN Machine Learning Toolbox - Documentation