SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MahalanobisDistance.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) 2012 Fernando José Iglesias García
8  * Copyright (C) 2012 Fernando José Iglesias García
9  */
10 
11 #ifndef _MAHALANOBISDISTANCE_H__
12 #define _MAHALANOBISDISTANCE_H__
13 
14 #include <shogun/lib/config.h>
15 
16 #ifdef HAVE_LAPACK
17 
18 #include <shogun/lib/common.h>
20 
21 namespace shogun
22 {
53 {
54  public:
57 
64  virtual ~CMahalanobisDistance();
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 "MahalanobisDistance"; }
94 
100  virtual bool get_disable_sqrt() { return disable_sqrt; };
101 
107  virtual void set_disable_sqrt(bool state) { disable_sqrt=state; };
108 
114  virtual bool get_use_mean() { return use_mean; };
115 
121  virtual void set_use_mean(bool state) { use_mean=state; };
122 
123  protected:
133  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
134 
135  private:
136  void init();
137 
138  protected:
141 
143  bool use_mean;
144 
149 };
150 
151 } // namespace shogun
152 #endif /* HAVE_LAPACK */
153 #endif /* _MAHALANOBISDISTANCE_H__ */
class RealDistance
Definition: RealDistance.h:22
virtual const char * get_name() const
virtual void set_use_mean(bool state)
EDistanceType
Definition: Distance.h:32
double float64_t
Definition: common.h:50
virtual EDistanceType get_distance_type()
virtual EFeatureType get_feature_type()
virtual void set_disable_sqrt(bool state)
EFeatureType
shogun feature type
Definition: FeatureTypes.h:19
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual float64_t compute(int32_t idx_a, int32_t idx_b)
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual bool init(CFeatures *l, CFeatures *r)
class MahalanobisDistance

SHOGUN Machine Learning Toolbox - Documentation