SHOGUN
v2.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
kernel
SphericalKernel.h
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
* Based on GaussianKernel, Written (W) 1999-2010 Soeren Sonnenburg
8
* Written (W) 2011 Shashwat Lal Das
9
* Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
10
*/
11
12
#include <
shogun/lib/config.h
>
13
14
#ifndef _SPHERICALKERNEL_H__
15
#define _SPHERICALKERNEL_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
24
class
CDistance;
25
38
class
CSphericalKernel
:
public
CKernel
39
{
40
public
:
42
CSphericalKernel
();
43
50
CSphericalKernel
(int32_t size,
float64_t
sigma
,
CDistance
* dist);
51
59
CSphericalKernel
(
CFeatures
*l,
CFeatures
*r,
float64_t
sigma,
CDistance
* dist);
60
67
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r);
68
69
void
init
();
70
74
inline
virtual
EKernelType
get_kernel_type
() {
return
K_SPHERICAL
; }
75
79
inline
virtual
EFeatureType
get_feature_type
() {
return
distance
->
get_feature_type
(); }
80
84
inline
virtual
EFeatureClass
get_feature_class
() {
return
distance
->
get_feature_class
(); }
85
89
inline
virtual
const
char
*
get_name
()
const
{
return
"SphericalKernel"
; }
90
95
inline
virtual
void
set_sigma
(
float64_t
s)
96
{
97
sigma=s;
98
}
99
104
inline
virtual
float64_t
get_sigma
()
const
105
{
106
return
sigma
;
107
}
108
109
virtual
~CSphericalKernel
();
110
protected
:
111
113
CDistance
*
distance
;
114
116
float64_t
sigma
;
117
127
virtual
float64_t
compute
(int32_t idx_a, int32_t idx_b);
128
};
129
}
130
131
#endif
/* _SPHERICALKERNEL_H__ */
SHOGUN
Machine Learning Toolbox - Documentation