SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
distance
KernelDistance.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) 2010 Christian Widmer
8
* Copyright (C) 2010 Max-Planck-Society
9
*/
10
11
#include <
shogun/lib/config.h
>
12
13
14
#ifndef _KERNELDISTANCE_H___
15
#define _KERNELDISTANCE_H___
16
17
#include <
shogun/lib/common.h
>
18
#include <
shogun/distance/Distance.h
>
19
#include <
shogun/kernel/Kernel.h
>
20
21
namespace
shogun
22
{
23
class
CDistance;
24
33
class
CKernelDistance
:
public
CDistance
34
{
35
public
:
37
CKernelDistance
();
38
44
CKernelDistance
(
float64_t
width,
CKernel
* k);
45
53
CKernelDistance
(
54
CFeatures
*l,
CFeatures
*r,
float64_t
width,
CKernel
* k);
55
57
virtual
~CKernelDistance
();
58
65
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r);
66
71
virtual
EDistanceType
get_distance_type
() {
return
D_UNKNOWN
; }
76
virtual
EFeatureType
get_feature_type
() {
return
kernel->
get_feature_type
(); }
77
82
virtual
EFeatureClass
get_feature_class
() {
return
kernel->
get_feature_class
(); }
83
88
virtual
const
char
*
get_name
()
const
{
return
"KernelDistance"
; }
89
93
virtual
void
cleanup
() {
if
(kernel) kernel->
cleanup
(); }
94
95
protected
:
104
float64_t
compute
(int32_t idx_a, int32_t idx_b);
105
106
private
:
107
void
init();
108
109
private
:
111
CKernel
* kernel;
113
float64_t
width;
114
};
115
}
116
#endif
/* _KERNELDISTANCE_H__ */
SHOGUN
机器学习工具包 - 项目文档