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
string
LinearStringKernel.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 _LINEARSTRINGKERNEL_H___
12
#define _LINEARSTRINGKERNEL_H___
13
14
#include <
shogun/lib/common.h
>
15
#include <
shogun/kernel/string/StringKernel.h
>
16
17
namespace
shogun
18
{
29
class
CLinearStringKernel
:
public
CStringKernel
<char>
30
{
31
public
:
34
CLinearStringKernel
();
35
41
CLinearStringKernel
(
CStringFeatures<char>
* l,
CStringFeatures<char>
* r);
42
43
virtual
~CLinearStringKernel
();
44
51
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r);
52
54
virtual
void
cleanup
();
55
60
virtual
EKernelType
get_kernel_type
()
61
{
62
return
K_LINEAR
;
63
}
64
69
virtual
const
char
*
get_name
()
const
{
return
"LinearStringKernel"
; }
70
79
virtual
bool
init_optimization
(
80
int32_t num_suppvec, int32_t* sv_idx,
float64_t
* alphas);
81
86
virtual
bool
delete_optimization
();
87
93
virtual
float64_t
compute_optimized
(int32_t idx);
94
96
virtual
void
clear_normal
();
97
103
virtual
void
add_to_normal
(int32_t idx,
float64_t
weight);
104
105
protected
:
114
virtual
float64_t
compute
(int32_t idx_a, int32_t idx_b);
115
116
protected
:
118
float64_t
*
normal
;
119
};
120
}
121
#endif
/* _LINEARSTRINGKERNEL_H___ */
SHOGUN
Machine Learning Toolbox - Documentation