source: trunk/lib/classifier/Kernel.h @ 451

Last change on this file since 451 was 451, checked in by Peter, 16 years ago

directory svm -> classifier

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1// $Id: Kernel.h 451 2005-12-15 21:09:12Z peter $
2
3#ifndef _theplu_classifier_kernel_
4#define _theplu_classifier_kernel_
5
6#include <cctype>
7
8namespace theplu {
9
10namespace gslapi {
11  class matrix;
12}
13
14namespace classifier {
15
16  class KernelFunction;
17
18  ///
19  ///   @brief Base Class for Kernels.
20  ///
21  ///   Class taking care of the \f$NxN\f$ kernel matrix, where
22  ///   \f$N\f$ is number of samples. Each element in the Kernel
23  ///   matrix is the scalar product of the corresponding pair of
24  ///   samples. Type of Kernel is defined by a KernelFunction.
25  ///   
26  ///   @note If the KernelFunction is destroyed, the Kernel is no
27  ///   longer defined.
28  ///
29  class Kernel
30  {
31   
32  public:
33
34    ///
35    /// Default constructor
36    ///
37    Kernel(void) {};
38
39    ///
40    /// Copy constructor (not implemented)
41    ///
42    Kernel(const Kernel&);
43
44    ///
45    ///   Constructor taking the data matrix and KernelFunction as
46    ///   input.Each column in the data matrix corresponds to one
47    ///   sample. @note Can not handle NaNs.
48    ///
49    Kernel(const gslapi::matrix&, const KernelFunction&) {};
50   
51    ///
52    ///   Destructor
53    ///
54    virtual ~Kernel(void) {};
55
56    ///
57    /// @return element at position (\a row, \a column) of the Kernel
58    /// matrix
59    ///
60    virtual double operator()(const size_t row,const size_t column) const=0;
61
62    ///
63    /// @brief number of samples
64    ///
65    virtual size_t size(void) const=0;
66   
67  protected:
68
69  }; // class Kernel
70
71}} // of namespace classifier and namespace theplu
72
73#endif
Note: See TracBrowser for help on using the repository browser.