SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
EuclideanDistance.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) 2007-2009 Soeren Sonnenburg
8  * Copyright (C) 2007-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _EUCLIDEANDISTANCE_H__
12 #define _EUCLIDEANDISTANCE_H__
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/common.h>
19 
20 namespace shogun
21 {
53 {
54  public:
57 
64  virtual ~CEuclideanDistance();
65 
72  virtual bool init(CFeatures* l, CFeatures* r);
73 
75  virtual void cleanup();
76 
82 
87  virtual EFeatureType get_feature_type() { return F_DREAL; }
88 
93  virtual const char* get_name() const { return "EuclideanDistance"; }
94 
100  virtual bool get_disable_sqrt() { return disable_sqrt; };
101 
107  virtual void set_disable_sqrt(bool state) { disable_sqrt=state; };
108 
121  virtual float64_t distance_upper_bounded(int32_t idx_a, int32_t idx_b, float64_t upper_bound);
122 
128  virtual void precompute_rhs();
129 
135  virtual void precompute_lhs();
136 
141  virtual void reset_precompute();
142 
143  protected:
147  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
148 
149  private:
150  void init();
151 
152  protected:
155 
158 
161 };
162 
163 } // namespace shogun
164 #endif /* _EUCLIDEANDISTANCE_H__ */
virtual const char * get_name() const
class RealDistance
Definition: RealDistance.h:22
virtual float64_t compute(int32_t idx_a, int32_t idx_b)
virtual float64_t distance_upper_bounded(int32_t idx_a, int32_t idx_b, float64_t upper_bound)
EDistanceType
Definition: Distance.h:32
virtual void set_disable_sqrt(bool state)
virtual EDistanceType get_distance_type()
double float64_t
Definition: common.h:50
virtual bool init(CFeatures *l, CFeatures *r)
EFeatureType
shogun feature type
Definition: FeatureTypes.h:19
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
SGVector< float64_t > m_lhs_squared_norms
The class Features is the base class of all feature objects.
Definition: Features.h:68
SGVector< float64_t > m_rhs_squared_norms
virtual EFeatureType get_feature_type()
class EuclideanDistance

SHOGUN Machine Learning Toolbox - Documentation