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

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

fixed bug in KernelView? constructor and updated tests

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1// $Id: KernelView.h 463 2005-12-16 17:59:15Z 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    /// Constructor
25    ///
26    KernelView(const Kernel&);
27
28    ///
29    /// Contructor taking the Kernel to view into, index
30    /// vector. Equivalent to KernelView(kernel, index, index).
31    ///
32    /// @note For training usage row index shall always be equal to
33    /// column index.
34    ///
35    KernelView(const Kernel& kernel, const std::vector<size_t>& index); 
36   
37    ///
38    /// Contructor taking the Kernel to view into, row index vector,
39    /// and column index vector.
40    ///
41    /// @note For training usage row index shall always be equal to
42    /// column index.
43    ///
44    KernelView(const Kernel& kernel, const std::vector<size_t>& row, 
45               const std::vector<size_t>& column);
46   
47    ///
48    /// Copy constructor
49    ///
50    KernelView(const KernelView&);
51
52    ///
53    /// @return element at position (\a row, \a column) in the Kernel
54    /// matrix
55    ///
56    inline double operator()(const size_t row,const size_t column) const
57    { return (*kernel_)(row_index_[row],column_index_[column]); }
58
59   
60
61  private:
62    ///
63    /// Default constructor. Not implemented.
64    ///
65    KernelView(void);
66
67    const Kernel* kernel_;
68
69  }; // class KernelView
70
71}} // of namespace classifier and namespace theplu
72
73#endif
Note: See TracBrowser for help on using the repository browser.