yat
0.11.3pre
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
yat
classifier
MatrixLookup.h
1
#ifndef _theplu_yat_classifier_matrix_lookup_
2
#define _theplu_yat_classifier_matrix_lookup_
3
4
// $Id: MatrixLookup.h 2863 2012-10-03 05:20:06Z peter $
5
6
/*
7
Copyright (C) 2005 Peter Johansson, Markus Ringnér
8
Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
9
Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
10
Copyright (C) 2009, 2010, 2012 Peter Johansson
11
12
This file is part of the yat library, http://dev.thep.lu.se/yat
13
14
The yat library is free software; you can redistribute it and/or
15
modify it under the terms of the GNU General Public License as
16
published by the Free Software Foundation; either version 3 of the
17
License, or (at your option) any later version.
18
19
The yat library is distributed in the hope that it will be useful,
20
but WITHOUT ANY WARRANTY; without even the implied warranty of
21
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
General Public License for more details.
23
24
You should have received a copy of the GNU General Public License
25
along with yat. If not, see <http://www.gnu.org/licenses/>.
26
*/
27
28
#include "yat/utility/Container2DIterator.h"
29
#include "
yat/utility/deprecate.h
"
30
#include "yat/utility/Index.h"
31
#include "yat/utility/iterator_traits.h"
32
#include "yat/utility/Matrix.h"
33
34
#include <boost/iterator/permutation_iterator.hpp>
35
#include <boost/shared_ptr.hpp>
36
37
#include <iosfwd>
38
#include <vector>
39
40
namespace
theplu {
41
namespace
yat {
42
namespace
classifier {
43
70
class
MatrixLookup
71
{
72
public
:
78
typedef
utility::Matrix::value_type
value_type
;
79
85
typedef
utility::Matrix::const_reference
const_reference
;
86
88
typedef
utility::Container2DIterator
<
const
MatrixLookup
,
const
double,
89
const_reference
>
90
const_iterator
;
91
95
typedef
boost::permutation_iterator<
utility::Matrix::const_column_iterator
,
96
utility::Index::const_iterator
>
97
const_column_iterator
;
98
102
typedef
const_column_iterator
const_row_iterator
;
103
118
MatrixLookup
(
const
utility::Matrix
& matrix,
const
bool
own=
false
);
119
133
MatrixLookup
(
const
utility::Matrix
& matrix,
const
utility::Index
& row,
134
const
utility::Index
& column);
135
157
MatrixLookup
(
const
utility::Matrix
& matrix,
158
const
utility::Index
& index,
159
const
bool
row_vectors) YAT_DEPRECATE;
160
171
MatrixLookup
(
const
MatrixLookup
& other);
172
197
MatrixLookup
(
const
MatrixLookup
& ml,
const
utility::Index
& row,
198
const
utility::Index
& column);
199
226
MatrixLookup
(
const
MatrixLookup
& ml,
const
utility::Index
&,
227
const
bool
row_vectors);
228
234
MatrixLookup
(
const
size_t
rows
,
const
size_t
columns
,
const
double
value=0);
235
246
MatrixLookup
(std::istream&,
char
sep=
'\0'
);
247
254
virtual
~MatrixLookup
();
255
262
const_iterator
begin
(
void
)
const
;
263
269
const_column_iterator
begin_column
(
size_t
)
const
;
270
276
const_row_iterator
begin_row
(
size_t
)
const
;
277
281
size_t
columns
(
void
)
const
;
282
286
const_iterator
end
(
void
)
const
;
287
291
const_column_iterator
end_column
(
size_t
)
const
;
292
296
const_row_iterator
end_row
(
size_t
)
const
;
297
301
size_t
rows
(
void
)
const
;
302
306
bool
weighted
(
void
)
const
;
307
313
const_reference
operator()
(
size_t
row,
size_t
column)
const
;
314
323
const
MatrixLookup
&
operator=
(
const
MatrixLookup
&);
324
325
private
:
326
friend
class
MatrixLookupWeighted
;
327
328
utility::Index
column_index_;
329
typedef
boost::shared_ptr<const utility::Matrix> MatrixP;
330
MatrixP data_;
331
utility::Index
row_index_;
332
333
// for assertions
334
bool
validate(
void
)
const
;
335
};
336
342
std::ostream& operator<< (std::ostream& s,
const
MatrixLookup
&);
343
344
}}}
// of namespace classifier, yat, and theplu
345
346
#endif
Generated on Sat May 24 2014 03:33:04 for yat by
1.8.2