source: trunk/lib/classifier/KernelView.h @ 461

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

?

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1// $Id: KernelView.h 461 2005-12-16 15:34:37Z peter $
2
3#ifndef _theplu_classifier_kernel_view_
4#define _theplu_classifier_kernel_view_
5
6#include <c++_tools/classifier/Kernel.h>
7#include <c++_tools/classifier/MatrixView.h>
8#include <vector>
9
10namespace theplu {
11namespace classifier {
12
13  class KernelFunction;
14
15  ///
16  ///   @brief View into sub Kernel
17  ///
18  class KernelView : public MatrixView
19  {
20   
21  public:
22   
23    ///
24    /// Contructor taking the Kernel to view into, row index vector,
25    /// and column vector.
26    ///
27    /// @note For training usage row index shall always be equal to
28    /// column index.
29    ///
30    KernelView(const Kernel& kernel, const std::vector<size_t>& row, 
31               const std::vector<size_t>& column);
32   
33    ///
34    /// Copy constructor
35    ///
36    KernelView(const KernelView&);
37
38    ///
39    /// @return element at position (\a row, \a column) in the Kernel
40    /// matrix
41    ///
42    inline double operator()(const size_t row,const size_t column) const
43    { return (*kernel_)(row_index_[row],column_index_[column]); }
44
45   
46
47  private:
48    ///
49    /// Default constructor. Not implemented.
50    ///
51    KernelView(void);
52
53    const Kernel* kernel_;
54
55  }; // class KernelView
56
57}} // of namespace classifier and namespace theplu
58
59#endif
Note: See TracBrowser for help on using the repository browser.