SHOGUN
6.0.0
src
shogun
kernel
ConstKernel.cpp
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) 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
}
Parameter.h
SGIO.h
shogun::CConstKernel::const_value
float64_t const_value
Definition:
ConstKernel.h:106
ConstKernel.h
shogun::CConstKernel::CConstKernel
CConstKernel()
Definition:
ConstKernel.cpp:21
float64_t
double float64_t
Definition:
common.h:60
shogun::CConstKernel::init
virtual bool init(CFeatures *l, CFeatures *r)
Definition:
ConstKernel.cpp:46
shogun::CKernel::init_normalizer
virtual bool init_normalizer()
Definition:
Kernel.cpp:151
shogun::MS_AVAILABLE
Definition:
SGObject.h:103
shogun
all of classes and functions are contained in the shogun namespace
Definition:
class_list.h:18
shogun::CFeatures
The class Features is the base class of all feature objects.
Definition:
Features.h:68
Features.h
common.h
shogun::CKernel
The Kernel base class.
Definition:
kernel/Kernel.h:156
shogun::CConstKernel::~CConstKernel
virtual ~CConstKernel()
Definition:
ConstKernel.cpp:42
SG_ADD
#define SG_ADD(...)
Definition:
SGObject.h:94
SHOGUN
Machine Learning Toolbox - Documentation