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
utility
MatrixWeighted.h
1
#ifndef _theplu_yat_utility_matrix_weighted_
2
#define _theplu_yat_utility_matrix_weighted_
3
4
// $Id: MatrixWeighted.h 2119 2009-12-12 23:11:43Z peter $
5
6
/*
7
Copyright (C) 2003 Daniel Dalevi, Peter Johansson
8
Copyright (C) 2004 Jari Häkkinen, Peter Johansson
9
Copyright (C) 2005, 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
10
Copyright (C) 2007, 2008, 2009 Jari Häkkinen, 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 "DataWeight.h"
29
#include "StrideIterator.h"
30
31
#include <vector>
32
33
namespace
theplu {
34
namespace
yat {
35
namespace
utility {
36
37
class
Matrix;
38
44
class
MatrixWeighted
45
{
46
public
:
50
typedef
DataWeight
value_type
;
51
55
typedef
DataWeight
&
reference
;
56
60
typedef
const
DataWeight
&
const_reference
;
61
65
typedef
std::vector<DataWeight>::iterator
iterator
;
66
70
typedef
std::vector<DataWeight>::const_iterator
const_iterator
;
71
75
typedef
StrideIterator<std::vector<DataWeight>::iterator
>
column_iterator
;
76
80
typedef
StrideIterator<std::vector<DataWeight>::const_iterator
>
81
const_column_iterator
;
82
86
typedef
column_iterator
row_iterator
;
87
91
typedef
const_column_iterator
const_row_iterator
;
92
98
MatrixWeighted
(
void
);
99
109
MatrixWeighted
(
size_t
r,
size_t
c,
double
init_value=0,
110
double
init_weight=1.0);
111
115
MatrixWeighted
(
const
MatrixWeighted
&);
116
117
125
explicit
MatrixWeighted
(
const
Matrix
& other);
126
139
explicit
MatrixWeighted
(std::istream &,
char
sep=
'\0'
);
140
147
iterator
begin
(
void
);
148
155
const_iterator
begin
(
void
)
const
;
156
162
column_iterator
begin_column
(
size_t
i);
163
169
const_column_iterator
begin_column
(
size_t
i)
const
;
170
176
row_iterator
begin_row
(
size_t
i);
177
183
const_row_iterator
begin_row
(
size_t
i)
const
;
184
188
size_t
columns
(
void
)
const
;
189
193
iterator
end
(
void
);
194
198
const_iterator
end
(
void
)
const
;
199
203
column_iterator
end_column
(
size_t
i);
204
208
const_column_iterator
end_column
(
size_t
i)
const
;
209
213
row_iterator
end_row
(
size_t
i);
214
218
const_row_iterator
end_row
(
size_t
i)
const
;
219
229
void
resize
(
size_t
rows
,
size_t
columns
);
230
234
size_t
rows
(
void
)
const
;
235
242
void
swap
(
MatrixWeighted
& other);
243
249
DataWeight
&
operator()
(
size_t
row,
size_t
column);
250
257
const
DataWeight
&
operator()
(
size_t
row,
size_t
column)
const
;
258
259
265
const
MatrixWeighted
&
operator=
(
const
MatrixWeighted
& other);
266
267
private
:
268
void
copy(
const
Matrix
&);
269
270
std::vector<DataWeight> vec_;
271
size_t
columns_;
272
273
};
274
284
void
swap(
MatrixWeighted
&,
MatrixWeighted
&);
285
286
}}}
// of namespace utility, yat, and theplu
287
288
#endif
Generated on Mon Nov 11 2013 09:41:44 for yat by
1.8.1