SHOGUN  3.2.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/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__ */

SHOGUN Machine Learning Toolbox - Documentation