source: branches/peters_vector/lib/classifier/MatrixLookup.h @ 470

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

compiling 3 tests fail

File size: 1.6 KB
Line 
1// $Id$
2
3#ifndef _theplu_classifier_matrix_lookup_
4#define _theplu_classifier_matrix_lookup_
5
6#include <c++_tools/classifier/DataLookup2D.h>
7#include <c++_tools/gslapi/matrix.h>
8
9
10namespace theplu {
11namespace classifier { 
12
13 
14
15  ///
16  /// Interface class for classifier data
17  ///
18
19  class MatrixLookup : public DataLookup2D
20  {
21 
22  public:
23
24
25    ///
26    /// Constructor
27    ///
28    MatrixLookup(const gslapi::matrix&);
29
30    ///
31    /// Constructor taking the row index vector and column index vector
32    /// as input.
33    ///
34    MatrixLookup(const gslapi::matrix&, const std::vector<size_t>&, 
35             const std::vector<size_t>&);
36
37    ///
38    /// Constructor taking the column (default) or row index vector
39    /// as input.
40    ///
41    MatrixLookup(const gslapi::matrix&, const std::vector<size_t>&, 
42             bool row=false);
43
44    ///
45    /// Copy constructor.
46    ///
47    MatrixLookup(const MatrixLookup&);
48
49    ///
50    /// Constructor taking the row index vector and column index vector
51    /// as input.
52    ///
53    MatrixLookup(const MatrixLookup&, const std::vector<size_t>&, 
54             const std::vector<size_t>&);
55
56    ///
57    /// Constructor taking the column (default) or row index vector
58    /// as input.
59    ///
60    MatrixLookup(const MatrixLookup&, const std::vector<size_t>&, const bool row=false);
61
62    ///
63    /// Destructor
64    ///
65    ~MatrixLookup() {};
66
67   
68    inline double operator()(const size_t row, const size_t column) const
69    { return (*data_)(row_index_[row], column_index_[column]); }
70
71  private:
72    const gslapi::matrix* data_;
73  }; 
74 
75}} // of namespace classifier and namespace theplu
76
77#endif
Note: See TracBrowser for help on using the repository browser.