SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 #ifdef HAVE_LAPACK
15 
16 #include <shogun/lib/config.h>
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__ */

SHOGUN Machine Learning Toolbox - Documentation