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
string
PolyMatchStringKernel.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) 1999-2009 Soeren Sonnenburg
8
* Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9
*/
10
11
#ifndef _POLYMATCHSTRINGKERNEL_H___
12
#define _POLYMATCHSTRINGKERNEL_H___
13
14
#include <
shogun/lib/common.h
>
15
#include <
shogun/kernel/string/StringKernel.h
>
16
17
namespace
shogun
18
{
36
class
CPolyMatchStringKernel
:
public
CStringKernel
<char>
37
{
38
public
:
40
CPolyMatchStringKernel
();
41
48
CPolyMatchStringKernel
(int32_t size, int32_t
degree
,
bool
inhomogene
);
49
57
CPolyMatchStringKernel
(
58
CStringFeatures<char>
* l,
CStringFeatures<char>
* r,
59
int32_t degree,
bool
inhomogene);
60
61
virtual
~CPolyMatchStringKernel
();
62
69
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r);
70
72
virtual
void
cleanup
();
73
78
virtual
EKernelType
get_kernel_type
()
79
{
80
return
K_POLYMATCH
;
81
}
82
87
virtual
const
char
*
get_name
()
const
{
return
"PolyMatchStringKernel"
; }
88
93
void
set_rescaling_enabled
(
bool
n)
94
{
95
rescaling
=n;
96
}
97
102
bool
get_rescaling_enabled
()
103
{
104
return
rescaling
;
105
}
106
107
protected
:
116
virtual
float64_t
compute
(int32_t idx_a, int32_t idx_b);
117
118
private
:
119
void
init();
120
121
protected
:
123
int32_t
degree
;
125
bool
inhomogene
;
127
bool
rescaling
;
128
};
129
}
130
#endif
/* _POLYMATCHSTRINGKERNEL_H___ */
SHOGUN
Machine Learning Toolbox - Documentation