source: trunk/yat/classifier/KernelFunction.h @ 1580

Last change on this file since 1580 was 1487, checked in by Jari Häkkinen, 13 years ago

Addresses #436. GPL license copy reference should also be updated.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date ID
File size: 2.2 KB
Line 
1#ifndef _theplu_yat_classifier_kernel_function_
2#define _theplu_yat_classifier_kernel_function_
3
4// $Id$
5
6/*
7  Copyright (C) 2003 Peter Johansson
8  Copyright (C) 2004 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2005 Peter Johansson
10  Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson
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
28namespace theplu {
29namespace yat {
30namespace classifier {
31  class DataLookup1D;
32  class DataLookupWeighted1D;
33
34  ///
35  /// @brief Interface class calculating elements in Kernel.
36  ///
37  class KernelFunction
38  {
39   
40  public:
41    ///
42    /// Constructor
43    ///   
44    KernelFunction(void) {};
45
46    ///
47    /// Destructor
48    ///
49    virtual ~KernelFunction(void) {};
50   
51    ///
52    /// @return scalar product of two vector in feature space.
53    ///
54    virtual double operator()(const DataLookup1D&,
55                              const DataLookup1D&) const = 0; 
56   
57    ///
58    /// @return scalar product of two vector in feature space.
59    ///
60    virtual double operator()(const DataLookup1D&,
61                              const DataLookupWeighted1D&) const = 0; 
62   
63    ///
64    /// @return scalar product of two vector in feature space.
65    ///
66    inline double operator()(const DataLookupWeighted1D& vec_w,
67                             const DataLookup1D& vec) const 
68    { return this->operator()(vec,vec_w); } 
69   
70    ///
71    /// @return scalar product of two vector in feature space.
72    ///
73    virtual double operator()(const DataLookupWeighted1D&,
74                              const DataLookupWeighted1D&) const = 0; 
75   
76  }; // class KernelFunction
77
78}}} // of namespace classifier, yat, and theplu
79
80#endif
Note: See TracBrowser for help on using the repository browser.