SHOGUN
v3.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
RationalQuadraticKernel.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
* Written (W) 2011 RafaĆ Surowiecki
8
* Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
9
*/
10
11
#include <
shogun/lib/config.h
>
12
13
#ifndef RATIONAL_QUADRATIC_KERNEL_H_
14
#define RATIONAL_QUADRATIC_KERNEL_H_
15
16
#include <
shogun/lib/common.h
>
17
#include <
shogun/kernel/Kernel.h
>
18
#include <
shogun/distance/Distance.h
>
19
20
namespace
shogun
21
{
22
23
class
CDistance;
24
35
class
CRationalQuadraticKernel
:
public
CKernel
36
{
37
public
:
39
CRationalQuadraticKernel
();
40
46
CRationalQuadraticKernel
(int32_t cache,
float64_t
coef,
CDistance
* dist);
47
54
CRationalQuadraticKernel
(
CFeatures
*l,
CFeatures
*r,
float64_t
c,
CDistance
* dist);
55
61
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r);
62
66
virtual
EKernelType
get_kernel_type
() {
return
K_RATIONAL_QUADRATIC
; }
67
71
virtual
EFeatureType
get_feature_type
() {
return
m_distance
->
get_feature_type
(); }
72
76
virtual
EFeatureClass
get_feature_class
() {
return
m_distance
->
get_feature_class
(); }
77
81
virtual
const
char
*
get_name
()
const
{
return
"RationalQuadraticKernel"
; }
82
86
virtual
const
float64_t
get_coef
()
const
{
return
m_coef
; }
87
91
inline
void
set_coef
(
float64_t
coef) {
m_coef
=coef; }
92
93
virtual
~CRationalQuadraticKernel
();
94
protected
:
102
virtual
float64_t
compute
(int32_t idx_a, int32_t idx_b);
103
104
private
:
106
void
init();
107
108
protected
:
110
CDistance
*
m_distance
;
111
113
float64_t
m_coef
;
114
};
115
}
116
117
#endif
/* RATIONAL_QUADRATIC_KERNEL_H_ */
SHOGUN
Machine Learning Toolbox - Documentation