SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
distance
CustomMahalanobisDistance.h
浏览该文件的文档.
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
register_params();
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
机器学习工具包 - 项目文档