SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
kernel
ConstKernel.cpp
浏览该文件的文档.
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) 1999-2009 Soeren Sonnenburg
8
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*/
10
11
#include <
shogun/lib/common.h
>
12
#include <
shogun/io/SGIO.h
>
13
14
#include <
shogun/base/Parameter.h
>
15
16
#include <
shogun/kernel/ConstKernel.h
>
17
#include <
shogun/features/Features.h
>
18
19
using namespace
shogun;
20
21
CConstKernel::CConstKernel
()
22
:
CKernel
()
23
{
24
init
();
25
}
26
27
CConstKernel::CConstKernel
(
float64_t
c)
28
:
CKernel
()
29
{
30
init
();
31
const_value
=c;
32
}
33
34
CConstKernel::CConstKernel
(
CFeatures
* l,
CFeatures
* r,
float64_t
c)
35
:
CKernel
()
36
{
37
init
();
38
const_value
=c;
39
init
(l, r);
40
}
41
42
CConstKernel::~CConstKernel
()
43
{
44
}
45
46
bool
CConstKernel::init(
CFeatures
* l,
CFeatures
* r)
47
{
48
CKernel::init(l, r);
49
return
init_normalizer
();
50
}
51
52
void
CConstKernel::init()
53
{
54
const_value
=1.0;
55
SG_ADD
(&
const_value
,
"const_value"
,
"Value for kernel elements."
,
56
MS_AVAILABLE
);
57
}
SHOGUN
机器学习工具包 - 项目文档