SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
kernel
DistanceKernel.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) 2007-2009 Christian Gehl
8
* Copyright (C) 2007-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*/
10
11
#include <
shogun/lib/config.h
>
12
13
14
#ifndef _DISTANCEKERNEL_H___
15
#define _DISTANCEKERNEL_H___
16
17
#include <
shogun/lib/common.h
>
18
#include <
shogun/kernel/Kernel.h
>
19
#include <
shogun/distance/Distance.h
>
20
21
namespace
shogun
22
{
23
class
CDistance;
24
33
class
CDistanceKernel
:
public
CKernel
34
{
35
public
:
37
CDistanceKernel
();
38
45
CDistanceKernel
(int32_t cache,
float64_t
width
,
CDistance
* dist);
46
54
CDistanceKernel
(
55
CFeatures
*l,
CFeatures
*r,
float64_t
width,
CDistance
* dist);
56
57
virtual
~CDistanceKernel
();
58
65
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r);
66
70
virtual
void
register_params
();
71
76
virtual
EKernelType
get_kernel_type
() {
return
K_DISTANCE
; }
81
virtual
EFeatureType
get_feature_type
() {
return
distance
->
get_feature_type
(); }
82
87
virtual
EFeatureClass
get_feature_class
() {
return
distance
->
get_feature_class
(); }
88
93
virtual
const
char
*
get_name
()
const
{
return
"DistanceKernel"
; }
94
99
virtual
void
set_width
(
float64_t
w)
100
{
101
width=w;
102
}
103
108
virtual
float64_t
get_width
()
const
109
{
110
return
width
;
111
}
112
113
114
protected
:
123
float64_t
compute
(int32_t idx_a, int32_t idx_b);
124
126
CDistance
*
distance
;
128
float64_t
width
;
129
};
130
}
131
#endif
/* _DISTANCEKERNEL_H__ */
SHOGUN
机器学习工具包 - 项目文档