Last change
on this file since 469 was
469,
checked in by Peter, 17 years ago
|
non compiling checking before revision after design meeting
|
File size:
1.5 KB
|
Line | |
---|
1 | // $Id$ |
---|
2 | |
---|
3 | #ifndef _theplu_classifier_matrixview_ |
---|
4 | #define _theplu_classifier_matrixview_ |
---|
5 | |
---|
6 | #include <vector> |
---|
7 | |
---|
8 | namespace theplu { |
---|
9 | namespace classifier { |
---|
10 | |
---|
11 | /// |
---|
12 | /// Interface class for classifier data |
---|
13 | /// |
---|
14 | |
---|
15 | class MatrixView |
---|
16 | { |
---|
17 | |
---|
18 | public: |
---|
19 | |
---|
20 | /// |
---|
21 | /// Constructor taking the row index vector and column index vector |
---|
22 | /// as input. |
---|
23 | /// |
---|
24 | MatrixView(const std::vector<size_t>&, const std::vector<size_t>&); |
---|
25 | |
---|
26 | /// |
---|
27 | /// Constructor taking the row index vector or |
---|
28 | /// column index vector (default) |
---|
29 | /// |
---|
30 | MatrixView(const std::vector<size_t>&, bool row=false); |
---|
31 | |
---|
32 | |
---|
33 | /// |
---|
34 | /// Copy constructor. |
---|
35 | /// |
---|
36 | MatrixView(const MatrixView&); |
---|
37 | |
---|
38 | /// |
---|
39 | /// |
---|
40 | /// |
---|
41 | MatrixView(const MatrixView&, const std::vector<size_t>& row, |
---|
42 | const std::vector<size_t>& col); |
---|
43 | |
---|
44 | /// |
---|
45 | /// |
---|
46 | /// |
---|
47 | MatrixView(const MatrixView&, const std::vector<size_t>& index, |
---|
48 | const bool row); |
---|
49 | |
---|
50 | |
---|
51 | /// |
---|
52 | /// Destructor |
---|
53 | /// |
---|
54 | virtual ~MatrixView() {}; |
---|
55 | |
---|
56 | /// |
---|
57 | /// @return number of columns |
---|
58 | /// |
---|
59 | inline size_t columns(void) const { return column_index_.size(); } |
---|
60 | |
---|
61 | /// |
---|
62 | /// @return number of rows |
---|
63 | /// |
---|
64 | inline size_t rows(void) const { return row_index_.size(); } |
---|
65 | |
---|
66 | /// |
---|
67 | /// @return |
---|
68 | /// |
---|
69 | virtual double operator()(const size_t row, const size_t column) const=0; |
---|
70 | |
---|
71 | protected: |
---|
72 | std::vector<size_t> row_index_; |
---|
73 | std::vector<size_t> column_index_; |
---|
74 | |
---|
75 | /// |
---|
76 | /// Default constructor. |
---|
77 | /// |
---|
78 | MatrixView() {}; |
---|
79 | |
---|
80 | }; |
---|
81 | |
---|
82 | }} // of namespace classifier and namespace theplu |
---|
83 | |
---|
84 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.