yat
0.10.4pre
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
scratch
bob
jari
tmp
pristine
yat-0.10.x
yat
classifier
MatrixLookupWeighted.h
1
#ifndef _theplu_yat_classifier_matrix_lookup_weighted_
2
#define _theplu_yat_classifier_matrix_lookup_weighted_
3
4
// $Id: MatrixLookupWeighted.h 2862 2012-10-03 05:07:01Z peter $
5
6
/*
7
Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
8
Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
9
Copyright (C) 2009, 2010, 2012 Peter Johansson
10
11
This file is part of the yat library, http://dev.thep.lu.se/yat
12
13
The yat library is free software; you can redistribute it and/or
14
modify it under the terms of the GNU General Public License as
15
published by the Free Software Foundation; either version 3 of the
16
License, or (at your option) any later version.
17
18
The yat library is distributed in the hope that it will be useful,
19
but WITHOUT ANY WARRANTY; without even the implied warranty of
20
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
General Public License for more details.
22
23
You should have received a copy of the GNU General Public License
24
along with yat. If not, see <http://www.gnu.org/licenses/>.
25
*/
26
27
#include "yat/utility/Container2DIterator.h"
28
#include "yat/utility/DataWeight.h"
29
#include "
yat/utility/deprecate.h
"
30
#include "yat/utility/Index.h"
31
#include "yat/utility/MatrixWeighted.h"
32
#include "yat/utility/StrideIterator.h"
33
34
#include <boost/iterator/permutation_iterator.hpp>
35
#include <boost/shared_ptr.hpp>
36
37
#include <iosfwd>
38
#include <utility>
39
#include <vector>
40
41
namespace
theplu {
42
namespace
yat {
43
namespace
classifier {
44
45
class
MatrixLookup;
46
63
class
MatrixLookupWeighted
64
{
65
public
:
71
typedef
utility::DataWeight
value_type
;
72
78
typedef
const
utility::DataWeight
&
const_reference
;
79
81
typedef
utility::StrideIterator
<
82
utility::Container2DIterator
<
const
MatrixLookupWeighted
,
83
const
value_type
,
const_reference
> >
84
const_iterator
;
85
89
typedef
boost::permutation_iterator<
90
utility::MatrixWeighted::const_column_iterator
,
91
utility::Index::const_iterator
>
const_column_iterator
;
92
96
typedef
boost::permutation_iterator<
97
utility::MatrixWeighted::const_row_iterator
,
98
utility::Index::const_iterator
>
const_row_iterator
;
99
106
MatrixLookupWeighted
(
const
utility::MatrixWeighted
& matrix,
107
const
utility::Index
&
rows
,
108
const
utility::Index
&
columns
);
109
113
explicit
MatrixLookupWeighted
(
const
utility::MatrixWeighted
& matrix,
114
bool
owner=
false
);
115
125
explicit
MatrixLookupWeighted
(
const
MatrixLookup
& matrix);
126
127
138
MatrixLookupWeighted
(
const
MatrixLookupWeighted
& other);
139
159
MatrixLookupWeighted
(
const
MatrixLookupWeighted
& ml,
160
const
utility::Index
& row,
161
const
utility::Index
& column);
162
189
MatrixLookupWeighted
(
const
MatrixLookupWeighted
& ml,
190
const
utility::Index
&,
191
const
bool
row_vectors) YAT_DEPRECATE;
192
198
MatrixLookupWeighted
(
const
size_t
rows
,
const
size_t
columns
,
199
const
double
value=0,
const
double
weight
=1);
200
210
MatrixLookupWeighted
(std::istream&,
char
sep=
'\0'
);
211
216
virtual
~MatrixLookupWeighted
();
217
224
const_iterator
begin
(
void
)
const
;
225
231
const_column_iterator
begin_column
(
size_t
)
const
;
232
238
const_row_iterator
begin_row
(
size_t
)
const
;
239
243
size_t
columns
(
void
)
const
;
244
248
double
data
(
size_t
row,
size_t
column)
const
;
249
253
const_iterator
end
(
void
)
const
;
254
258
const_column_iterator
end_column
(
size_t
)
const
;
259
263
const_row_iterator
end_row
(
size_t
)
const
;
264
268
size_t
rows
(
void
)
const
;
269
273
double
weight
(
size_t
row,
size_t
column)
const
;
274
278
bool
weighted
(
void
)
const
;
279
285
const_reference
operator()
(
const
size_t
row,
const
size_t
column)
const
;
286
295
const
MatrixLookupWeighted
&
operator=
(
const
MatrixLookupWeighted
&);
296
297
private
:
298
typedef
boost::shared_ptr<const utility::MatrixWeighted> MatrixWP;
299
utility::Index
column_index_;
300
MatrixWP data_;
301
utility::Index
row_index_;
302
303
// for assertions
304
bool
validate(
void
)
const
;
305
};
306
315
std::ostream& operator<< (std::ostream& s,
const
MatrixLookupWeighted
&);
316
317
}}}
// of namespace classifier, yat, and theplu
318
319
#endif
Generated on Mon Nov 11 2013 09:41:44 for yat by
1.8.1