2863 |
03 Oct 12 |
peter |
1 |
#ifndef _theplu_yat_classifier_matrix_lookup_ |
2863 |
03 Oct 12 |
peter |
2 |
#define _theplu_yat_classifier_matrix_lookup_ |
455 |
16 Dec 05 |
markus |
3 |
|
616 |
31 Aug 06 |
jari |
// $Id$ |
616 |
31 Aug 06 |
jari |
5 |
|
675 |
10 Oct 06 |
jari |
6 |
/* |
2119 |
12 Dec 09 |
peter |
Copyright (C) 2005 Peter Johansson, Markus Ringnér |
2119 |
12 Dec 09 |
peter |
Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér |
2119 |
12 Dec 09 |
peter |
Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson |
4207 |
26 Aug 22 |
peter |
Copyright (C) 2009, 2010, 2012, 2020, 2022 Peter Johansson |
455 |
16 Dec 05 |
markus |
11 |
|
1437 |
25 Aug 08 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
675 |
10 Oct 06 |
jari |
13 |
|
675 |
10 Oct 06 |
jari |
The yat library is free software; you can redistribute it and/or |
675 |
10 Oct 06 |
jari |
modify it under the terms of the GNU General Public License as |
1486 |
09 Sep 08 |
jari |
published by the Free Software Foundation; either version 3 of the |
675 |
10 Oct 06 |
jari |
License, or (at your option) any later version. |
675 |
10 Oct 06 |
jari |
18 |
|
675 |
10 Oct 06 |
jari |
The yat library is distributed in the hope that it will be useful, |
675 |
10 Oct 06 |
jari |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
675 |
10 Oct 06 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
675 |
10 Oct 06 |
jari |
General Public License for more details. |
675 |
10 Oct 06 |
jari |
23 |
|
675 |
10 Oct 06 |
jari |
You should have received a copy of the GNU General Public License |
1487 |
10 Sep 08 |
jari |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
675 |
10 Oct 06 |
jari |
26 |
*/ |
675 |
10 Oct 06 |
jari |
27 |
|
1110 |
19 Feb 08 |
peter |
28 |
#include "yat/utility/Container2DIterator.h" |
2223 |
19 Mar 10 |
peter |
29 |
#include "yat/utility/deprecate.h" |
1134 |
23 Feb 08 |
peter |
30 |
#include "yat/utility/Index.h" |
1080 |
13 Feb 08 |
peter |
31 |
#include "yat/utility/iterator_traits.h" |
1528 |
24 Sep 08 |
peter |
32 |
#include "yat/utility/Matrix.h" |
675 |
10 Oct 06 |
jari |
33 |
|
1528 |
24 Sep 08 |
peter |
34 |
#include <boost/iterator/permutation_iterator.hpp> |
1528 |
24 Sep 08 |
peter |
35 |
|
2076 |
06 Oct 09 |
peter |
36 |
#include <iosfwd> |
4019 |
06 Nov 20 |
peter |
37 |
#include <memory> |
757 |
19 Feb 07 |
jari |
38 |
#include <vector> |
455 |
16 Dec 05 |
markus |
39 |
|
455 |
16 Dec 05 |
markus |
40 |
namespace theplu { |
680 |
11 Oct 06 |
jari |
41 |
namespace yat { |
2863 |
03 Oct 12 |
peter |
42 |
namespace classifier { |
455 |
16 Dec 05 |
markus |
43 |
|
455 |
16 Dec 05 |
markus |
44 |
/// |
1192 |
29 Feb 08 |
peter |
/// @brief General view into utility::Matrix |
767 |
22 Feb 07 |
peter |
46 |
/// |
590 |
24 Aug 06 |
peter |
/// MatrixLookups can be used to create lookups/views into matrices |
590 |
24 Aug 06 |
peter |
/// in a more general way than the views supported in the matrix |
590 |
24 Aug 06 |
peter |
/// class. The object does not contain any data, but only a pointer |
1191 |
29 Feb 08 |
peter |
/// to a utility::Matrix and row and columns incices defining which |
590 |
24 Aug 06 |
peter |
/// sub-matrix to look into. Each row and each column corresponds |
1191 |
29 Feb 08 |
peter |
/// to a row and a column in the utility::Matrix, respectively. This design |
590 |
24 Aug 06 |
peter |
/// allow for fast creation of sub-matrices, which is a common |
826 |
19 Mar 07 |
peter |
/// operation in most traning/validation procedures. The views are |
826 |
19 Mar 07 |
peter |
/// const views in the sense that they cannot modify underlying |
1191 |
29 Feb 08 |
peter |
/// utility::Matrix. |
455 |
16 Dec 05 |
markus |
57 |
/// |
2863 |
03 Oct 12 |
peter |
/// A MatrixLookup can be created directly from a utility::Matrix or from |
1191 |
29 Feb 08 |
peter |
/// another MatrixLookup. In the latter case, the resulting |
1191 |
29 Feb 08 |
peter |
/// MatrixLookup is looking directly into the underlying utility::Matrix to |
590 |
24 Aug 06 |
peter |
/// avoid multiple lookups. |
590 |
24 Aug 06 |
peter |
62 |
/// |
590 |
24 Aug 06 |
peter |
/// There is a possibility to set the MatrixLookup as owner of the |
1191 |
29 Feb 08 |
peter |
/// underlying utility::Matrix. This implies that underlying data is deleted |
826 |
19 Mar 07 |
peter |
/// in destructor of MatrixLookup, but only if there is no other |
2863 |
03 Oct 12 |
peter |
/// owner of the underlying data. |
590 |
24 Aug 06 |
peter |
67 |
/// |
1192 |
29 Feb 08 |
peter |
/// \see MatrixLookupWeighted |
1192 |
29 Feb 08 |
peter |
69 |
/// |
1170 |
27 Feb 08 |
peter |
70 |
class MatrixLookup |
455 |
16 Dec 05 |
markus |
71 |
{ |
1063 |
10 Feb 08 |
peter |
72 |
public: |
1549 |
06 Oct 08 |
peter |
73 |
/** |
1549 |
06 Oct 08 |
peter |
value_type is double |
1549 |
06 Oct 08 |
peter |
75 |
|
1549 |
06 Oct 08 |
peter |
\since New in yat 0.5 |
1549 |
06 Oct 08 |
peter |
77 |
*/ |
1549 |
06 Oct 08 |
peter |
78 |
typedef utility::Matrix::value_type value_type; |
1549 |
06 Oct 08 |
peter |
79 |
|
1549 |
06 Oct 08 |
peter |
80 |
/** |
1549 |
06 Oct 08 |
peter |
const_reference type is const double& |
1549 |
06 Oct 08 |
peter |
82 |
|
1549 |
06 Oct 08 |
peter |
\since New in yat 0.5 |
1549 |
06 Oct 08 |
peter |
84 |
*/ |
1549 |
06 Oct 08 |
peter |
85 |
typedef utility::Matrix::const_reference const_reference; |
1549 |
06 Oct 08 |
peter |
86 |
|
1063 |
10 Feb 08 |
peter |
/// 'Read Only' iterator |
2863 |
03 Oct 12 |
peter |
88 |
typedef utility::Container2DIterator<const MatrixLookup, const double, |
1565 |
10 Oct 08 |
peter |
89 |
const_reference> |
1063 |
10 Feb 08 |
peter |
90 |
const_iterator; |
1062 |
10 Feb 08 |
peter |
91 |
|
1125 |
22 Feb 08 |
peter |
92 |
/** |
1125 |
22 Feb 08 |
peter |
'Read only' iterator used to iterate over a column |
1125 |
22 Feb 08 |
peter |
94 |
*/ |
1528 |
24 Sep 08 |
peter |
95 |
typedef boost::permutation_iterator<utility::Matrix::const_column_iterator, |
2863 |
03 Oct 12 |
peter |
96 |
utility::Index::const_iterator> |
1528 |
24 Sep 08 |
peter |
97 |
const_column_iterator; |
1125 |
22 Feb 08 |
peter |
98 |
|
1125 |
22 Feb 08 |
peter |
99 |
/** |
1125 |
22 Feb 08 |
peter |
'Read only' iterator used to iterate over a row |
1125 |
22 Feb 08 |
peter |
101 |
*/ |
1528 |
24 Sep 08 |
peter |
102 |
typedef const_column_iterator const_row_iterator; |
1104 |
18 Feb 08 |
peter |
103 |
|
455 |
16 Dec 05 |
markus |
104 |
/// |
2863 |
03 Oct 12 |
peter |
/// Constructor creating a lookup into the entire @a matrix. |
966 |
11 Oct 07 |
peter |
/// \param matrix underlying matrix |
658 |
25 Sep 06 |
peter |
/// @param own if true MatrixLookup owns its underlying @a matrix |
455 |
16 Dec 05 |
markus |
108 |
/// |
826 |
19 Mar 07 |
peter |
/// @note If \a own is true and \a matrix is already owned by some |
826 |
19 Mar 07 |
peter |
/// other object, this will lead to \a matrix having multiple |
826 |
19 Mar 07 |
peter |
/// owners without the owners being aware of each |
2863 |
03 Oct 12 |
peter |
/// other. Consequently multiple deletion will occur. |
826 |
19 Mar 07 |
peter |
113 |
/// |
536 |
03 Mar 06 |
peter |
/// @note If @a matrix goes out of scope or is deleted, the |
536 |
03 Mar 06 |
peter |
/// MatrixLookup becomes invalid and the result of further use is |
536 |
03 Mar 06 |
peter |
/// undefined. |
536 |
03 Mar 06 |
peter |
117 |
/// |
4125 |
14 Jan 22 |
peter |
118 |
MatrixLookup(const utility::MatrixBase& matrix, const bool own=false); |
455 |
16 Dec 05 |
markus |
119 |
|
590 |
24 Aug 06 |
peter |
120 |
/// |
590 |
24 Aug 06 |
peter |
/// Constructor creating a lookup into a sub-matrix of @a matrix. |
590 |
24 Aug 06 |
peter |
/// The @a row and @a column define what sub-matrix to look into, |
590 |
24 Aug 06 |
peter |
/// in other words, the created MatrixLookup will fullfill the |
590 |
24 Aug 06 |
peter |
/// following: \f$ MatrixLookup(i,j)=matrix(row[i],column[j]) |
590 |
24 Aug 06 |
peter |
/// \f$. This also means that number of rows in created |
590 |
24 Aug 06 |
peter |
/// MatrixLookup is equal to size of vector @a row, and number of |
590 |
24 Aug 06 |
peter |
/// columns is equal to size of vector @a column. |
590 |
24 Aug 06 |
peter |
128 |
/// |
536 |
03 Mar 06 |
peter |
/// @note If @a matrix goes out of scope or is deleted, the |
536 |
03 Mar 06 |
peter |
/// MatrixLookup becomes invalid and the result of further use is |
536 |
03 Mar 06 |
peter |
/// undefined. |
536 |
03 Mar 06 |
peter |
132 |
/// |
4125 |
14 Jan 22 |
peter |
133 |
MatrixLookup(const utility::MatrixBase& matrix, const utility::Index& row, |
1134 |
23 Feb 08 |
peter |
134 |
const utility::Index& column); |
455 |
16 Dec 05 |
markus |
135 |
|
533 |
03 Mar 06 |
peter |
136 |
/// |
648 |
14 Sep 06 |
peter |
/// Constructor creating a lookup into a sub-matrix of @a matrix. |
590 |
24 Aug 06 |
peter |
138 |
/// |
656 |
22 Sep 06 |
peter |
/// If @a row_vectors is true the new MatrixLookup will consist |
590 |
24 Aug 06 |
peter |
/// of the row vectors defined by @a index. This means that the |
590 |
24 Aug 06 |
peter |
/// created MatrixLookup will fullfill: |
590 |
24 Aug 06 |
peter |
/// \f$ MatrixLookup(i,j)=matrix(i,index[j]) \f$ |
590 |
24 Aug 06 |
peter |
143 |
/// |
590 |
24 Aug 06 |
peter |
/// If @a row_vectors is false the new MatrixLookup will be consist |
590 |
24 Aug 06 |
peter |
/// of the rolumn vectors defined by @a index. This means that the |
590 |
24 Aug 06 |
peter |
/// created MatrixLookup will fullfill: |
590 |
24 Aug 06 |
peter |
/// \f$ MatrixLookup(i,j)=matrix(index[i],j) \f$ |
590 |
24 Aug 06 |
peter |
148 |
/// |
536 |
03 Mar 06 |
peter |
/// @note If @a matrix goes out of scope or is deleted, the |
536 |
03 Mar 06 |
peter |
/// MatrixLookup becomes invalid and the result of further use is |
536 |
03 Mar 06 |
peter |
/// undefined. |
536 |
03 Mar 06 |
peter |
152 |
/// |
2374 |
12 Dec 10 |
peter |
/// \deprecated Provided for backward compatibility with |
2223 |
19 Mar 10 |
peter |
/// the 0.6 API. Use MatrixLookup(const utility::Matrix&, const |
2223 |
19 Mar 10 |
peter |
/// utility::Index&, const utility::Index&) |
2223 |
19 Mar 10 |
peter |
156 |
/// |
4125 |
14 Jan 22 |
peter |
157 |
MatrixLookup(const utility::MatrixBase& matrix, |
2863 |
03 Oct 12 |
peter |
158 |
const utility::Index& index, |
2223 |
19 Mar 10 |
peter |
159 |
const bool row_vectors) YAT_DEPRECATE; |
455 |
16 Dec 05 |
markus |
160 |
|
590 |
24 Aug 06 |
peter |
161 |
/// |
590 |
24 Aug 06 |
peter |
/// @brief Copy constructor. |
590 |
24 Aug 06 |
peter |
163 |
/// |
826 |
19 Mar 07 |
peter |
/// If \a other is owner of underlying data, constructed |
826 |
19 Mar 07 |
peter |
/// MatrixLookup will also be set as owner of underlying data. |
826 |
19 Mar 07 |
peter |
166 |
/// |
536 |
03 Mar 06 |
peter |
/// @note If underlying matrix goes out of scope or is deleted, the |
536 |
03 Mar 06 |
peter |
/// MatrixLookup becomes invalid and the result of further use is |
536 |
03 Mar 06 |
peter |
/// undefined. |
536 |
03 Mar 06 |
peter |
170 |
/// |
826 |
19 Mar 07 |
peter |
171 |
MatrixLookup(const MatrixLookup& other); |
455 |
16 Dec 05 |
markus |
172 |
|
590 |
24 Aug 06 |
peter |
173 |
/// |
2863 |
03 Oct 12 |
peter |
/// @brief Create a sub-MatrixLookup. |
826 |
19 Mar 07 |
peter |
175 |
/// |
826 |
19 Mar 07 |
peter |
/// The Lookup is independent of |
590 |
24 Aug 06 |
peter |
/// MatrixLookup @a ml. The MatrixLookup is created to look |
590 |
24 Aug 06 |
peter |
/// directly into the underlying matrix to avoid multiple lookups. |
590 |
24 Aug 06 |
peter |
179 |
/// |
826 |
19 Mar 07 |
peter |
/// If \a ml is owner of underlying data, constructed |
826 |
19 Mar 07 |
peter |
/// MatrixLookup will also be set as owner of underlying data. |
826 |
19 Mar 07 |
peter |
182 |
/// |
590 |
24 Aug 06 |
peter |
/// The @a row and @a column define what sub-matrix to look into, |
590 |
24 Aug 06 |
peter |
/// in other words, the created MatrixLookup will fullfill the |
826 |
19 Mar 07 |
peter |
/// following: MatrixLookup(i,j)=ml(row[i],column[j]). This |
590 |
24 Aug 06 |
peter |
/// also means that number of rows in created MatrixLookup is |
590 |
24 Aug 06 |
peter |
/// equal to size of vector @a row, and number of columns is equal |
590 |
24 Aug 06 |
peter |
/// to size of vector @a column. |
590 |
24 Aug 06 |
peter |
189 |
/// |
826 |
19 Mar 07 |
peter |
/// If \a ml is owner of underlying data, constructed |
826 |
19 Mar 07 |
peter |
/// MatrixLookup will also be set as owner of underlying data. |
826 |
19 Mar 07 |
peter |
192 |
/// |
536 |
03 Mar 06 |
peter |
/// @note If underlying matrix goes out of scope or is deleted, the |
536 |
03 Mar 06 |
peter |
/// MatrixLookup becomes invalid and the result of further use is |
536 |
03 Mar 06 |
peter |
/// undefined. |
536 |
03 Mar 06 |
peter |
196 |
/// |
2863 |
03 Oct 12 |
peter |
197 |
MatrixLookup(const MatrixLookup& ml, const utility::Index& row, |
1134 |
23 Feb 08 |
peter |
198 |
const utility::Index& column); |
469 |
19 Dec 05 |
peter |
199 |
|
590 |
24 Aug 06 |
peter |
200 |
/// |
590 |
24 Aug 06 |
peter |
/// Constructor creating a lookup into a sub-matrix of |
590 |
24 Aug 06 |
peter |
/// @a ml. The MatrixLookup is created to look directly into the |
590 |
24 Aug 06 |
peter |
/// underlying matrix to avoid multiple lookups. |
590 |
24 Aug 06 |
peter |
204 |
/// |
656 |
22 Sep 06 |
peter |
/// If @a row_vectors is true the new MatrixLookup will consist |
590 |
24 Aug 06 |
peter |
/// of the row vectors defined by @a index. This means that the |
590 |
24 Aug 06 |
peter |
/// created MatrixLookup will fullfill: |
826 |
19 Mar 07 |
peter |
/// MatrixLookup(i,j)=ml(i,index[j]) |
590 |
24 Aug 06 |
peter |
209 |
/// |
656 |
22 Sep 06 |
peter |
/// If @a row_vectors is false the new MatrixLookup will consist |
590 |
24 Aug 06 |
peter |
/// of the rolumn vectors defined by @a index. This means that the |
590 |
24 Aug 06 |
peter |
/// created MatrixLookup will fullfill: |
590 |
24 Aug 06 |
peter |
/// \f$ MatrixLookup(i,j) = ml(index[i],j) \f$ |
590 |
24 Aug 06 |
peter |
214 |
/// |
826 |
19 Mar 07 |
peter |
/// If \a ml is owner of underlying data, constructed |
826 |
19 Mar 07 |
peter |
/// MatrixLookup will also be set as owner of underlying data. |
826 |
19 Mar 07 |
peter |
217 |
/// |
536 |
03 Mar 06 |
peter |
/// @note If underlying matrix goes out of scope or is deleted, the |
536 |
03 Mar 06 |
peter |
/// MatrixLookup becomes invalid and the result of further use is |
536 |
03 Mar 06 |
peter |
/// undefined. |
536 |
03 Mar 06 |
peter |
221 |
/// |
2223 |
19 Mar 10 |
peter |
/// \deprecated Provided for backgroundColor compatibility with |
2223 |
19 Mar 10 |
peter |
/// the 0.6 API. Use MatrixLookup(const MatrixLookup&, const |
2223 |
19 Mar 10 |
peter |
/// utility::Index&, const utility::Index&) |
2223 |
19 Mar 10 |
peter |
225 |
/// |
2863 |
03 Oct 12 |
peter |
226 |
MatrixLookup(const MatrixLookup& ml, const utility::Index&, |
565 |
16 Mar 06 |
peter |
227 |
const bool row_vectors); |
469 |
19 Dec 05 |
peter |
228 |
|
455 |
16 Dec 05 |
markus |
229 |
/// |
537 |
05 Mar 06 |
peter |
/// Constructor creating a MatrixLookup with @a rows rows, @a |
537 |
05 Mar 06 |
peter |
/// columns columns, and all values are set to @a value. Created |
590 |
24 Aug 06 |
peter |
/// MatrixLookup owns its underlying matrix. |
537 |
05 Mar 06 |
peter |
233 |
/// |
537 |
05 Mar 06 |
peter |
234 |
MatrixLookup(const size_t rows, const size_t columns, const double value=0); |
537 |
05 Mar 06 |
peter |
235 |
|
537 |
05 Mar 06 |
peter |
236 |
/// |
590 |
24 Aug 06 |
peter |
/// @brief The istream constructor. |
455 |
16 Dec 05 |
markus |
238 |
/// |
2223 |
19 Mar 10 |
peter |
/// In construction the underlying utility::Matrix is created from |
2223 |
19 Mar 10 |
peter |
/// the stream using utility::Matrix(std::istream&). The |
2223 |
19 Mar 10 |
peter |
/// constructed MatrixLookup will be owner of the underlying |
590 |
24 Aug 06 |
peter |
/// matrix. |
590 |
24 Aug 06 |
peter |
243 |
/// |
2223 |
19 Mar 10 |
peter |
/// @see Matrix(istream&) for details. |
590 |
24 Aug 06 |
peter |
245 |
/// |
590 |
24 Aug 06 |
peter |
246 |
MatrixLookup(std::istream&, char sep='\0'); |
590 |
24 Aug 06 |
peter |
247 |
|
590 |
24 Aug 06 |
peter |
248 |
/// |
2863 |
03 Oct 12 |
peter |
/// @brief Destructor. |
590 |
24 Aug 06 |
peter |
250 |
/// |
826 |
19 Mar 07 |
peter |
/// If ownership is set true and there is no other owner of |
826 |
19 Mar 07 |
peter |
/// underlying data, underlying data is deleted. |
826 |
19 Mar 07 |
peter |
253 |
/// |
537 |
05 Mar 06 |
peter |
254 |
virtual ~MatrixLookup(); |
455 |
16 Dec 05 |
markus |
255 |
|
656 |
22 Sep 06 |
peter |
256 |
/** |
1066 |
10 Feb 08 |
peter |
Iterator iterates along a row. When end of row is reached it |
1066 |
10 Feb 08 |
peter |
jumps to beginning of next row. |
1066 |
10 Feb 08 |
peter |
259 |
|
1066 |
10 Feb 08 |
peter |
\return const_iterator pointing to upper-left element. |
1062 |
10 Feb 08 |
peter |
261 |
*/ |
1062 |
10 Feb 08 |
peter |
262 |
const_iterator begin(void) const; |
1063 |
10 Feb 08 |
peter |
263 |
|
1063 |
10 Feb 08 |
peter |
264 |
/** |
1066 |
10 Feb 08 |
peter |
Iterator iterates along a column. |
1066 |
10 Feb 08 |
peter |
266 |
|
1066 |
10 Feb 08 |
peter |
\return iterator pointing to first element of column \a i. |
1063 |
10 Feb 08 |
peter |
268 |
*/ |
1104 |
18 Feb 08 |
peter |
269 |
const_column_iterator begin_column(size_t) const; |
1062 |
10 Feb 08 |
peter |
270 |
|
1062 |
10 Feb 08 |
peter |
271 |
/** |
1066 |
10 Feb 08 |
peter |
Iterator iterates along a column. |
1066 |
10 Feb 08 |
peter |
273 |
|
1066 |
10 Feb 08 |
peter |
\return const_iterator pointing to first element of column \a i. |
1063 |
10 Feb 08 |
peter |
275 |
*/ |
1104 |
18 Feb 08 |
peter |
276 |
const_row_iterator begin_row(size_t) const; |
1063 |
10 Feb 08 |
peter |
277 |
|
1063 |
10 Feb 08 |
peter |
278 |
/** |
1170 |
27 Feb 08 |
peter |
\return number of columns |
1170 |
27 Feb 08 |
peter |
280 |
*/ |
1170 |
27 Feb 08 |
peter |
281 |
size_t columns(void) const; |
1170 |
27 Feb 08 |
peter |
282 |
|
1170 |
27 Feb 08 |
peter |
283 |
/** |
1066 |
10 Feb 08 |
peter |
\return const_iterator pointing to end of matrix |
1063 |
10 Feb 08 |
peter |
285 |
*/ |
1063 |
10 Feb 08 |
peter |
286 |
const_iterator end(void) const; |
1063 |
10 Feb 08 |
peter |
287 |
|
1063 |
10 Feb 08 |
peter |
288 |
/** |
1066 |
10 Feb 08 |
peter |
\return const_iterator pointing to end of column \a i |
1063 |
10 Feb 08 |
peter |
290 |
*/ |
1104 |
18 Feb 08 |
peter |
291 |
const_column_iterator end_column(size_t) const; |
1063 |
10 Feb 08 |
peter |
292 |
|
1063 |
10 Feb 08 |
peter |
293 |
/** |
1066 |
10 Feb 08 |
peter |
\return const_iterator pointing to end of row \a i |
1063 |
10 Feb 08 |
peter |
295 |
*/ |
1104 |
18 Feb 08 |
peter |
296 |
const_row_iterator end_row(size_t) const; |
1063 |
10 Feb 08 |
peter |
297 |
|
1170 |
27 Feb 08 |
peter |
298 |
/** |
1170 |
27 Feb 08 |
peter |
\return number of rows |
1170 |
27 Feb 08 |
peter |
300 |
*/ |
1170 |
27 Feb 08 |
peter |
301 |
size_t rows(void) const; |
1170 |
27 Feb 08 |
peter |
302 |
|
604 |
29 Aug 06 |
peter |
303 |
/// |
631 |
05 Sep 06 |
peter |
/// @return false |
631 |
05 Sep 06 |
peter |
305 |
/// |
631 |
05 Sep 06 |
peter |
306 |
bool weighted(void) const; |
631 |
05 Sep 06 |
peter |
307 |
|
631 |
05 Sep 06 |
peter |
308 |
/// |
482 |
02 Jan 06 |
peter |
/// Access operator |
482 |
02 Jan 06 |
peter |
310 |
/// |
2863 |
03 Oct 12 |
peter |
/// @return element |
482 |
02 Jan 06 |
peter |
312 |
/// |
1788 |
09 Feb 09 |
peter |
313 |
const_reference operator()(size_t row, size_t column) const; |
455 |
16 Dec 05 |
markus |
314 |
|
556 |
08 Mar 06 |
peter |
315 |
/// |
556 |
08 Mar 06 |
peter |
/// @brief assigment operator |
556 |
08 Mar 06 |
peter |
317 |
/// |
590 |
24 Aug 06 |
peter |
/// Does only change MatrixLookup not the underlying matrix |
826 |
19 Mar 07 |
peter |
/// object. However if the MatrixLookup is owner (and the only owner) |
826 |
19 Mar 07 |
peter |
/// of its underlying |
590 |
24 Aug 06 |
peter |
/// matrix, that matrix will be deleted here. |
590 |
24 Aug 06 |
peter |
322 |
/// |
556 |
08 Mar 06 |
peter |
323 |
const MatrixLookup& operator=(const MatrixLookup&); |
2863 |
03 Oct 12 |
peter |
324 |
|
455 |
16 Dec 05 |
markus |
325 |
private: |
1035 |
05 Feb 08 |
peter |
326 |
friend class MatrixLookupWeighted; |
1035 |
05 Feb 08 |
peter |
327 |
|
1170 |
27 Feb 08 |
peter |
328 |
utility::Index column_index_; |
4125 |
14 Jan 22 |
peter |
329 |
typedef std::shared_ptr<const utility::MatrixBase> MatrixP; |
1169 |
26 Feb 08 |
peter |
330 |
MatrixP data_; |
1170 |
27 Feb 08 |
peter |
331 |
utility::Index row_index_; |
1170 |
27 Feb 08 |
peter |
332 |
|
1170 |
27 Feb 08 |
peter |
// for assertions |
1170 |
27 Feb 08 |
peter |
334 |
bool validate(void) const; |
2863 |
03 Oct 12 |
peter |
335 |
}; |
2863 |
03 Oct 12 |
peter |
336 |
|
1169 |
26 Feb 08 |
peter |
337 |
/// |
1170 |
27 Feb 08 |
peter |
/// The output operator MatrixLookup |
1169 |
26 Feb 08 |
peter |
339 |
/// |
1883 |
31 Mar 09 |
peter |
/// \relates MatrixLookup |
1883 |
31 Mar 09 |
peter |
341 |
/// |
1169 |
26 Feb 08 |
peter |
342 |
std::ostream& operator<< (std::ostream& s, const MatrixLookup&); |
1169 |
26 Feb 08 |
peter |
343 |
|
680 |
11 Oct 06 |
jari |
344 |
}}} // of namespace classifier, yat, and theplu |
455 |
16 Dec 05 |
markus |
345 |
|
455 |
16 Dec 05 |
markus |
346 |
#endif |