source: trunk/lib/classifier/Kernel_SEV.h @ 555

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

inserted private operator=

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1// $Id: Kernel_SEV.h 555 2006-03-08 08:48:29Z peter $
2
3#ifndef _theplu_classifier_kernel_sev_
4#define _theplu_classifier_kernel_sev_
5
6#include <c++_tools/classifier/Kernel.h>
7#include <c++_tools/gslapi/matrix.h>
8
9
10namespace theplu {
11namespace classifier {
12
13  class DataLookup1D;
14  class KernelFunction;
15
16  ///
17  ///   @brief Speed Efficient Kernel
18  ///   Class taking care of the \f$NxN\f$ kernel matrix, where
19  ///   \f$N\f$ is number of samples. Type of Kernel is defined by a
20  ///   KernelFunction. This Speed Efficient Version (SEV) calculated
21  ///   the kernel matrix once and the kernel is stored in
22  ///   memory. When \f$N\f$ is large and the kernel matrix cannot be
23  ///   stored in memory, use Kernel_MEV instead.
24  ///   
25  ///   @see also Kernel_MEV
26  ///
27  class Kernel_SEV : public Kernel
28  {
29   
30  public:
31
32    ///
33    ///   Constructor taking the data matrix and KernelFunction as
34    ///   input. @note Can not handle NaNs. When dealing with missing values,
35    ///   use constructor taking a weight matrix.
36    Kernel_SEV(const MatrixLookup&, const KernelFunction&);
37   
38    ///
39    /// @todo doc
40    ///
41    Kernel_SEV(const Kernel_SEV& kernel, const std::vector<size_t>& index);
42
43    ///
44    /// @return element at position (\a row, \a column) in the Kernel
45    /// matrix
46    ///
47    inline double operator()(const size_t row,const size_t column) const
48    { return kernel_matrix_(row,column); }
49
50    ///
51    /// @return kernel element between data @a vec and training sample @a i
52    ///
53    double element(const DataLookup1D& vec, const size_t i) const;
54
55    ///
56    /// @todo doc
57    ///
58    double element(const DataLookup1D& vec, const DataLookup1D& w, 
59                   const size_t i) const;
60
61    ///
62    /// @todo doc
63    ///
64    const Kernel* selected(const std::vector<size_t>& index) const;
65
66    ///
67    /// @return false
68    ///
69    inline bool weighted(void) const { return false; }
70
71  private:
72    ///
73    /// Copy constructor (not implemented)
74    ///
75    Kernel_SEV(const Kernel_SEV&);
76    const Kernel_SEV& operator=(const Kernel_SEV&);
77
78    void build_kernel(void);
79
80    gslapi::matrix kernel_matrix_;
81
82  }; // class Kernel_SEV
83
84}} // of namespace classifier and namespace theplu
85
86#endif
Note: See TracBrowser for help on using the repository browser.