SHOGUN
v3.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
distance
CustomMahalanobisDistance.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) 2013 Fernando J. Iglesias Garcia
8
* Copyright (C) 2013 Fernando J. Iglesias Garcia
9
*/
10
11
#ifndef CUSTOM_MAHALANOBIS_DISTANCE_
12
#define CUSTOM_MAHALANOBIS_DISTANCE_
13
14
#ifdef HAVE_EIGEN3
15
16
#include <
shogun/distance/RealDistance.h
>
17
#include <
shogun/features/DenseFeatures.h
>
18
#include <
shogun/lib/SGMatrix.h
>
19
20
namespace
shogun
21
{
22
30
class
CCustomMahalanobisDistance
:
public
CRealDistance
31
{
32
public
:
34
CCustomMahalanobisDistance
();
35
42
CCustomMahalanobisDistance
(
CFeatures
* l,
CFeatures
* r,
SGMatrix<float64_t>
m);
43
45
virtual
~CCustomMahalanobisDistance
();
46
48
virtual
void
cleanup
();
49
51
virtual
const
char
*
get_name
()
const
;
52
57
virtual
EDistanceType
get_distance_type
();
58
59
protected
:
69
virtual
float64_t
compute
(int32_t idx_a, int32_t idx_b);
70
71
private
:
73
void
init();
74
75
private
:
77
SGMatrix<float64_t>
m_mahalanobis_matrix;
78
79
};
/* class CCustomMahalanobisDistance */
80
81
}
/* namespace shogun */
82
83
#endif
/* HAVE_EIGEN3 */
84
85
#endif
/* CUSTOM_MAHALANOBIS_DISTANCE_ */
SHOGUN
Machine Learning Toolbox - Documentation