Chris@16
|
1 //
|
Chris@16
|
2 // Copyright (c) 2002-2003
|
Chris@16
|
3 // Toon Knapen, Kresimir Fresl, Joerg Walter
|
Chris@16
|
4 //
|
Chris@16
|
5 // Distributed under the Boost Software License, Version 1.0. (See
|
Chris@16
|
6 // accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
7 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8 //
|
Chris@16
|
9 //
|
Chris@16
|
10
|
Chris@16
|
11 #ifndef _BOOST_UBLAS_RAW_
|
Chris@16
|
12 #define _BOOST_UBLAS_RAW_
|
Chris@16
|
13
|
Chris@16
|
14 namespace boost { namespace numeric { namespace ublas { namespace raw {
|
Chris@16
|
15
|
Chris@16
|
16 // We need data_const() mostly due to MSVC 6.0.
|
Chris@16
|
17 // But how shall we write portable code otherwise?
|
Chris@16
|
18
|
Chris@16
|
19 template < typename V >
|
Chris@16
|
20 BOOST_UBLAS_INLINE
|
Chris@16
|
21 int size( const V &v ) ;
|
Chris@16
|
22
|
Chris@16
|
23 template < typename V >
|
Chris@16
|
24 BOOST_UBLAS_INLINE
|
Chris@16
|
25 int size( const vector_reference<V> &v ) ;
|
Chris@16
|
26
|
Chris@16
|
27 template < typename M >
|
Chris@16
|
28 BOOST_UBLAS_INLINE
|
Chris@16
|
29 int size1( const M &m ) ;
|
Chris@16
|
30 template < typename M >
|
Chris@16
|
31 BOOST_UBLAS_INLINE
|
Chris@16
|
32 int size2( const M &m ) ;
|
Chris@16
|
33
|
Chris@16
|
34 template < typename M >
|
Chris@16
|
35 BOOST_UBLAS_INLINE
|
Chris@16
|
36 int size1( const matrix_reference<M> &m ) ;
|
Chris@16
|
37 template < typename M >
|
Chris@16
|
38 BOOST_UBLAS_INLINE
|
Chris@16
|
39 int size2( const matrix_reference<M> &m ) ;
|
Chris@16
|
40
|
Chris@16
|
41 template < typename M >
|
Chris@16
|
42 BOOST_UBLAS_INLINE
|
Chris@16
|
43 int leading_dimension( const M &m, row_major_tag ) ;
|
Chris@16
|
44 template < typename M >
|
Chris@16
|
45 BOOST_UBLAS_INLINE
|
Chris@16
|
46 int leading_dimension( const M &m, column_major_tag ) ;
|
Chris@16
|
47 template < typename M >
|
Chris@16
|
48 BOOST_UBLAS_INLINE
|
Chris@16
|
49 int leading_dimension( const M &m ) ;
|
Chris@16
|
50
|
Chris@16
|
51 template < typename M >
|
Chris@16
|
52 BOOST_UBLAS_INLINE
|
Chris@16
|
53 int leading_dimension( const matrix_reference<M> &m ) ;
|
Chris@16
|
54
|
Chris@16
|
55 template < typename V >
|
Chris@16
|
56 BOOST_UBLAS_INLINE
|
Chris@16
|
57 int stride( const V &v ) ;
|
Chris@16
|
58
|
Chris@16
|
59 template < typename V >
|
Chris@16
|
60 BOOST_UBLAS_INLINE
|
Chris@16
|
61 int stride( const vector_range<V> &v ) ;
|
Chris@16
|
62 template < typename V >
|
Chris@16
|
63 BOOST_UBLAS_INLINE
|
Chris@16
|
64 int stride( const vector_slice<V> &v ) ;
|
Chris@16
|
65
|
Chris@16
|
66 template < typename M >
|
Chris@16
|
67 BOOST_UBLAS_INLINE
|
Chris@16
|
68 int stride( const matrix_row<M> &v ) ;
|
Chris@16
|
69 template < typename M >
|
Chris@16
|
70 BOOST_UBLAS_INLINE
|
Chris@16
|
71 int stride( const matrix_column<M> &v ) ;
|
Chris@16
|
72
|
Chris@16
|
73 template < typename M >
|
Chris@16
|
74 BOOST_UBLAS_INLINE
|
Chris@16
|
75 int stride1( const M &m ) ;
|
Chris@16
|
76 template < typename M >
|
Chris@16
|
77 BOOST_UBLAS_INLINE
|
Chris@16
|
78 int stride2( const M &m ) ;
|
Chris@16
|
79
|
Chris@16
|
80 template < typename M >
|
Chris@16
|
81 BOOST_UBLAS_INLINE
|
Chris@16
|
82 int stride1( const matrix_reference<M> &m ) ;
|
Chris@16
|
83 template < typename M >
|
Chris@16
|
84 BOOST_UBLAS_INLINE
|
Chris@16
|
85 int stride2( const matrix_reference<M> &m ) ;
|
Chris@16
|
86
|
Chris@16
|
87 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
88 BOOST_UBLAS_INLINE
|
Chris@16
|
89 int stride1( const c_matrix<T, M, N> &m ) ;
|
Chris@16
|
90 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
91 BOOST_UBLAS_INLINE
|
Chris@16
|
92 int stride2( const c_matrix<T, M, N> &m ) ;
|
Chris@16
|
93
|
Chris@16
|
94 template < typename M >
|
Chris@16
|
95 BOOST_UBLAS_INLINE
|
Chris@16
|
96 int stride1( const matrix_range<M> &m ) ;
|
Chris@16
|
97 template < typename M >
|
Chris@16
|
98 BOOST_UBLAS_INLINE
|
Chris@16
|
99 int stride1( const matrix_slice<M> &m ) ;
|
Chris@16
|
100 template < typename M >
|
Chris@16
|
101 BOOST_UBLAS_INLINE
|
Chris@16
|
102 int stride2( const matrix_range<M> &m ) ;
|
Chris@16
|
103 template < typename M >
|
Chris@16
|
104 BOOST_UBLAS_INLINE
|
Chris@16
|
105 int stride2( const matrix_slice<M> &m ) ;
|
Chris@16
|
106
|
Chris@16
|
107 template < typename MV >
|
Chris@16
|
108 BOOST_UBLAS_INLINE
|
Chris@16
|
109 typename MV::array_type::array_type::const_pointer data( const MV &mv ) ;
|
Chris@16
|
110 template < typename MV >
|
Chris@16
|
111 BOOST_UBLAS_INLINE
|
Chris@16
|
112 typename MV::array_type::array_type::const_pointer data_const( const MV &mv ) ;
|
Chris@16
|
113 template < typename MV >
|
Chris@16
|
114 BOOST_UBLAS_INLINE
|
Chris@16
|
115 typename MV::array_type::pointer data( MV &mv ) ;
|
Chris@16
|
116
|
Chris@16
|
117 template < typename V >
|
Chris@16
|
118 BOOST_UBLAS_INLINE
|
Chris@16
|
119 typename V::array_type::array_type::const_pointer data( const vector_reference<V> &v ) ;
|
Chris@16
|
120 template < typename V >
|
Chris@16
|
121 BOOST_UBLAS_INLINE
|
Chris@16
|
122 typename V::array_type::array_type::const_pointer data_const( const vector_reference<V> &v ) ;
|
Chris@16
|
123 template < typename V >
|
Chris@16
|
124 BOOST_UBLAS_INLINE
|
Chris@16
|
125 typename V::array_type::pointer data( vector_reference<V> &v ) ;
|
Chris@16
|
126
|
Chris@16
|
127 template < typename T, std::size_t N >
|
Chris@16
|
128 BOOST_UBLAS_INLINE
|
Chris@16
|
129 typename c_vector<T, N>::array_type::array_type::const_pointer data( const c_vector<T, N> &v ) ;
|
Chris@16
|
130 template < typename T, std::size_t N >
|
Chris@16
|
131 BOOST_UBLAS_INLINE
|
Chris@16
|
132 typename c_vector<T, N>::array_type::array_type::const_pointer data_const( const c_vector<T, N> &v ) ;
|
Chris@16
|
133 template < typename T, std::size_t N >
|
Chris@16
|
134 BOOST_UBLAS_INLINE
|
Chris@16
|
135 typename c_vector<T, N>::pointer data( c_vector<T, N> &v ) ;
|
Chris@16
|
136
|
Chris@16
|
137 template < typename V >
|
Chris@16
|
138 BOOST_UBLAS_INLINE
|
Chris@16
|
139 typename V::array_type::array_type::const_pointer data( const vector_range<V> &v ) ;
|
Chris@16
|
140 template < typename V >
|
Chris@16
|
141 BOOST_UBLAS_INLINE
|
Chris@16
|
142 typename V::array_type::array_type::const_pointer data( const vector_slice<V> &v ) ;
|
Chris@16
|
143 template < typename V >
|
Chris@16
|
144 BOOST_UBLAS_INLINE
|
Chris@16
|
145 typename V::array_type::array_type::const_pointer data_const( const vector_range<V> &v ) ;
|
Chris@16
|
146 template < typename V >
|
Chris@16
|
147 BOOST_UBLAS_INLINE
|
Chris@16
|
148 typename V::array_type::array_type::const_pointer data_const( const vector_slice<V> &v ) ;
|
Chris@16
|
149 template < typename V >
|
Chris@16
|
150 BOOST_UBLAS_INLINE
|
Chris@16
|
151 typename V::array_type::pointer data( vector_range<V> &v ) ;
|
Chris@16
|
152 template < typename V >
|
Chris@16
|
153 BOOST_UBLAS_INLINE
|
Chris@16
|
154 typename V::array_type::pointer data( vector_slice<V> &v ) ;
|
Chris@16
|
155
|
Chris@16
|
156 template < typename M >
|
Chris@16
|
157 BOOST_UBLAS_INLINE
|
Chris@16
|
158 typename M::array_type::array_type::const_pointer data( const matrix_reference<M> &m ) ;
|
Chris@16
|
159 template < typename M >
|
Chris@16
|
160 BOOST_UBLAS_INLINE
|
Chris@16
|
161 typename M::array_type::array_type::const_pointer data_const( const matrix_reference<M> &m ) ;
|
Chris@16
|
162 template < typename M >
|
Chris@16
|
163 BOOST_UBLAS_INLINE
|
Chris@16
|
164 typename M::array_type::pointer data( matrix_reference<M> &m ) ;
|
Chris@16
|
165
|
Chris@16
|
166 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
167 BOOST_UBLAS_INLINE
|
Chris@16
|
168 typename c_matrix<T, M, N>::array_type::array_type::const_pointer data( const c_matrix<T, M, N> &m ) ;
|
Chris@16
|
169 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
170 BOOST_UBLAS_INLINE
|
Chris@16
|
171 typename c_matrix<T, M, N>::array_type::array_type::const_pointer data_const( const c_matrix<T, M, N> &m ) ;
|
Chris@16
|
172 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
173 BOOST_UBLAS_INLINE
|
Chris@16
|
174 typename c_matrix<T, M, N>::pointer data( c_matrix<T, M, N> &m ) ;
|
Chris@16
|
175
|
Chris@16
|
176 template < typename M >
|
Chris@16
|
177 BOOST_UBLAS_INLINE
|
Chris@16
|
178 typename M::array_type::array_type::const_pointer data( const matrix_row<M> &v ) ;
|
Chris@16
|
179 template < typename M >
|
Chris@16
|
180 BOOST_UBLAS_INLINE
|
Chris@16
|
181 typename M::array_type::array_type::const_pointer data( const matrix_column<M> &v ) ;
|
Chris@16
|
182 template < typename M >
|
Chris@16
|
183 BOOST_UBLAS_INLINE
|
Chris@16
|
184 typename M::array_type::array_type::const_pointer data_const( const matrix_row<M> &v ) ;
|
Chris@16
|
185 template < typename M >
|
Chris@16
|
186 BOOST_UBLAS_INLINE
|
Chris@16
|
187 typename M::array_type::array_type::const_pointer data_const( const matrix_column<M> &v ) ;
|
Chris@16
|
188 template < typename M >
|
Chris@16
|
189 BOOST_UBLAS_INLINE
|
Chris@16
|
190 typename M::array_type::pointer data( matrix_row<M> &v ) ;
|
Chris@16
|
191 template < typename M >
|
Chris@16
|
192 BOOST_UBLAS_INLINE
|
Chris@16
|
193 typename M::array_type::pointer data( matrix_column<M> &v ) ;
|
Chris@16
|
194
|
Chris@16
|
195 template < typename M >
|
Chris@16
|
196 BOOST_UBLAS_INLINE
|
Chris@16
|
197 typename M::array_type::array_type::const_pointer data( const matrix_range<M> &m ) ;
|
Chris@16
|
198 template < typename M >
|
Chris@16
|
199 BOOST_UBLAS_INLINE
|
Chris@16
|
200 typename M::array_type::array_type::const_pointer data( const matrix_slice<M> &m ) ;
|
Chris@16
|
201 template < typename M >
|
Chris@16
|
202 BOOST_UBLAS_INLINE
|
Chris@16
|
203 typename M::array_type::array_type::const_pointer data_const( const matrix_range<M> &m ) ;
|
Chris@16
|
204 template < typename M >
|
Chris@16
|
205 BOOST_UBLAS_INLINE
|
Chris@16
|
206 typename M::array_type::array_type::const_pointer data_const( const matrix_slice<M> &m ) ;
|
Chris@16
|
207 template < typename M >
|
Chris@16
|
208 BOOST_UBLAS_INLINE
|
Chris@16
|
209 typename M::array_type::pointer data( matrix_range<M> &m ) ;
|
Chris@16
|
210 template < typename M >
|
Chris@16
|
211 BOOST_UBLAS_INLINE
|
Chris@16
|
212 typename M::array_type::pointer data( matrix_slice<M> &m ) ;
|
Chris@16
|
213
|
Chris@16
|
214 template < typename MV >
|
Chris@16
|
215 BOOST_UBLAS_INLINE
|
Chris@16
|
216 typename MV::array_type::array_type::const_pointer base( const MV &mv ) ;
|
Chris@16
|
217
|
Chris@16
|
218 template < typename MV >
|
Chris@16
|
219 BOOST_UBLAS_INLINE
|
Chris@16
|
220 typename MV::array_type::array_type::const_pointer base_const( const MV &mv ) ;
|
Chris@16
|
221 template < typename MV >
|
Chris@16
|
222 BOOST_UBLAS_INLINE
|
Chris@16
|
223 typename MV::array_type::pointer base( MV &mv ) ;
|
Chris@16
|
224
|
Chris@16
|
225 template < typename V >
|
Chris@16
|
226 BOOST_UBLAS_INLINE
|
Chris@16
|
227 typename V::array_type::array_type::const_pointer base( const vector_reference<V> &v ) ;
|
Chris@16
|
228 template < typename V >
|
Chris@16
|
229 BOOST_UBLAS_INLINE
|
Chris@16
|
230 typename V::array_type::array_type::const_pointer base_const( const vector_reference<V> &v ) ;
|
Chris@16
|
231 template < typename V >
|
Chris@16
|
232 BOOST_UBLAS_INLINE
|
Chris@16
|
233 typename V::array_type::pointer base( vector_reference<V> &v ) ;
|
Chris@16
|
234
|
Chris@16
|
235 template < typename T, std::size_t N >
|
Chris@16
|
236 BOOST_UBLAS_INLINE
|
Chris@16
|
237 typename c_vector<T, N>::array_type::array_type::const_pointer base( const c_vector<T, N> &v ) ;
|
Chris@16
|
238 template < typename T, std::size_t N >
|
Chris@16
|
239 BOOST_UBLAS_INLINE
|
Chris@16
|
240 typename c_vector<T, N>::array_type::array_type::const_pointer base_const( const c_vector<T, N> &v ) ;
|
Chris@16
|
241 template < typename T, std::size_t N >
|
Chris@16
|
242 BOOST_UBLAS_INLINE
|
Chris@16
|
243 typename c_vector<T, N>::pointer base( c_vector<T, N> &v ) ;
|
Chris@16
|
244
|
Chris@16
|
245 template < typename V >
|
Chris@16
|
246 BOOST_UBLAS_INLINE
|
Chris@16
|
247 typename V::array_type::array_type::const_pointer base( const vector_range<V> &v ) ;
|
Chris@16
|
248 template < typename V >
|
Chris@16
|
249 BOOST_UBLAS_INLINE
|
Chris@16
|
250 typename V::array_type::array_type::const_pointer base( const vector_slice<V> &v ) ;
|
Chris@16
|
251 template < typename V >
|
Chris@16
|
252 BOOST_UBLAS_INLINE
|
Chris@16
|
253 typename V::array_type::array_type::const_pointer base_const( const vector_range<V> &v ) ;
|
Chris@16
|
254 template < typename V >
|
Chris@16
|
255 BOOST_UBLAS_INLINE
|
Chris@16
|
256 typename V::array_type::array_type::const_pointer base_const( const vector_slice<V> &v ) ;
|
Chris@16
|
257 template < typename V >
|
Chris@16
|
258 BOOST_UBLAS_INLINE
|
Chris@16
|
259 typename V::array_type::pointer base( vector_range<V> &v ) ;
|
Chris@16
|
260 template < typename V >
|
Chris@16
|
261 BOOST_UBLAS_INLINE
|
Chris@16
|
262 typename V::array_type::pointer base( vector_slice<V> &v ) ;
|
Chris@16
|
263
|
Chris@16
|
264 template < typename M >
|
Chris@16
|
265 BOOST_UBLAS_INLINE
|
Chris@16
|
266 typename M::array_type::array_type::const_pointer base( const matrix_reference<M> &m ) ;
|
Chris@16
|
267 template < typename M >
|
Chris@16
|
268 BOOST_UBLAS_INLINE
|
Chris@16
|
269 typename M::array_type::array_type::const_pointer base_const( const matrix_reference<M> &m ) ;
|
Chris@16
|
270 template < typename M >
|
Chris@16
|
271 BOOST_UBLAS_INLINE
|
Chris@16
|
272 typename M::array_type::pointer base( matrix_reference<M> &m ) ;
|
Chris@16
|
273
|
Chris@16
|
274 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
275 BOOST_UBLAS_INLINE
|
Chris@16
|
276 typename c_matrix<T, M, N>::array_type::array_type::const_pointer base( const c_matrix<T, M, N> &m ) ;
|
Chris@16
|
277 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
278 BOOST_UBLAS_INLINE
|
Chris@16
|
279 typename c_matrix<T, M, N>::array_type::array_type::const_pointer base_const( const c_matrix<T, M, N> &m ) ;
|
Chris@16
|
280 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
281 BOOST_UBLAS_INLINE
|
Chris@16
|
282 typename c_matrix<T, M, N>::pointer base( c_matrix<T, M, N> &m ) ;
|
Chris@16
|
283
|
Chris@16
|
284 template < typename M >
|
Chris@16
|
285 BOOST_UBLAS_INLINE
|
Chris@16
|
286 typename M::array_type::array_type::const_pointer base( const matrix_row<M> &v ) ;
|
Chris@16
|
287 template < typename M >
|
Chris@16
|
288 BOOST_UBLAS_INLINE
|
Chris@16
|
289 typename M::array_type::array_type::const_pointer base( const matrix_column<M> &v ) ;
|
Chris@16
|
290 template < typename M >
|
Chris@16
|
291 BOOST_UBLAS_INLINE
|
Chris@16
|
292 typename M::array_type::array_type::const_pointer base_const( const matrix_row<M> &v ) ;
|
Chris@16
|
293 template < typename M >
|
Chris@16
|
294 BOOST_UBLAS_INLINE
|
Chris@16
|
295 typename M::array_type::array_type::const_pointer base_const( const matrix_column<M> &v ) ;
|
Chris@16
|
296 template < typename M >
|
Chris@16
|
297 BOOST_UBLAS_INLINE
|
Chris@16
|
298 typename M::array_type::pointer base( matrix_row<M> &v ) ;
|
Chris@16
|
299 template < typename M >
|
Chris@16
|
300 BOOST_UBLAS_INLINE
|
Chris@16
|
301 typename M::array_type::pointer base( matrix_column<M> &v ) ;
|
Chris@16
|
302
|
Chris@16
|
303 template < typename M >
|
Chris@16
|
304 BOOST_UBLAS_INLINE
|
Chris@16
|
305 typename M::array_type::array_type::const_pointer base( const matrix_range<M> &m ) ;
|
Chris@16
|
306 template < typename M >
|
Chris@16
|
307 BOOST_UBLAS_INLINE
|
Chris@16
|
308 typename M::array_type::array_type::const_pointer base( const matrix_slice<M> &m ) ;
|
Chris@16
|
309 template < typename M >
|
Chris@16
|
310 BOOST_UBLAS_INLINE
|
Chris@16
|
311 typename M::array_type::array_type::const_pointer base_const( const matrix_range<M> &m ) ;
|
Chris@16
|
312 template < typename M >
|
Chris@16
|
313 BOOST_UBLAS_INLINE
|
Chris@16
|
314 typename M::array_type::array_type::const_pointer base_const( const matrix_slice<M> &m ) ;
|
Chris@16
|
315 template < typename M >
|
Chris@16
|
316 BOOST_UBLAS_INLINE
|
Chris@16
|
317 typename M::array_type::pointer base( matrix_range<M> &m ) ;
|
Chris@16
|
318 template < typename M >
|
Chris@16
|
319 BOOST_UBLAS_INLINE
|
Chris@16
|
320 typename M::array_type::pointer base( matrix_slice<M> &m ) ;
|
Chris@16
|
321
|
Chris@16
|
322 template < typename MV >
|
Chris@16
|
323 BOOST_UBLAS_INLINE
|
Chris@16
|
324 typename MV::size_type start( const MV &mv ) ;
|
Chris@16
|
325
|
Chris@16
|
326 template < typename V >
|
Chris@16
|
327 BOOST_UBLAS_INLINE
|
Chris@16
|
328 typename V::size_type start( const vector_range<V> &v ) ;
|
Chris@16
|
329 template < typename V >
|
Chris@16
|
330 BOOST_UBLAS_INLINE
|
Chris@16
|
331 typename V::size_type start( const vector_slice<V> &v ) ;
|
Chris@16
|
332
|
Chris@16
|
333 template < typename M >
|
Chris@16
|
334 BOOST_UBLAS_INLINE
|
Chris@16
|
335 typename M::size_type start( const matrix_row<M> &v ) ;
|
Chris@16
|
336 template < typename M >
|
Chris@16
|
337 BOOST_UBLAS_INLINE
|
Chris@16
|
338 typename M::size_type start( const matrix_column<M> &v ) ;
|
Chris@16
|
339
|
Chris@16
|
340 template < typename M >
|
Chris@16
|
341 BOOST_UBLAS_INLINE
|
Chris@16
|
342 typename M::size_type start( const matrix_range<M> &m ) ;
|
Chris@16
|
343 template < typename M >
|
Chris@16
|
344 BOOST_UBLAS_INLINE
|
Chris@16
|
345 typename M::size_type start( const matrix_slice<M> &m ) ;
|
Chris@16
|
346
|
Chris@16
|
347
|
Chris@16
|
348
|
Chris@16
|
349 template < typename V >
|
Chris@16
|
350 BOOST_UBLAS_INLINE
|
Chris@16
|
351 int size( const V &v ) {
|
Chris@16
|
352 return v.size() ;
|
Chris@16
|
353 }
|
Chris@16
|
354
|
Chris@16
|
355 template < typename V >
|
Chris@16
|
356 BOOST_UBLAS_INLINE
|
Chris@16
|
357 int size( const vector_reference<V> &v ) {
|
Chris@16
|
358 return size( v ) ;
|
Chris@16
|
359 }
|
Chris@16
|
360
|
Chris@16
|
361 template < typename M >
|
Chris@16
|
362 BOOST_UBLAS_INLINE
|
Chris@16
|
363 int size1( const M &m ) {
|
Chris@16
|
364 return m.size1() ;
|
Chris@16
|
365 }
|
Chris@16
|
366 template < typename M >
|
Chris@16
|
367 BOOST_UBLAS_INLINE
|
Chris@16
|
368 int size2( const M &m ) {
|
Chris@16
|
369 return m.size2() ;
|
Chris@16
|
370 }
|
Chris@16
|
371
|
Chris@16
|
372 template < typename M >
|
Chris@16
|
373 BOOST_UBLAS_INLINE
|
Chris@16
|
374 int size1( const matrix_reference<M> &m ) {
|
Chris@16
|
375 return size1( m.expression() ) ;
|
Chris@16
|
376 }
|
Chris@16
|
377 template < typename M >
|
Chris@16
|
378 BOOST_UBLAS_INLINE
|
Chris@16
|
379 int size2( const matrix_reference<M> &m ) {
|
Chris@16
|
380 return size2( m.expression() ) ;
|
Chris@16
|
381 }
|
Chris@16
|
382
|
Chris@16
|
383 template < typename M >
|
Chris@16
|
384 BOOST_UBLAS_INLINE
|
Chris@16
|
385 int leading_dimension( const M &m, row_major_tag ) {
|
Chris@16
|
386 return m.size2() ;
|
Chris@16
|
387 }
|
Chris@16
|
388 template < typename M >
|
Chris@16
|
389 BOOST_UBLAS_INLINE
|
Chris@16
|
390 int leading_dimension( const M &m, column_major_tag ) {
|
Chris@16
|
391 return m.size1() ;
|
Chris@16
|
392 }
|
Chris@16
|
393 template < typename M >
|
Chris@16
|
394 BOOST_UBLAS_INLINE
|
Chris@16
|
395 int leading_dimension( const M &m ) {
|
Chris@16
|
396 return leading_dimension( m, typename M::orientation_category() ) ;
|
Chris@16
|
397 }
|
Chris@16
|
398
|
Chris@16
|
399 template < typename M >
|
Chris@16
|
400 BOOST_UBLAS_INLINE
|
Chris@16
|
401 int leading_dimension( const matrix_reference<M> &m ) {
|
Chris@16
|
402 return leading_dimension( m.expression() ) ;
|
Chris@16
|
403 }
|
Chris@16
|
404
|
Chris@16
|
405 template < typename V >
|
Chris@16
|
406 BOOST_UBLAS_INLINE
|
Chris@16
|
407 int stride( const V &v ) {
|
Chris@16
|
408 return 1 ;
|
Chris@16
|
409 }
|
Chris@16
|
410
|
Chris@16
|
411 template < typename V >
|
Chris@16
|
412 BOOST_UBLAS_INLINE
|
Chris@16
|
413 int stride( const vector_range<V> &v ) {
|
Chris@16
|
414 return stride( v.data() ) ;
|
Chris@16
|
415 }
|
Chris@16
|
416 template < typename V >
|
Chris@16
|
417 BOOST_UBLAS_INLINE
|
Chris@16
|
418 int stride( const vector_slice<V> &v ) {
|
Chris@16
|
419 return v.stride() * stride( v.data() ) ;
|
Chris@16
|
420 }
|
Chris@16
|
421
|
Chris@16
|
422 template < typename M >
|
Chris@16
|
423 BOOST_UBLAS_INLINE
|
Chris@16
|
424 int stride( const matrix_row<M> &v ) {
|
Chris@16
|
425 return stride2( v.data() ) ;
|
Chris@16
|
426 }
|
Chris@16
|
427 template < typename M >
|
Chris@16
|
428 BOOST_UBLAS_INLINE
|
Chris@16
|
429 int stride( const matrix_column<M> &v ) {
|
Chris@16
|
430 return stride1( v.data() ) ;
|
Chris@16
|
431 }
|
Chris@16
|
432
|
Chris@16
|
433 template < typename M >
|
Chris@16
|
434 BOOST_UBLAS_INLINE
|
Chris@16
|
435 int stride1( const M &m ) {
|
Chris@16
|
436 typedef typename M::functor_type functor_type;
|
Chris@16
|
437 return functor_type::one1( m.size1(), m.size2() ) ;
|
Chris@16
|
438 }
|
Chris@16
|
439 template < typename M >
|
Chris@16
|
440 BOOST_UBLAS_INLINE
|
Chris@16
|
441 int stride2( const M &m ) {
|
Chris@16
|
442 typedef typename M::functor_type functor_type;
|
Chris@16
|
443 return functor_type::one2( m.size1(), m.size2() ) ;
|
Chris@16
|
444 }
|
Chris@16
|
445
|
Chris@16
|
446 template < typename M >
|
Chris@16
|
447 BOOST_UBLAS_INLINE
|
Chris@16
|
448 int stride1( const matrix_reference<M> &m ) {
|
Chris@16
|
449 return stride1( m.expression() ) ;
|
Chris@16
|
450 }
|
Chris@16
|
451 template < typename M >
|
Chris@16
|
452 BOOST_UBLAS_INLINE
|
Chris@16
|
453 int stride2( const matrix_reference<M> &m ) {
|
Chris@16
|
454 return stride2( m.expression() ) ;
|
Chris@16
|
455 }
|
Chris@16
|
456
|
Chris@16
|
457 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
458 BOOST_UBLAS_INLINE
|
Chris@16
|
459 int stride1( const c_matrix<T, M, N> &m ) {
|
Chris@16
|
460 return N ;
|
Chris@16
|
461 }
|
Chris@16
|
462 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
463 BOOST_UBLAS_INLINE
|
Chris@16
|
464 int stride2( const c_matrix<T, M, N> &m ) {
|
Chris@16
|
465 return 1 ;
|
Chris@16
|
466 }
|
Chris@16
|
467
|
Chris@16
|
468 template < typename M >
|
Chris@16
|
469 BOOST_UBLAS_INLINE
|
Chris@16
|
470 int stride1( const matrix_range<M> &m ) {
|
Chris@16
|
471 return stride1( m.data() ) ;
|
Chris@16
|
472 }
|
Chris@16
|
473 template < typename M >
|
Chris@16
|
474 BOOST_UBLAS_INLINE
|
Chris@16
|
475 int stride1( const matrix_slice<M> &m ) {
|
Chris@16
|
476 return m.stride1() * stride1( m.data() ) ;
|
Chris@16
|
477 }
|
Chris@16
|
478 template < typename M >
|
Chris@16
|
479 BOOST_UBLAS_INLINE
|
Chris@16
|
480 int stride2( const matrix_range<M> &m ) {
|
Chris@16
|
481 return stride2( m.data() ) ;
|
Chris@16
|
482 }
|
Chris@16
|
483 template < typename M >
|
Chris@16
|
484 BOOST_UBLAS_INLINE
|
Chris@16
|
485 int stride2( const matrix_slice<M> &m ) {
|
Chris@16
|
486 return m.stride2() * stride2( m.data() ) ;
|
Chris@16
|
487 }
|
Chris@16
|
488
|
Chris@16
|
489 template < typename MV >
|
Chris@16
|
490 BOOST_UBLAS_INLINE
|
Chris@16
|
491 typename MV::array_type::array_type::array_type::const_pointer data( const MV &mv ) {
|
Chris@16
|
492 return &mv.data().begin()[0] ;
|
Chris@16
|
493 }
|
Chris@16
|
494 template < typename MV >
|
Chris@16
|
495 BOOST_UBLAS_INLINE
|
Chris@16
|
496 typename MV::array_type::array_type::const_pointer data_const( const MV &mv ) {
|
Chris@16
|
497 return &mv.data().begin()[0] ;
|
Chris@16
|
498 }
|
Chris@16
|
499 template < typename MV >
|
Chris@16
|
500 BOOST_UBLAS_INLINE
|
Chris@16
|
501 typename MV::array_type::pointer data( MV &mv ) {
|
Chris@16
|
502 return &mv.data().begin()[0] ;
|
Chris@16
|
503 }
|
Chris@16
|
504
|
Chris@16
|
505
|
Chris@16
|
506 template < typename V >
|
Chris@16
|
507 BOOST_UBLAS_INLINE
|
Chris@16
|
508 typename V::array_type::array_type::const_pointer data( const vector_reference<V> &v ) {
|
Chris@16
|
509 return data( v.expression () ) ;
|
Chris@16
|
510 }
|
Chris@16
|
511 template < typename V >
|
Chris@16
|
512 BOOST_UBLAS_INLINE
|
Chris@16
|
513 typename V::array_type::array_type::const_pointer data_const( const vector_reference<V> &v ) {
|
Chris@16
|
514 return data_const( v.expression () ) ;
|
Chris@16
|
515 }
|
Chris@16
|
516 template < typename V >
|
Chris@16
|
517 BOOST_UBLAS_INLINE
|
Chris@16
|
518 typename V::array_type::pointer data( vector_reference<V> &v ) {
|
Chris@16
|
519 return data( v.expression () ) ;
|
Chris@16
|
520 }
|
Chris@16
|
521
|
Chris@16
|
522 template < typename T, std::size_t N >
|
Chris@16
|
523 BOOST_UBLAS_INLINE
|
Chris@16
|
524 typename c_vector<T, N>::array_type::array_type::const_pointer data( const c_vector<T, N> &v ) {
|
Chris@16
|
525 return v.data() ;
|
Chris@16
|
526 }
|
Chris@16
|
527 template < typename T, std::size_t N >
|
Chris@16
|
528 BOOST_UBLAS_INLINE
|
Chris@16
|
529 typename c_vector<T, N>::array_type::array_type::const_pointer data_const( const c_vector<T, N> &v ) {
|
Chris@16
|
530 return v.data() ;
|
Chris@16
|
531 }
|
Chris@16
|
532 template < typename T, std::size_t N >
|
Chris@16
|
533 BOOST_UBLAS_INLINE
|
Chris@16
|
534 typename c_vector<T, N>::pointer data( c_vector<T, N> &v ) {
|
Chris@16
|
535 return v.data() ;
|
Chris@16
|
536 }
|
Chris@16
|
537
|
Chris@16
|
538 template < typename V >
|
Chris@16
|
539 BOOST_UBLAS_INLINE
|
Chris@16
|
540 typename V::array_type::array_type::const_pointer data( const vector_range<V> &v ) {
|
Chris@16
|
541 return data( v.data() ) + v.start() * stride (v.data() ) ;
|
Chris@16
|
542 }
|
Chris@16
|
543 template < typename V >
|
Chris@16
|
544 BOOST_UBLAS_INLINE
|
Chris@16
|
545 typename V::array_type::array_type::const_pointer data( const vector_slice<V> &v ) {
|
Chris@16
|
546 return data( v.data() ) + v.start() * stride (v.data() ) ;
|
Chris@16
|
547 }
|
Chris@16
|
548 template < typename V >
|
Chris@16
|
549 BOOST_UBLAS_INLINE
|
Chris@16
|
550 typename V::array_type::array_type::const_pointer data_const( const vector_range<V> &v ) {
|
Chris@16
|
551 return data_const( v.data() ) + v.start() * stride (v.data() ) ;
|
Chris@16
|
552 }
|
Chris@16
|
553 template < typename V >
|
Chris@16
|
554 BOOST_UBLAS_INLINE
|
Chris@16
|
555 typename V::array_type::const_pointer data_const( const vector_slice<V> &v ) {
|
Chris@16
|
556 return data_const( v.data() ) + v.start() * stride (v.data() ) ;
|
Chris@16
|
557 }
|
Chris@16
|
558 template < typename V >
|
Chris@16
|
559 BOOST_UBLAS_INLINE
|
Chris@16
|
560 typename V::array_type::pointer data( vector_range<V> &v ) {
|
Chris@16
|
561 return data( v.data() ) + v.start() * stride (v.data() ) ;
|
Chris@16
|
562 }
|
Chris@16
|
563 template < typename V >
|
Chris@16
|
564 BOOST_UBLAS_INLINE
|
Chris@16
|
565 typename V::array_type::pointer data( vector_slice<V> &v ) {
|
Chris@16
|
566 return data( v.data() ) + v.start() * stride (v.data() ) ;
|
Chris@16
|
567 }
|
Chris@16
|
568
|
Chris@16
|
569 template < typename M >
|
Chris@16
|
570 BOOST_UBLAS_INLINE
|
Chris@16
|
571 typename M::array_type::const_pointer data( const matrix_reference<M> &m ) {
|
Chris@16
|
572 return data( m.expression () ) ;
|
Chris@16
|
573 }
|
Chris@16
|
574 template < typename M >
|
Chris@16
|
575 BOOST_UBLAS_INLINE
|
Chris@16
|
576 typename M::array_type::const_pointer data_const( const matrix_reference<M> &m ) {
|
Chris@16
|
577 return data_const( m.expression () ) ;
|
Chris@16
|
578 }
|
Chris@16
|
579 template < typename M >
|
Chris@16
|
580 BOOST_UBLAS_INLINE
|
Chris@16
|
581 typename M::array_type::pointer data( matrix_reference<M> &m ) {
|
Chris@16
|
582 return data( m.expression () ) ;
|
Chris@16
|
583 }
|
Chris@16
|
584
|
Chris@16
|
585 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
586 BOOST_UBLAS_INLINE
|
Chris@16
|
587 typename c_matrix<T, M, N>::array_type::const_pointer data( const c_matrix<T, M, N> &m ) {
|
Chris@16
|
588 return m.data() ;
|
Chris@16
|
589 }
|
Chris@16
|
590 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
591 BOOST_UBLAS_INLINE
|
Chris@16
|
592 typename c_matrix<T, M, N>::array_type::const_pointer data_const( const c_matrix<T, M, N> &m ) {
|
Chris@16
|
593 return m.data() ;
|
Chris@16
|
594 }
|
Chris@16
|
595 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
596 BOOST_UBLAS_INLINE
|
Chris@16
|
597 typename c_matrix<T, M, N>::pointer data( c_matrix<T, M, N> &m ) {
|
Chris@16
|
598 return m.data() ;
|
Chris@16
|
599 }
|
Chris@16
|
600
|
Chris@16
|
601 template < typename M >
|
Chris@16
|
602 BOOST_UBLAS_INLINE
|
Chris@16
|
603 typename M::array_type::const_pointer data( const matrix_row<M> &v ) {
|
Chris@16
|
604 return data( v.data() ) + v.index() * stride1( v.data() ) ;
|
Chris@16
|
605 }
|
Chris@16
|
606 template < typename M >
|
Chris@16
|
607 BOOST_UBLAS_INLINE
|
Chris@16
|
608 typename M::array_type::const_pointer data( const matrix_column<M> &v ) {
|
Chris@16
|
609 return data( v.data() ) + v.index() * stride2( v.data() ) ;
|
Chris@16
|
610 }
|
Chris@16
|
611 template < typename M >
|
Chris@16
|
612 BOOST_UBLAS_INLINE
|
Chris@16
|
613 typename M::array_type::const_pointer data_const( const matrix_row<M> &v ) {
|
Chris@16
|
614 return data_const( v.data() ) + v.index() * stride1( v.data() ) ;
|
Chris@16
|
615 }
|
Chris@16
|
616 template < typename M >
|
Chris@16
|
617 BOOST_UBLAS_INLINE
|
Chris@16
|
618 typename M::array_type::const_pointer data_const( const matrix_column<M> &v ) {
|
Chris@16
|
619 return data_const( v.data() ) + v.index() * stride2( v.data() ) ;
|
Chris@16
|
620 }
|
Chris@16
|
621 template < typename M >
|
Chris@16
|
622 BOOST_UBLAS_INLINE
|
Chris@16
|
623 typename M::array_type::pointer data( matrix_row<M> &v ) {
|
Chris@16
|
624 return data( v.data() ) + v.index() * stride1( v.data() ) ;
|
Chris@16
|
625 }
|
Chris@16
|
626 template < typename M >
|
Chris@16
|
627 BOOST_UBLAS_INLINE
|
Chris@16
|
628 typename M::array_type::pointer data( matrix_column<M> &v ) {
|
Chris@16
|
629 return data( v.data() ) + v.index() * stride2( v.data() ) ;
|
Chris@16
|
630 }
|
Chris@16
|
631
|
Chris@16
|
632 template < typename M >
|
Chris@16
|
633 BOOST_UBLAS_INLINE
|
Chris@16
|
634 typename M::array_type::const_pointer data( const matrix_range<M> &m ) {
|
Chris@16
|
635 return data( m.data() ) + m.start1() * stride1( m.data () ) + m.start2() * stride2( m.data () ) ;
|
Chris@16
|
636 }
|
Chris@16
|
637 template < typename M >
|
Chris@16
|
638 BOOST_UBLAS_INLINE
|
Chris@16
|
639 typename M::array_type::const_pointer data( const matrix_slice<M> &m ) {
|
Chris@16
|
640 return data( m.data() ) + m.start1() * stride1( m.data () ) + m.start2() * stride2( m.data () ) ;
|
Chris@16
|
641 }
|
Chris@16
|
642 template < typename M >
|
Chris@16
|
643 BOOST_UBLAS_INLINE
|
Chris@16
|
644 typename M::array_type::const_pointer data_const( const matrix_range<M> &m ) {
|
Chris@16
|
645 return data_const( m.data() ) + m.start1() * stride1( m.data () ) + m.start2() * stride2( m.data () ) ;
|
Chris@16
|
646 }
|
Chris@16
|
647 template < typename M >
|
Chris@16
|
648 BOOST_UBLAS_INLINE
|
Chris@16
|
649 typename M::array_type::const_pointer data_const( const matrix_slice<M> &m ) {
|
Chris@16
|
650 return data_const( m.data() ) + m.start1() * stride1( m.data () ) + m.start2() * stride2( m.data () ) ;
|
Chris@16
|
651 }
|
Chris@16
|
652 template < typename M >
|
Chris@16
|
653 BOOST_UBLAS_INLINE
|
Chris@16
|
654 typename M::array_type::pointer data( matrix_range<M> &m ) {
|
Chris@16
|
655 return data( m.data() ) + m.start1() * stride1( m.data () ) + m.start2() * stride2( m.data () ) ;
|
Chris@16
|
656 }
|
Chris@16
|
657 template < typename M >
|
Chris@16
|
658 BOOST_UBLAS_INLINE
|
Chris@16
|
659 typename M::array_type::pointer data( matrix_slice<M> &m ) {
|
Chris@16
|
660 return data( m.data() ) + m.start1() * stride1( m.data () ) + m.start2() * stride2( m.data () ) ;
|
Chris@16
|
661 }
|
Chris@16
|
662
|
Chris@16
|
663
|
Chris@16
|
664 template < typename MV >
|
Chris@16
|
665 BOOST_UBLAS_INLINE
|
Chris@16
|
666 typename MV::array_type::const_pointer base( const MV &mv ) {
|
Chris@16
|
667 return &mv.data().begin()[0] ;
|
Chris@16
|
668 }
|
Chris@16
|
669 template < typename MV >
|
Chris@16
|
670 BOOST_UBLAS_INLINE
|
Chris@16
|
671 typename MV::array_type::const_pointer base_const( const MV &mv ) {
|
Chris@16
|
672 return &mv.data().begin()[0] ;
|
Chris@16
|
673 }
|
Chris@16
|
674 template < typename MV >
|
Chris@16
|
675 BOOST_UBLAS_INLINE
|
Chris@16
|
676 typename MV::array_type::pointer base( MV &mv ) {
|
Chris@16
|
677 return &mv.data().begin()[0] ;
|
Chris@16
|
678 }
|
Chris@16
|
679
|
Chris@16
|
680 template < typename V >
|
Chris@16
|
681 BOOST_UBLAS_INLINE
|
Chris@16
|
682 typename V::array_type::const_pointer base( const vector_reference<V> &v ) {
|
Chris@16
|
683 return base( v.expression () ) ;
|
Chris@16
|
684 }
|
Chris@16
|
685 template < typename V >
|
Chris@16
|
686 BOOST_UBLAS_INLINE
|
Chris@16
|
687 typename V::array_type::const_pointer base_const( const vector_reference<V> &v ) {
|
Chris@16
|
688 return base_const( v.expression () ) ;
|
Chris@16
|
689 }
|
Chris@16
|
690 template < typename V >
|
Chris@16
|
691 BOOST_UBLAS_INLINE
|
Chris@16
|
692 typename V::array_type::pointer base( vector_reference<V> &v ) {
|
Chris@16
|
693 return base( v.expression () ) ;
|
Chris@16
|
694 }
|
Chris@16
|
695
|
Chris@16
|
696 template < typename T, std::size_t N >
|
Chris@16
|
697 BOOST_UBLAS_INLINE
|
Chris@16
|
698 typename c_vector<T, N>::array_type::const_pointer base( const c_vector<T, N> &v ) {
|
Chris@16
|
699 return v.data() ;
|
Chris@16
|
700 }
|
Chris@16
|
701 template < typename T, std::size_t N >
|
Chris@16
|
702 BOOST_UBLAS_INLINE
|
Chris@16
|
703 typename c_vector<T, N>::array_type::const_pointer base_const( const c_vector<T, N> &v ) {
|
Chris@16
|
704 return v.data() ;
|
Chris@16
|
705 }
|
Chris@16
|
706 template < typename T, std::size_t N >
|
Chris@16
|
707 BOOST_UBLAS_INLINE
|
Chris@16
|
708 typename c_vector<T, N>::pointer base( c_vector<T, N> &v ) {
|
Chris@16
|
709 return v.data() ;
|
Chris@16
|
710 }
|
Chris@16
|
711
|
Chris@16
|
712 template < typename V >
|
Chris@16
|
713 BOOST_UBLAS_INLINE
|
Chris@16
|
714 typename V::array_type::const_pointer base( const vector_range<V> &v ) {
|
Chris@16
|
715 return base( v.data() ) ;
|
Chris@16
|
716 }
|
Chris@16
|
717 template < typename V >
|
Chris@16
|
718 BOOST_UBLAS_INLINE
|
Chris@16
|
719 typename V::array_type::const_pointer base( const vector_slice<V> &v ) {
|
Chris@16
|
720 return base( v.data() ) ;
|
Chris@16
|
721 }
|
Chris@16
|
722 template < typename V >
|
Chris@16
|
723 BOOST_UBLAS_INLINE
|
Chris@16
|
724 typename V::array_type::const_pointer base_const( const vector_range<V> &v ) {
|
Chris@16
|
725 return base_const( v.data() ) ;
|
Chris@16
|
726 }
|
Chris@16
|
727 template < typename V >
|
Chris@16
|
728 BOOST_UBLAS_INLINE
|
Chris@16
|
729 typename V::array_type::const_pointer base_const( const vector_slice<V> &v ) {
|
Chris@16
|
730 return base_const( v.data() ) ;
|
Chris@16
|
731 }
|
Chris@16
|
732 template < typename V >
|
Chris@16
|
733 BOOST_UBLAS_INLINE
|
Chris@16
|
734 typename V::array_type::pointer base( vector_range<V> &v ) {
|
Chris@16
|
735 return base( v.data() ) ;
|
Chris@16
|
736 }
|
Chris@16
|
737 template < typename V >
|
Chris@16
|
738 BOOST_UBLAS_INLINE
|
Chris@16
|
739 typename V::array_type::pointer base( vector_slice<V> &v ) {
|
Chris@16
|
740 return base( v.data() ) ;
|
Chris@16
|
741 }
|
Chris@16
|
742
|
Chris@16
|
743 template < typename M >
|
Chris@16
|
744 BOOST_UBLAS_INLINE
|
Chris@16
|
745 typename M::array_type::const_pointer base( const matrix_reference<M> &m ) {
|
Chris@16
|
746 return base( m.expression () ) ;
|
Chris@16
|
747 }
|
Chris@16
|
748 template < typename M >
|
Chris@16
|
749 BOOST_UBLAS_INLINE
|
Chris@16
|
750 typename M::array_type::const_pointer base_const( const matrix_reference<M> &m ) {
|
Chris@16
|
751 return base_const( m.expression () ) ;
|
Chris@16
|
752 }
|
Chris@16
|
753 template < typename M >
|
Chris@16
|
754 BOOST_UBLAS_INLINE
|
Chris@16
|
755 typename M::array_type::pointer base( matrix_reference<M> &m ) {
|
Chris@16
|
756 return base( m.expression () ) ;
|
Chris@16
|
757 }
|
Chris@16
|
758
|
Chris@16
|
759 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
760 BOOST_UBLAS_INLINE
|
Chris@16
|
761 typename c_matrix<T, M, N>::array_type::const_pointer base( const c_matrix<T, M, N> &m ) {
|
Chris@16
|
762 return m.data() ;
|
Chris@16
|
763 }
|
Chris@16
|
764 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
765 BOOST_UBLAS_INLINE
|
Chris@16
|
766 typename c_matrix<T, M, N>::array_type::const_pointer base_const( const c_matrix<T, M, N> &m ) {
|
Chris@16
|
767 return m.data() ;
|
Chris@16
|
768 }
|
Chris@16
|
769 template < typename T, std::size_t M, std::size_t N >
|
Chris@16
|
770 BOOST_UBLAS_INLINE
|
Chris@16
|
771 typename c_matrix<T, M, N>::pointer base( c_matrix<T, M, N> &m ) {
|
Chris@16
|
772 return m.data() ;
|
Chris@16
|
773 }
|
Chris@16
|
774
|
Chris@16
|
775 template < typename M >
|
Chris@16
|
776 BOOST_UBLAS_INLINE
|
Chris@16
|
777 typename M::array_type::const_pointer base( const matrix_row<M> &v ) {
|
Chris@16
|
778 return base( v.data() ) ;
|
Chris@16
|
779 }
|
Chris@16
|
780 template < typename M >
|
Chris@16
|
781 BOOST_UBLAS_INLINE
|
Chris@16
|
782 typename M::array_type::const_pointer base( const matrix_column<M> &v ) {
|
Chris@16
|
783 return base( v.data() ) ;
|
Chris@16
|
784 }
|
Chris@16
|
785 template < typename M >
|
Chris@16
|
786 BOOST_UBLAS_INLINE
|
Chris@16
|
787 typename M::array_type::const_pointer base_const( const matrix_row<M> &v ) {
|
Chris@16
|
788 return base_const( v.data() ) ;
|
Chris@16
|
789 }
|
Chris@16
|
790 template < typename M >
|
Chris@16
|
791 BOOST_UBLAS_INLINE
|
Chris@16
|
792 typename M::array_type::const_pointer base_const( const matrix_column<M> &v ) {
|
Chris@16
|
793 return base_const( v.data() ) ;
|
Chris@16
|
794 }
|
Chris@16
|
795 template < typename M >
|
Chris@16
|
796 BOOST_UBLAS_INLINE
|
Chris@16
|
797 typename M::array_type::pointer base( matrix_row<M> &v ) {
|
Chris@16
|
798 return base( v.data() ) ;
|
Chris@16
|
799 }
|
Chris@16
|
800 template < typename M >
|
Chris@16
|
801 BOOST_UBLAS_INLINE
|
Chris@16
|
802 typename M::array_type::pointer base( matrix_column<M> &v ) {
|
Chris@16
|
803 return base( v.data() ) ;
|
Chris@16
|
804 }
|
Chris@16
|
805
|
Chris@16
|
806 template < typename M >
|
Chris@16
|
807 BOOST_UBLAS_INLINE
|
Chris@16
|
808 typename M::array_type::const_pointer base( const matrix_range<M> &m ) {
|
Chris@16
|
809 return base( m.data() ) ;
|
Chris@16
|
810 }
|
Chris@16
|
811 template < typename M >
|
Chris@16
|
812 BOOST_UBLAS_INLINE
|
Chris@16
|
813 typename M::array_type::const_pointer base( const matrix_slice<M> &m ) {
|
Chris@16
|
814 return base( m.data() ) ;
|
Chris@16
|
815 }
|
Chris@16
|
816 template < typename M >
|
Chris@16
|
817 BOOST_UBLAS_INLINE
|
Chris@16
|
818 typename M::array_type::const_pointer base_const( const matrix_range<M> &m ) {
|
Chris@16
|
819 return base_const( m.data() ) ;
|
Chris@16
|
820 }
|
Chris@16
|
821 template < typename M >
|
Chris@16
|
822 BOOST_UBLAS_INLINE
|
Chris@16
|
823 typename M::array_type::const_pointer base_const( const matrix_slice<M> &m ) {
|
Chris@16
|
824 return base_const( m.data() ) ;
|
Chris@16
|
825 }
|
Chris@16
|
826 template < typename M >
|
Chris@16
|
827 BOOST_UBLAS_INLINE
|
Chris@16
|
828 typename M::array_type::pointer base( matrix_range<M> &m ) {
|
Chris@16
|
829 return base( m.data() ) ;
|
Chris@16
|
830 }
|
Chris@16
|
831 template < typename M >
|
Chris@16
|
832 BOOST_UBLAS_INLINE
|
Chris@16
|
833 typename M::array_type::pointer base( matrix_slice<M> &m ) {
|
Chris@16
|
834 return base( m.data() ) ;
|
Chris@16
|
835 }
|
Chris@16
|
836
|
Chris@16
|
837 template < typename MV >
|
Chris@16
|
838 BOOST_UBLAS_INLINE
|
Chris@16
|
839 typename MV::size_type start( const MV &mv ) {
|
Chris@16
|
840 return 0 ;
|
Chris@16
|
841 }
|
Chris@16
|
842
|
Chris@16
|
843 template < typename V >
|
Chris@16
|
844 BOOST_UBLAS_INLINE
|
Chris@16
|
845 typename V::size_type start( const vector_range<V> &v ) {
|
Chris@16
|
846 return v.start() * stride (v.data() ) ;
|
Chris@16
|
847 }
|
Chris@16
|
848 template < typename V >
|
Chris@16
|
849 BOOST_UBLAS_INLINE
|
Chris@16
|
850 typename V::size_type start( const vector_slice<V> &v ) {
|
Chris@16
|
851 return v.start() * stride (v.data() ) ;
|
Chris@16
|
852 }
|
Chris@16
|
853
|
Chris@16
|
854 template < typename M >
|
Chris@16
|
855 BOOST_UBLAS_INLINE
|
Chris@16
|
856 typename M::size_type start( const matrix_row<M> &v ) {
|
Chris@16
|
857 return v.index() * stride1( v.data() ) ;
|
Chris@16
|
858 }
|
Chris@16
|
859 template < typename M >
|
Chris@16
|
860 BOOST_UBLAS_INLINE
|
Chris@16
|
861 typename M::size_type start( const matrix_column<M> &v ) {
|
Chris@16
|
862 return v.index() * stride2( v.data() ) ;
|
Chris@16
|
863 }
|
Chris@16
|
864
|
Chris@16
|
865 template < typename M >
|
Chris@16
|
866 BOOST_UBLAS_INLINE
|
Chris@16
|
867 typename M::size_type start( const matrix_range<M> &m ) {
|
Chris@16
|
868 return m.start1() * stride1( m.data () ) + m.start2() * stride2( m.data () ) ;
|
Chris@16
|
869 }
|
Chris@16
|
870 template < typename M >
|
Chris@16
|
871 BOOST_UBLAS_INLINE
|
Chris@16
|
872 typename M::size_type start( const matrix_slice<M> &m ) {
|
Chris@16
|
873 return m.start1() * stride1( m.data () ) + m.start2() * stride2( m.data () ) ;
|
Chris@16
|
874 }
|
Chris@16
|
875
|
Chris@16
|
876 }}}}
|
Chris@16
|
877
|
Chris@16
|
878 #endif
|