source: trunk/lib/svm/Kernel_MEV.h @ 322

Last change on this file since 322 was 322, checked in by Peter, 18 years ago

made arguments const and added some doc

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1// $Id: Kernel_MEV.h 322 2005-05-26 20:50:05Z peter $
2
3#ifndef _theplu_svm_kernel_mev
4#define _theplu_svm_kernel_mev
5
6#include <c++_tools/gslapi/matrix.h>
7
8namespace theplu {
9namespace svm {
10
11  class KernelFunction;
12
13  ///
14  ///   @brief Memory Efficient Kernel
15  ///   Class taking care of the \f$NxN\f$ kernel matrix, where
16  ///   \f$N\f$ is number of samples. Type of Kernel is defined by a
17  ///   KernelFunction. This Memory Efficient Version (MEV) does not
18  ///   store the kernel matrix in memory, but calculates each element
19  ///   when it is needed. When memory allows do always use Kernel_SEV
20  ///   instead.
21  ///   
22  ///   @see also Kernel_SEV
23  ///
24  class Kernel_MEV
25  {
26   
27  public:
28   
29    Kernel_MEV();
30
31    ///
32    ///   Constructor taking the data matrix and KernelFunction as
33    ///   input.Each column in the data matrix corresponds to one
34    ///   sample. @note Can not handle NaNs.
35    ///
36    Kernel_MEV(const gslapi::matrix&, const KernelFunction&);
37   
38    ///
39    ///   @todo
40    ///   Constructor taking the \a data matrix, the KernelFunction and a
41    ///   \a weight matrix as input. Each column in the data matrix
42    ///   corresponds to one sample.
43    Kernel_MEV(const gslapi::matrix& data, const KernelFunction&, 
44               const gslapi::matrix& weight);
45
46    ///
47    ///   Destructor
48    ///
49    virtual ~Kernel_MEV(void);
50
51    ///
52    /// @return element at position (\a row, \a column) of the Kernel
53    /// matrix
54    ///
55    virtual double operator()(const size_t row,const size_t column) const;
56
57    ///
58    /// @brief number of samples
59    ///
60    inline size_t size(void) const { return data_.columns(); }
61   
62  protected:
63    const gslapi::matrix& data_;
64    const KernelFunction* kf_;
65
66  }; // class Kernel_MEV
67
68}} // of namespace svm and namespace theplu
69
70#endif
Note: See TracBrowser for help on using the repository browser.