680 |
11 Oct 06 |
jari |
1 |
#ifndef _theplu_yat_classifier_kernel_function_ |
680 |
11 Oct 06 |
jari |
2 |
#define _theplu_yat_classifier_kernel_function_ |
25 |
06 Aug 03 |
peter |
3 |
|
675 |
10 Oct 06 |
jari |
// $Id$ |
675 |
10 Oct 06 |
jari |
5 |
|
675 |
10 Oct 06 |
jari |
6 |
/* |
831 |
27 Mar 07 |
peter |
Copyright (C) 2003 Peter Johansson |
2119 |
12 Dec 09 |
peter |
Copyright (C) 2004 Jari Häkkinen, Peter Johansson |
831 |
27 Mar 07 |
peter |
Copyright (C) 2005 Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2006 Jari Häkkinen, Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2007 Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
675 |
10 Oct 06 |
jari |
13 |
|
1437 |
25 Aug 08 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
675 |
10 Oct 06 |
jari |
15 |
|
675 |
10 Oct 06 |
jari |
The yat library is free software; you can redistribute it and/or |
675 |
10 Oct 06 |
jari |
modify it under the terms of the GNU General Public License as |
1486 |
09 Sep 08 |
jari |
published by the Free Software Foundation; either version 3 of the |
675 |
10 Oct 06 |
jari |
License, or (at your option) any later version. |
675 |
10 Oct 06 |
jari |
20 |
|
675 |
10 Oct 06 |
jari |
The yat library is distributed in the hope that it will be useful, |
675 |
10 Oct 06 |
jari |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
675 |
10 Oct 06 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
675 |
10 Oct 06 |
jari |
General Public License for more details. |
675 |
10 Oct 06 |
jari |
25 |
|
675 |
10 Oct 06 |
jari |
You should have received a copy of the GNU General Public License |
1487 |
10 Sep 08 |
jari |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
675 |
10 Oct 06 |
jari |
28 |
*/ |
675 |
10 Oct 06 |
jari |
29 |
|
42 |
26 Feb 04 |
jari |
30 |
namespace theplu { |
680 |
11 Oct 06 |
jari |
31 |
namespace yat { |
450 |
15 Dec 05 |
peter |
32 |
namespace classifier { |
527 |
01 Mar 06 |
peter |
33 |
class DataLookup1D; |
627 |
05 Sep 06 |
peter |
34 |
class DataLookupWeighted1D; |
42 |
26 Feb 04 |
jari |
35 |
|
99 |
10 Jun 04 |
peter |
36 |
/// |
767 |
22 Feb 07 |
peter |
/// @brief Interface class calculating elements in Kernel. |
99 |
10 Jun 04 |
peter |
38 |
/// |
4200 |
19 Aug 22 |
peter |
39 |
class KernelFunction |
25 |
06 Aug 03 |
peter |
40 |
{ |
4200 |
19 Aug 22 |
peter |
41 |
|
25 |
06 Aug 03 |
peter |
42 |
public: |
99 |
10 Jun 04 |
peter |
43 |
/// |
99 |
10 Jun 04 |
peter |
/// Constructor |
4200 |
19 Aug 22 |
peter |
45 |
/// |
99 |
10 Jun 04 |
peter |
46 |
KernelFunction(void) {}; |
99 |
10 Jun 04 |
peter |
47 |
|
99 |
10 Jun 04 |
peter |
48 |
/// |
99 |
10 Jun 04 |
peter |
/// Destructor |
99 |
10 Jun 04 |
peter |
50 |
/// |
33 |
22 Jan 04 |
peter |
51 |
virtual ~KernelFunction(void) {}; |
4200 |
19 Aug 22 |
peter |
52 |
|
295 |
29 Apr 05 |
peter |
53 |
/// |
295 |
29 Apr 05 |
peter |
/// @return scalar product of two vector in feature space. |
295 |
29 Apr 05 |
peter |
55 |
/// |
527 |
01 Mar 06 |
peter |
56 |
virtual double operator()(const DataLookup1D&, |
4200 |
19 Aug 22 |
peter |
57 |
const DataLookup1D&) const = 0; |
4200 |
19 Aug 22 |
peter |
58 |
|
295 |
29 Apr 05 |
peter |
59 |
/// |
295 |
29 Apr 05 |
peter |
/// @return scalar product of two vector in feature space. |
295 |
29 Apr 05 |
peter |
61 |
/// |
627 |
05 Sep 06 |
peter |
62 |
virtual double operator()(const DataLookup1D&, |
4200 |
19 Aug 22 |
peter |
63 |
const DataLookupWeighted1D&) const = 0; |
4200 |
19 Aug 22 |
peter |
64 |
|
627 |
05 Sep 06 |
peter |
65 |
/// |
627 |
05 Sep 06 |
peter |
/// @return scalar product of two vector in feature space. |
627 |
05 Sep 06 |
peter |
67 |
/// |
627 |
05 Sep 06 |
peter |
68 |
inline double operator()(const DataLookupWeighted1D& vec_w, |
4200 |
19 Aug 22 |
peter |
69 |
const DataLookup1D& vec) const |
4200 |
19 Aug 22 |
peter |
70 |
{ return this->operator()(vec,vec_w); } |
4200 |
19 Aug 22 |
peter |
71 |
|
627 |
05 Sep 06 |
peter |
72 |
/// |
627 |
05 Sep 06 |
peter |
/// @return scalar product of two vector in feature space. |
627 |
05 Sep 06 |
peter |
74 |
/// |
627 |
05 Sep 06 |
peter |
75 |
virtual double operator()(const DataLookupWeighted1D&, |
4200 |
19 Aug 22 |
peter |
76 |
const DataLookupWeighted1D&) const = 0; |
4200 |
19 Aug 22 |
peter |
77 |
|
163 |
22 Sep 04 |
peter |
78 |
}; // class KernelFunction |
25 |
06 Aug 03 |
peter |
79 |
|
680 |
11 Oct 06 |
jari |
80 |
}}} // of namespace classifier, yat, and theplu |
25 |
06 Aug 03 |
peter |
81 |
|
25 |
06 Aug 03 |
peter |
82 |
#endif |