SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RealDistance.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) 1999-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _REALDISTANCE_H__
12 #define _REALDISTANCE_H__
13 
14 #include <shogun/lib/config.h>
15 
17 #include <shogun/lib/common.h>
18 
19 namespace shogun
20 {
22 class CRealDistance : public CDenseDistance<float64_t>
23 {
24 public:
27 
34  virtual bool init(CFeatures* l, CFeatures* r)
35  {
37 
40 
41  return true;
42  }
43 
48  virtual EFeatureType get_feature_type() { return F_DREAL; }
49 
55  virtual const char* get_name() const { return "RealDistance"; }
56 
61  virtual void cleanup()=0;
62 
69  virtual EDistanceType get_distance_type()=0 ;
70 
71 protected:
75  virtual float64_t compute(int32_t x, int32_t y)=0;
76 };
77 } // namespace shogun
78 #endif
virtual float64_t compute(int32_t x, int32_t y)=0
class RealDistance
Definition: RealDistance.h:22
virtual void cleanup()=0
virtual EFeatureType get_feature_type()
Definition: RealDistance.h:48
virtual bool init(CFeatures *l, CFeatures *r)
Definition: RealDistance.h:34
#define ASSERT(x)
Definition: SGIO.h:201
EDistanceType
Definition: Distance.h:32
double float64_t
Definition: common.h:50
EFeatureType
shogun feature type
Definition: FeatureTypes.h:19
virtual const char * get_name() const
Definition: RealDistance.h:55
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
template class DenseDistance
Definition: DenseDistance.h:24
virtual EFeatureType get_feature_type() const =0
virtual EDistanceType get_distance_type()=0

SHOGUN Machine Learning Toolbox - Documentation