SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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/config.h>
18 
19 #include <shogun/lib/common.h>
21 #include <shogun/kernel/Kernel.h>
22 
23 namespace shogun
24 {
25  class CDistance;
26 
36 {
37  public:
40 
47 
56  CFeatures *l, CFeatures *r, float64_t width, CKernel* k);
57 
59  virtual ~CKernelDistance();
60 
67  virtual bool init(CFeatures* l, CFeatures* r);
68 
78  virtual EFeatureType get_feature_type() { return kernel->get_feature_type(); }
79 
84  virtual EFeatureClass get_feature_class() { return kernel->get_feature_class(); }
85 
90  virtual const char* get_name() const { return "KernelDistance"; }
91 
95  virtual void cleanup() { if (kernel) kernel->cleanup(); }
96 
97  protected:
106  float64_t compute(int32_t idx_a, int32_t idx_b);
107 
108  private:
109  void init();
110 
111  private:
113  CKernel* kernel;
115  float64_t width;
116 };
117 }
118 #endif /* _KERNELDISTANCE_H__ */
virtual void cleanup()
Definition: Kernel.cpp:173
virtual EFeatureClass get_feature_class()
Class Distance, a base class for all the distances used in the Shogun toolbox.
Definition: Distance.h:87
virtual void cleanup()
virtual EFeatureType get_feature_type()
The Kernel distance takes a distance as input.
EFeatureClass
shogun feature class
Definition: FeatureTypes.h:38
virtual EDistanceType get_distance_type()
float64_t compute(int32_t idx_a, int32_t idx_b)
EDistanceType
Definition: Distance.h:32
double float64_t
Definition: common.h:50
virtual EFeatureType get_feature_type()=0
virtual const char * get_name() const
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
The Kernel base class.
Definition: Kernel.h:159
virtual bool init(CFeatures *l, CFeatures *r)
virtual EFeatureClass get_feature_class()=0

SHOGUN Machine Learning Toolbox - Documentation