yat
0.11.3pre
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
yat
classifier
Kernel.h
1
#ifndef _theplu_yat_classifier_kernel_
2
#define _theplu_yat_classifier_kernel_
3
4
// $Id: Kernel.h 2119 2009-12-12 23:11:43Z peter $
5
6
/*
7
Copyright (C) 2005 Jari Häkkinen, Peter Johansson
8
Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
9
Copyright (C) 2007 Jari Häkkinen, Peter Johansson
10
Copyright (C) 2008 Jari Häkkinen, Peter Johansson, Markus Ringnér
11
12
This file is part of the yat library, http://dev.thep.lu.se/yat
13
14
The yat library is free software; you can redistribute it and/or
15
modify it under the terms of the GNU General Public License as
16
published by the Free Software Foundation; either version 3 of the
17
License, or (at your option) any later version.
18
19
The yat library is distributed in the hope that it will be useful,
20
but WITHOUT ANY WARRANTY; without even the implied warranty of
21
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
General Public License for more details.
23
24
You should have received a copy of the GNU General Public License
25
along with yat. If not, see <http://www.gnu.org/licenses/>.
26
*/
27
28
#include "KernelFunction.h"
29
30
#include <cstddef>
31
#include <vector>
32
33
namespace
theplu {
34
namespace
yat {
35
namespace
classifier {
36
37
class
MatrixLookup;
38
class
MatrixLookupWeighted;
39
57
class
Kernel
58
{
59
60
public
:
61
72
Kernel
(
const
MatrixLookup
&
data
,
const
KernelFunction
& kf,
73
const
bool
own=
false
);
74
83
Kernel
(
const
MatrixLookupWeighted
& data,
const
KernelFunction
& kf,
84
const
bool
own=
false
);
85
90
Kernel
(
const
Kernel
& kernel,
const
std::vector<size_t>& index);
91
98
virtual
~Kernel
(
void
);
99
104
virtual
double
operator()
(
const
size_t
row,
const
size_t
column)
const
=0;
105
111
const
MatrixLookup
&
data
(
void
)
const
;
112
118
const
MatrixLookupWeighted
&
data_weighted
(
void
)
const
;
119
125
double
element
(
const
DataLookup1D
& vec,
const
size_t
i)
const
;
126
134
double
element
(
const
DataLookupWeighted1D
& vec,
const
size_t
i)
const
;
135
144
virtual
const
Kernel
*
make_kernel
(
const
MatrixLookup
&,
const
bool
)
const
=0;
145
146
155
virtual
const
Kernel
*
make_kernel
(
const
MatrixLookupWeighted
&,
156
const
bool
own=
false
)
const
=0;
157
158
162
size_t
size
(
void
)
const
;
163
167
bool
weighted
(
void
)
const
;
168
169
protected
:
171
const
MatrixLookup
*
ml_
;
173
const
MatrixLookupWeighted
*
mlw_
;
175
const
KernelFunction
*
kf_
;
176
181
unsigned
int
*
ref_count_
;
182
187
unsigned
int
*
ref_count_w_
;
188
189
private
:
193
Kernel
(
const
Kernel
&);
194
195
const
Kernel
& operator=(
const
Kernel
&);
196
197
};
// class Kernel
198
199
}}}
// of namespace classifier, yat, and theplu
200
201
#endif
Generated on Sat May 24 2014 03:33:04 for yat by
1.8.2