SHOGUN  v2.0.0
 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 
71  inline virtual EDistanceType get_distance_type() { return D_UNKNOWN; }
76  inline virtual EFeatureType get_feature_type() { return kernel->get_feature_type(); }
77 
82  inline virtual EFeatureClass get_feature_class() { return kernel->get_feature_class(); }
83 
88  inline virtual const char* get_name() const { return "KernelDistance"; }
89 
93  inline virtual void cleanup() { return 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__ */

SHOGUN Machine Learning Toolbox - Documentation