Chris@16
|
1 //
|
Chris@16
|
2 // Copyright (c) 2000-2002
|
Chris@16
|
3 // Joerg Walter, Mathias Koch
|
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 // The authors gratefully acknowledge the support of
|
Chris@16
|
10 // GeNeSys mbH & Co. KG in producing this work.
|
Chris@16
|
11 //
|
Chris@16
|
12
|
Chris@16
|
13 #ifndef _BOOST_UBLAS_CONCEPTS_
|
Chris@16
|
14 #define _BOOST_UBLAS_CONCEPTS_
|
Chris@16
|
15
|
Chris@16
|
16 #include <boost/concept_check.hpp>
|
Chris@16
|
17
|
Chris@16
|
18 // Concept checks based on ideas of Jeremy Siek
|
Chris@16
|
19
|
Chris@16
|
20 namespace boost { namespace numeric { namespace ublas {
|
Chris@16
|
21
|
Chris@16
|
22
|
Chris@16
|
23 template<class I>
|
Chris@16
|
24 struct Indexed1DIteratorConcept {
|
Chris@16
|
25 typedef I iterator_type;
|
Chris@16
|
26
|
Chris@16
|
27 void constraints () {
|
Chris@16
|
28 iterator_type it = iterator_type ();
|
Chris@16
|
29 // Index
|
Chris@16
|
30 it.index ();
|
Chris@16
|
31 }
|
Chris@16
|
32 };
|
Chris@16
|
33
|
Chris@16
|
34 template<class I>
|
Chris@16
|
35 struct IndexedBidirectional1DIteratorConcept {
|
Chris@16
|
36 typedef I iterator_type;
|
Chris@16
|
37
|
Chris@16
|
38 void constraints () {
|
Chris@16
|
39 function_requires< BidirectionalIteratorConcept<iterator_type> >();
|
Chris@16
|
40 function_requires< Indexed1DIteratorConcept<iterator_type> >();
|
Chris@16
|
41 }
|
Chris@16
|
42 };
|
Chris@16
|
43
|
Chris@16
|
44 template<class I>
|
Chris@16
|
45 struct Mutable_IndexedBidirectional1DIteratorConcept {
|
Chris@16
|
46 typedef I iterator_type;
|
Chris@16
|
47
|
Chris@16
|
48 void constraints () {
|
Chris@16
|
49 function_requires< Mutable_BidirectionalIteratorConcept<iterator_type> >();
|
Chris@16
|
50 function_requires< Indexed1DIteratorConcept<iterator_type> >();
|
Chris@16
|
51 }
|
Chris@16
|
52 };
|
Chris@16
|
53
|
Chris@16
|
54 template<class I>
|
Chris@16
|
55 struct IndexedRandomAccess1DIteratorConcept {
|
Chris@16
|
56 typedef I iterator_type;
|
Chris@16
|
57
|
Chris@16
|
58 void constraints () {
|
Chris@16
|
59 function_requires< RandomAccessIteratorConcept<iterator_type> >();
|
Chris@16
|
60 function_requires< Indexed1DIteratorConcept<iterator_type> >();
|
Chris@16
|
61 }
|
Chris@16
|
62 };
|
Chris@16
|
63
|
Chris@16
|
64 template<class I>
|
Chris@16
|
65 struct Mutable_IndexedRandomAccess1DIteratorConcept {
|
Chris@16
|
66 typedef I iterator_type;
|
Chris@16
|
67
|
Chris@16
|
68 void constraints () {
|
Chris@16
|
69 function_requires< Mutable_RandomAccessIteratorConcept<iterator_type> >();
|
Chris@16
|
70 function_requires< Indexed1DIteratorConcept<iterator_type> >();
|
Chris@16
|
71 }
|
Chris@16
|
72 };
|
Chris@16
|
73
|
Chris@16
|
74 template<class I>
|
Chris@16
|
75 struct Indexed2DIteratorConcept {
|
Chris@16
|
76 typedef I iterator_type;
|
Chris@16
|
77 typedef typename I::dual_iterator_type dual_iterator_type;
|
Chris@16
|
78 typedef typename I::dual_reverse_iterator_type dual_reverse_iterator_type;
|
Chris@16
|
79
|
Chris@16
|
80 void constraints () {
|
Chris@16
|
81 iterator_type it = iterator_type ();
|
Chris@16
|
82 // Indices
|
Chris@16
|
83 it.index1 ();
|
Chris@16
|
84 it.index2 ();
|
Chris@16
|
85 // Iterator begin/end
|
Chris@16
|
86 dual_iterator_type it_begin (it.begin ());
|
Chris@16
|
87 dual_iterator_type it_end (it.end ());
|
Chris@16
|
88 // Reverse iterator begin/end
|
Chris@16
|
89 dual_reverse_iterator_type it_rbegin (it.rbegin ());
|
Chris@16
|
90 dual_reverse_iterator_type it_rend (it.rend ());
|
Chris@16
|
91 ignore_unused_variable_warning (it_begin);
|
Chris@16
|
92 ignore_unused_variable_warning (it_end);
|
Chris@16
|
93 ignore_unused_variable_warning (it_rbegin);
|
Chris@16
|
94 ignore_unused_variable_warning (it_rend);
|
Chris@16
|
95 }
|
Chris@16
|
96 };
|
Chris@16
|
97
|
Chris@16
|
98 template<class I1, class I2>
|
Chris@16
|
99 struct IndexedBidirectional2DIteratorConcept {
|
Chris@16
|
100 typedef I1 subiterator1_type;
|
Chris@16
|
101 typedef I2 subiterator2_type;
|
Chris@16
|
102
|
Chris@16
|
103 void constraints () {
|
Chris@16
|
104 function_requires< BidirectionalIteratorConcept<subiterator1_type> >();
|
Chris@16
|
105 function_requires< BidirectionalIteratorConcept<subiterator2_type> >();
|
Chris@16
|
106 function_requires< Indexed2DIteratorConcept<subiterator1_type> >();
|
Chris@16
|
107 function_requires< Indexed2DIteratorConcept<subiterator2_type> >();
|
Chris@16
|
108 }
|
Chris@16
|
109 };
|
Chris@16
|
110
|
Chris@16
|
111 template<class I1, class I2>
|
Chris@16
|
112 struct Mutable_IndexedBidirectional2DIteratorConcept {
|
Chris@16
|
113 typedef I1 subiterator1_type;
|
Chris@16
|
114 typedef I2 subiterator2_type;
|
Chris@16
|
115
|
Chris@16
|
116 void constraints () {
|
Chris@16
|
117 function_requires< Mutable_BidirectionalIteratorConcept<subiterator1_type> >();
|
Chris@16
|
118 function_requires< Mutable_BidirectionalIteratorConcept<subiterator2_type> >();
|
Chris@16
|
119 function_requires< Indexed2DIteratorConcept<subiterator1_type> >();
|
Chris@16
|
120 function_requires< Indexed2DIteratorConcept<subiterator2_type> >();
|
Chris@16
|
121 }
|
Chris@16
|
122 };
|
Chris@16
|
123
|
Chris@16
|
124 template<class I1, class I2>
|
Chris@16
|
125 struct IndexedRandomAccess2DIteratorConcept {
|
Chris@16
|
126 typedef I1 subiterator1_type;
|
Chris@16
|
127 typedef I2 subiterator2_type;
|
Chris@16
|
128
|
Chris@16
|
129 void constraints () {
|
Chris@16
|
130 function_requires< RandomAccessIteratorConcept<subiterator1_type> >();
|
Chris@16
|
131 function_requires< RandomAccessIteratorConcept<subiterator2_type> >();
|
Chris@16
|
132 function_requires< Indexed2DIteratorConcept<subiterator1_type> >();
|
Chris@16
|
133 function_requires< Indexed2DIteratorConcept<subiterator2_type> >();
|
Chris@16
|
134 }
|
Chris@16
|
135 };
|
Chris@16
|
136
|
Chris@16
|
137 template<class I1, class I2>
|
Chris@16
|
138 struct Mutable_IndexedRandomAccess2DIteratorConcept {
|
Chris@16
|
139 typedef I1 subiterator1_type;
|
Chris@16
|
140 typedef I2 subiterator2_type;
|
Chris@16
|
141
|
Chris@16
|
142 void constraints () {
|
Chris@16
|
143 function_requires< Mutable_RandomAccessIteratorConcept<subiterator1_type> >();
|
Chris@16
|
144 function_requires< Mutable_RandomAccessIteratorConcept<subiterator2_type> >();
|
Chris@16
|
145 function_requires< Indexed2DIteratorConcept<subiterator1_type> >();
|
Chris@16
|
146 function_requires< Indexed2DIteratorConcept<subiterator2_type> >();
|
Chris@16
|
147 }
|
Chris@16
|
148 };
|
Chris@16
|
149
|
Chris@16
|
150 template<class C>
|
Chris@16
|
151 struct StorageArrayConcept {
|
Chris@16
|
152 typedef C container_type;
|
Chris@16
|
153 typedef typename C::size_type size_type;
|
Chris@16
|
154 typedef typename C::value_type value_type;
|
Chris@16
|
155
|
Chris@16
|
156 void constraints () {
|
Chris@16
|
157 function_requires< RandomAccessContainerConcept<container_type> >();
|
Chris@16
|
158 size_type n (0);
|
Chris@16
|
159 // Sizing constructor
|
Chris@16
|
160 container_type c = container_type (n);
|
Chris@16
|
161 // Initialised sizing constructor
|
Chris@16
|
162 container_type (n, value_type (5));
|
Chris@16
|
163 ignore_unused_variable_warning (c);
|
Chris@16
|
164 }
|
Chris@16
|
165 };
|
Chris@16
|
166
|
Chris@16
|
167 template<class C>
|
Chris@16
|
168 struct Mutable_StorageArrayConcept {
|
Chris@16
|
169 typedef C container_type;
|
Chris@16
|
170 typedef typename C::size_type size_type;
|
Chris@16
|
171 typedef typename C::value_type value_type;
|
Chris@16
|
172 typedef typename C::iterator iterator_type;
|
Chris@16
|
173
|
Chris@16
|
174 void constraints () {
|
Chris@16
|
175 function_requires< Mutable_RandomAccessContainerConcept<container_type> > ();
|
Chris@16
|
176 size_type n (0);
|
Chris@16
|
177 // Sizing constructor
|
Chris@16
|
178 container_type c = container_type (n);
|
Chris@16
|
179 // Initialised sizing constructor
|
Chris@16
|
180 c = container_type (n, value_type (3));
|
Chris@16
|
181 // Resize
|
Chris@16
|
182 c.resize (n, value_type (5));
|
Chris@16
|
183 // Resize - none preserving
|
Chris@16
|
184 c.resize (n);
|
Chris@16
|
185 }
|
Chris@16
|
186 };
|
Chris@16
|
187
|
Chris@16
|
188 template<class C>
|
Chris@16
|
189 struct StorageSparseConcept {
|
Chris@16
|
190 typedef C container_type;
|
Chris@16
|
191 typedef typename C::size_type size_type;
|
Chris@16
|
192
|
Chris@16
|
193 void constraints () {
|
Chris@16
|
194 function_requires< ReversibleContainerConcept<container_type> > ();
|
Chris@16
|
195 }
|
Chris@16
|
196 };
|
Chris@16
|
197
|
Chris@16
|
198 template<class C>
|
Chris@16
|
199 struct Mutable_StorageSparseConcept {
|
Chris@16
|
200 typedef C container_type;
|
Chris@16
|
201 typedef typename C::size_type size_type;
|
Chris@16
|
202 typedef typename C::value_type value_type;
|
Chris@16
|
203 typedef typename C::iterator iterator_type;
|
Chris@16
|
204
|
Chris@16
|
205 void constraints () {
|
Chris@16
|
206 // NOTE - Not Mutable_ReversibleContainerConcept
|
Chris@16
|
207 function_requires< ReversibleContainerConcept<container_type> >();
|
Chris@16
|
208 container_type c = container_type ();
|
Chris@16
|
209 value_type t = value_type ();
|
Chris@16
|
210 iterator_type it = iterator_type (), it1 = iterator_type (), it2 = iterator_type ();
|
Chris@16
|
211 // Insert
|
Chris@16
|
212 c.insert (it, t);
|
Chris@16
|
213 // Erase
|
Chris@16
|
214 c.erase (it);
|
Chris@16
|
215 // Range erase
|
Chris@16
|
216 c.erase (it1, it2);
|
Chris@16
|
217 // Clear
|
Chris@16
|
218 c.clear ();
|
Chris@16
|
219 }
|
Chris@16
|
220 };
|
Chris@16
|
221
|
Chris@16
|
222 template<class G>
|
Chris@16
|
223 struct IndexSetConcept {
|
Chris@16
|
224 typedef G generator_type;
|
Chris@16
|
225 typedef typename G::size_type size_type;
|
Chris@16
|
226 typedef typename G::value_type value_type;
|
Chris@16
|
227
|
Chris@16
|
228 void constraints () {
|
Chris@16
|
229 function_requires< AssignableConcept<generator_type> >();
|
Chris@16
|
230 function_requires< ReversibleContainerConcept<generator_type> >();
|
Chris@16
|
231 generator_type g = generator_type ();
|
Chris@16
|
232 size_type n (0);
|
Chris@16
|
233 value_type t;
|
Chris@16
|
234 // Element access
|
Chris@16
|
235 t = g (n);
|
Chris@16
|
236 ignore_unused_variable_warning (t);
|
Chris@16
|
237 }
|
Chris@16
|
238 };
|
Chris@16
|
239
|
Chris@16
|
240 /** \brief Scalar expression concept.
|
Chris@16
|
241 *
|
Chris@16
|
242 * requirements
|
Chris@16
|
243 * \li \c SE::value_type is the type of the scalar expression
|
Chris@16
|
244 * \li \c SE must be convertable to \c SE::value_type
|
Chris@16
|
245 * \li the constant \c SE::complexity must exist
|
Chris@16
|
246 *
|
Chris@16
|
247 * \param SE the type of the scalar expression
|
Chris@16
|
248 */
|
Chris@16
|
249 template<class SE>
|
Chris@16
|
250 struct ScalarExpressionConcept {
|
Chris@16
|
251 typedef SE scalar_expression_type;
|
Chris@16
|
252 typedef typename SE::value_type value_type;
|
Chris@16
|
253
|
Chris@16
|
254 static const unsigned complexity = SE::complexity;
|
Chris@16
|
255
|
Chris@16
|
256 void constraints () {
|
Chris@16
|
257 scalar_expression_type *sp;
|
Chris@16
|
258 scalar_expression_type s = *sp;
|
Chris@16
|
259 value_type t;
|
Chris@16
|
260 // Conversion
|
Chris@16
|
261 t = s;
|
Chris@16
|
262 ignore_unused_variable_warning (t);
|
Chris@16
|
263 }
|
Chris@16
|
264 };
|
Chris@16
|
265
|
Chris@16
|
266 /** \brief Vector expression concept.
|
Chris@16
|
267 *
|
Chris@16
|
268 * requirements
|
Chris@16
|
269 * \li \c VE::value_type is the type of the elements
|
Chris@16
|
270 * \li \c VE::const_reference The return type when accessing an element of a constant vector
|
Chris@16
|
271 * expression. Must be convertable to a \c value_type.
|
Chris@16
|
272 * \li \c VE::size_type is the (unsigned) type of the indices
|
Chris@16
|
273 * \li \c VE::difference_type is the (signed) type of distances between indices
|
Chris@16
|
274 * \li \c VE::category
|
Chris@16
|
275 *
|
Chris@16
|
276 * \li the constant \c SE::complexity must exist
|
Chris@16
|
277 *
|
Chris@16
|
278 * \param SE the type of the scalar expression
|
Chris@16
|
279 */
|
Chris@16
|
280 template<class VE>
|
Chris@16
|
281 struct VectorExpressionConcept {
|
Chris@16
|
282 typedef VE vector_expression_type;
|
Chris@16
|
283 typedef typename VE::type_category type_category;
|
Chris@16
|
284 typedef typename VE::size_type size_type;
|
Chris@16
|
285 typedef typename VE::difference_type difference_type;
|
Chris@16
|
286 typedef typename VE::value_type value_type;
|
Chris@16
|
287 typedef typename VE::const_reference const_reference;
|
Chris@16
|
288 typedef typename VE::const_iterator const_iterator_type;
|
Chris@16
|
289 typedef typename VE::const_reverse_iterator const_reverse_iterator_type;
|
Chris@16
|
290
|
Chris@16
|
291 void constraints () {
|
Chris@16
|
292 vector_expression_type *vp;
|
Chris@16
|
293 const vector_expression_type *cvp;
|
Chris@16
|
294 vector_expression_type v = *vp;
|
Chris@16
|
295 const vector_expression_type cv = *cvp;
|
Chris@16
|
296 size_type n (0), i (0);
|
Chris@16
|
297 value_type t;
|
Chris@16
|
298 // Find (internal?)
|
Chris@16
|
299 const_iterator_type cit (v.find (i));
|
Chris@16
|
300 // Beginning of range
|
Chris@16
|
301 const_iterator_type cit_begin (v.begin ());
|
Chris@16
|
302 // End of range
|
Chris@16
|
303 const_iterator_type cit_end (v.end ());
|
Chris@16
|
304 // Size
|
Chris@16
|
305 n = v.size ();
|
Chris@16
|
306 // Beginning of reverse range
|
Chris@16
|
307 const_reverse_iterator_type crit_begin (cv.rbegin ());
|
Chris@16
|
308 // End of reverse range
|
Chris@16
|
309 const_reverse_iterator_type crit_end (cv.rend ());
|
Chris@16
|
310 // Element access
|
Chris@16
|
311 t = v (i);
|
Chris@16
|
312 ignore_unused_variable_warning (n);
|
Chris@16
|
313 ignore_unused_variable_warning (cit);
|
Chris@16
|
314 ignore_unused_variable_warning (cit_begin);
|
Chris@16
|
315 ignore_unused_variable_warning (cit_end);
|
Chris@16
|
316 ignore_unused_variable_warning (crit_begin);
|
Chris@16
|
317 ignore_unused_variable_warning (crit_end);
|
Chris@16
|
318 ignore_unused_variable_warning (t);
|
Chris@16
|
319 }
|
Chris@16
|
320 };
|
Chris@16
|
321
|
Chris@16
|
322 template<class VE>
|
Chris@16
|
323 struct Mutable_VectorExpressionConcept {
|
Chris@16
|
324 typedef VE vector_expression_type;
|
Chris@16
|
325 typedef typename VE::size_type size_type;
|
Chris@16
|
326 typedef typename VE::value_type value_type;
|
Chris@16
|
327 typedef typename VE::iterator iterator_type;
|
Chris@16
|
328 typedef typename VE::reverse_iterator reverse_iterator_type;
|
Chris@16
|
329
|
Chris@16
|
330 void constraints () {
|
Chris@16
|
331 function_requires< AssignableConcept<vector_expression_type> >();
|
Chris@16
|
332 function_requires< VectorExpressionConcept<vector_expression_type> >();
|
Chris@16
|
333 vector_expression_type *vp;
|
Chris@16
|
334 vector_expression_type v = *vp, v1 = *vp, v2 = *vp;
|
Chris@16
|
335 size_type i (0);
|
Chris@16
|
336 value_type t = value_type ();
|
Chris@16
|
337 // Find (internal?)
|
Chris@16
|
338 iterator_type it (v.find (i));
|
Chris@16
|
339 // Beginning of range
|
Chris@16
|
340 iterator_type it_begin (v.begin ());
|
Chris@16
|
341 // End of range
|
Chris@16
|
342 iterator_type it_end (v.end ());
|
Chris@16
|
343 // Swap
|
Chris@16
|
344 v1.swap (v2);
|
Chris@16
|
345 // Beginning of reverse range
|
Chris@16
|
346 reverse_iterator_type rit_begin (v.rbegin ());
|
Chris@16
|
347 // End of reverse range
|
Chris@16
|
348 reverse_iterator_type rit_end (v.rend ());
|
Chris@16
|
349 // Assignments
|
Chris@16
|
350 v2 = v1;
|
Chris@16
|
351 v2.assign (v1);
|
Chris@16
|
352 v2 += v1;
|
Chris@16
|
353 v2.plus_assign (v1);
|
Chris@16
|
354 v2 -= v1;
|
Chris@16
|
355 v2.minus_assign (v1);
|
Chris@16
|
356 v *= t;
|
Chris@16
|
357 ignore_unused_variable_warning (it);
|
Chris@16
|
358 ignore_unused_variable_warning (it_begin);
|
Chris@16
|
359 ignore_unused_variable_warning (it_end);
|
Chris@16
|
360 ignore_unused_variable_warning (rit_begin);
|
Chris@16
|
361 ignore_unused_variable_warning (rit_end);
|
Chris@16
|
362 }
|
Chris@16
|
363 };
|
Chris@16
|
364
|
Chris@16
|
365 template<class ME>
|
Chris@16
|
366 struct MatrixExpressionConcept {
|
Chris@16
|
367 typedef ME matrix_expression_type;
|
Chris@16
|
368 typedef typename ME::type_category type_category;
|
Chris@16
|
369 typedef typename ME::size_type size_type;
|
Chris@16
|
370 typedef typename ME::value_type value_type;
|
Chris@16
|
371 typedef typename ME::const_iterator1 const_subiterator1_type;
|
Chris@16
|
372 typedef typename ME::const_iterator2 const_subiterator2_type;
|
Chris@16
|
373 typedef typename ME::const_reverse_iterator1 const_reverse_subiterator1_type;
|
Chris@16
|
374 typedef typename ME::const_reverse_iterator2 const_reverse_subiterator2_type;
|
Chris@16
|
375
|
Chris@16
|
376 void constraints () {
|
Chris@16
|
377 matrix_expression_type *mp;
|
Chris@16
|
378 const matrix_expression_type *cmp;
|
Chris@16
|
379 matrix_expression_type m = *mp;
|
Chris@16
|
380 const matrix_expression_type cm = *cmp;
|
Chris@16
|
381 size_type n (0), i (0), j (0);
|
Chris@16
|
382 value_type t;
|
Chris@16
|
383 // Find (internal?)
|
Chris@16
|
384 const_subiterator1_type cit1 (m.find1 (0, i, j));
|
Chris@16
|
385 const_subiterator2_type cit2 (m.find2 (0, i, j));
|
Chris@16
|
386 // Beginning of range
|
Chris@16
|
387 const_subiterator1_type cit1_begin (m.begin1 ());
|
Chris@16
|
388 const_subiterator2_type cit2_begin (m.begin2 ());
|
Chris@16
|
389 // End of range
|
Chris@16
|
390 const_subiterator1_type cit1_end (m.end1 ());
|
Chris@16
|
391 const_subiterator2_type cit2_end (m.end2 ());
|
Chris@16
|
392 // Size
|
Chris@16
|
393 n = m.size1 ();
|
Chris@16
|
394 n = m.size2 ();
|
Chris@16
|
395 // Beginning of reverse range
|
Chris@16
|
396 const_reverse_subiterator1_type crit1_begin (cm.rbegin1 ());
|
Chris@16
|
397 const_reverse_subiterator2_type crit2_begin (cm.rbegin2 ());
|
Chris@16
|
398 // End of reverse range
|
Chris@16
|
399 const_reverse_subiterator1_type crit1_end (cm.rend1 ());
|
Chris@16
|
400 const_reverse_subiterator2_type crit2_end (cm.rend2 ());
|
Chris@16
|
401 // Element access
|
Chris@16
|
402 t = m (i, j);
|
Chris@16
|
403 ignore_unused_variable_warning (n);
|
Chris@16
|
404 ignore_unused_variable_warning (cit1);
|
Chris@16
|
405 ignore_unused_variable_warning (cit2);
|
Chris@16
|
406 ignore_unused_variable_warning (cit1_begin);
|
Chris@16
|
407 ignore_unused_variable_warning (cit2_begin);
|
Chris@16
|
408 ignore_unused_variable_warning (cit1_end);
|
Chris@16
|
409 ignore_unused_variable_warning (cit2_end);
|
Chris@16
|
410 ignore_unused_variable_warning (crit1_begin);
|
Chris@16
|
411 ignore_unused_variable_warning (crit2_begin);
|
Chris@16
|
412 ignore_unused_variable_warning (crit1_end);
|
Chris@16
|
413 ignore_unused_variable_warning (crit2_end);
|
Chris@16
|
414 ignore_unused_variable_warning (t);
|
Chris@16
|
415 }
|
Chris@16
|
416 };
|
Chris@16
|
417
|
Chris@16
|
418 template<class ME>
|
Chris@16
|
419 struct Mutable_MatrixExpressionConcept {
|
Chris@16
|
420 typedef ME matrix_expression_type;
|
Chris@16
|
421 typedef typename ME::size_type size_type;
|
Chris@16
|
422 typedef typename ME::value_type value_type;
|
Chris@16
|
423 typedef typename ME::iterator1 subiterator1_type;
|
Chris@16
|
424 typedef typename ME::iterator2 subiterator2_type;
|
Chris@16
|
425 typedef typename ME::reverse_iterator1 reverse_subiterator1_type;
|
Chris@16
|
426 typedef typename ME::reverse_iterator2 reverse_subiterator2_type;
|
Chris@16
|
427
|
Chris@16
|
428 void constraints () {
|
Chris@16
|
429 function_requires< AssignableConcept<matrix_expression_type> >();
|
Chris@16
|
430 function_requires< MatrixExpressionConcept<matrix_expression_type> >();
|
Chris@16
|
431 matrix_expression_type *mp;
|
Chris@16
|
432 matrix_expression_type m = *mp, m1 = *mp, m2 = *mp;
|
Chris@16
|
433 size_type i (0), j (0);
|
Chris@16
|
434 value_type t = value_type ();
|
Chris@16
|
435 // Find (internal?)
|
Chris@16
|
436 subiterator1_type it1 (m.find1 (0, i, j));
|
Chris@16
|
437 subiterator2_type it2 (m.find2 (0, i, j));
|
Chris@16
|
438 // Beginning of range
|
Chris@16
|
439 subiterator1_type it1_begin (m.begin1 ());
|
Chris@16
|
440 subiterator2_type it2_begin (m.begin2 ());
|
Chris@16
|
441 // End of range
|
Chris@16
|
442 subiterator1_type it1_end (m.end1 ());
|
Chris@16
|
443 subiterator2_type it2_end (m.end2 ());
|
Chris@16
|
444 // Swap
|
Chris@16
|
445 m1.swap (m2);
|
Chris@16
|
446 // Beginning of reverse range
|
Chris@16
|
447 reverse_subiterator1_type rit1_begin (m.rbegin1 ());
|
Chris@16
|
448 reverse_subiterator2_type rit2_begin (m.rbegin2 ());
|
Chris@16
|
449 // End of reverse range
|
Chris@16
|
450 reverse_subiterator1_type rit1_end (m.rend1 ());
|
Chris@16
|
451 reverse_subiterator2_type rit2_end (m.rend2 ());
|
Chris@16
|
452 // Assignments
|
Chris@16
|
453 m2 = m1;
|
Chris@16
|
454 m2.assign (m1);
|
Chris@16
|
455 m2 += m1;
|
Chris@16
|
456 m2.plus_assign (m1);
|
Chris@16
|
457 m2 -= m1;
|
Chris@16
|
458 m2.minus_assign (m1);
|
Chris@16
|
459 m *= t;
|
Chris@16
|
460 ignore_unused_variable_warning (it1);
|
Chris@16
|
461 ignore_unused_variable_warning (it2);
|
Chris@16
|
462 ignore_unused_variable_warning (it1_begin);
|
Chris@16
|
463 ignore_unused_variable_warning (it2_begin);
|
Chris@16
|
464 ignore_unused_variable_warning (it1_end);
|
Chris@16
|
465 ignore_unused_variable_warning (it2_end);
|
Chris@16
|
466 ignore_unused_variable_warning (rit1_begin);
|
Chris@16
|
467 ignore_unused_variable_warning (rit2_begin);
|
Chris@16
|
468 ignore_unused_variable_warning (rit1_end);
|
Chris@16
|
469 ignore_unused_variable_warning (rit2_end);
|
Chris@16
|
470 }
|
Chris@16
|
471 };
|
Chris@16
|
472
|
Chris@16
|
473 template<class V>
|
Chris@16
|
474 struct VectorConcept {
|
Chris@16
|
475 typedef V vector_type;
|
Chris@16
|
476 typedef typename V::size_type size_type;
|
Chris@16
|
477 typedef typename V::value_type value_type;
|
Chris@16
|
478 typedef const value_type *const_pointer;
|
Chris@16
|
479
|
Chris@16
|
480 void constraints () {
|
Chris@16
|
481 function_requires< VectorExpressionConcept<vector_type> >();
|
Chris@16
|
482 size_type n (0);
|
Chris@16
|
483 size_type i (0);
|
Chris@16
|
484 // Sizing constructor
|
Chris@16
|
485 vector_type v (n);
|
Chris@16
|
486 // Element support
|
Chris@16
|
487 const_pointer p = v.find_element (i);
|
Chris@16
|
488
|
Chris@16
|
489 ignore_unused_variable_warning (p);
|
Chris@16
|
490 }
|
Chris@16
|
491 };
|
Chris@16
|
492
|
Chris@16
|
493 template<class V>
|
Chris@16
|
494 struct Mutable_VectorConcept {
|
Chris@16
|
495 typedef V vector_type;
|
Chris@16
|
496 typedef typename V::size_type size_type;
|
Chris@16
|
497 typedef typename V::value_type value_type;
|
Chris@16
|
498 typedef value_type *pointer;
|
Chris@16
|
499
|
Chris@16
|
500 void constraints () {
|
Chris@16
|
501 function_requires< VectorConcept<vector_type> >();
|
Chris@16
|
502 function_requires< DefaultConstructible<vector_type> >();
|
Chris@16
|
503 function_requires< Mutable_VectorExpressionConcept<vector_type> >();
|
Chris@16
|
504 size_type n (0);
|
Chris@16
|
505 value_type t = value_type ();
|
Chris@16
|
506 size_type i (0);
|
Chris@16
|
507 vector_type v;
|
Chris@16
|
508 // Element support
|
Chris@16
|
509 pointer p = v.find_element (i);
|
Chris@16
|
510 // Element assignment
|
Chris@16
|
511 value_type r = v.insert_element (i, t);
|
Chris@16
|
512 v.insert_element (i, t) = r;
|
Chris@16
|
513 // Zeroing
|
Chris@16
|
514 v.clear ();
|
Chris@16
|
515 // Resize
|
Chris@16
|
516 v.resize (n);
|
Chris@16
|
517
|
Chris@16
|
518 ignore_unused_variable_warning (p);
|
Chris@16
|
519 ignore_unused_variable_warning (r);
|
Chris@16
|
520 }
|
Chris@16
|
521 };
|
Chris@16
|
522
|
Chris@16
|
523 template<class V>
|
Chris@16
|
524 struct SparseVectorConcept {
|
Chris@16
|
525 typedef V vector_type;
|
Chris@16
|
526 typedef typename V::size_type size_type;
|
Chris@16
|
527
|
Chris@16
|
528 void constraints () {
|
Chris@16
|
529 function_requires< VectorConcept<vector_type> >();
|
Chris@16
|
530 }
|
Chris@16
|
531 };
|
Chris@16
|
532
|
Chris@16
|
533 template<class V>
|
Chris@16
|
534 struct Mutable_SparseVectorConcept {
|
Chris@16
|
535 typedef V vector_type;
|
Chris@16
|
536 typedef typename V::size_type size_type;
|
Chris@16
|
537 typedef typename V::value_type value_type;
|
Chris@16
|
538
|
Chris@16
|
539 void constraints () {
|
Chris@16
|
540 function_requires< SparseVectorConcept<vector_type> >();
|
Chris@16
|
541 function_requires< Mutable_VectorConcept<vector_type> >();
|
Chris@16
|
542 size_type i (0);
|
Chris@16
|
543 vector_type v;
|
Chris@16
|
544 // Element erasure
|
Chris@16
|
545 v.erase_element (i);
|
Chris@16
|
546 }
|
Chris@16
|
547 };
|
Chris@16
|
548
|
Chris@16
|
549 template<class M>
|
Chris@16
|
550 struct MatrixConcept {
|
Chris@16
|
551 typedef M matrix_type;
|
Chris@16
|
552 typedef typename M::size_type size_type;
|
Chris@16
|
553 typedef typename M::value_type value_type;
|
Chris@16
|
554 typedef const value_type *const_pointer;
|
Chris@16
|
555
|
Chris@16
|
556 void constraints () {
|
Chris@16
|
557 function_requires< MatrixExpressionConcept<matrix_type> >();
|
Chris@16
|
558 size_type n (0);
|
Chris@16
|
559 size_type i (0), j (0);
|
Chris@16
|
560 // Sizing constructor
|
Chris@16
|
561 matrix_type m (n, n);
|
Chris@16
|
562 // Element support
|
Chris@16
|
563 #ifndef SKIP_BAD
|
Chris@16
|
564 const_pointer p = m.find_element (i, j);
|
Chris@16
|
565 #else
|
Chris@16
|
566 const_pointer p;
|
Chris@16
|
567 ignore_unused_variable_warning (i);
|
Chris@16
|
568 ignore_unused_variable_warning (j);
|
Chris@16
|
569 #endif
|
Chris@16
|
570 ignore_unused_variable_warning (p);
|
Chris@16
|
571 }
|
Chris@16
|
572 };
|
Chris@16
|
573
|
Chris@16
|
574 template<class M>
|
Chris@16
|
575 struct Mutable_MatrixConcept {
|
Chris@16
|
576 typedef M matrix_type;
|
Chris@16
|
577 typedef typename M::size_type size_type;
|
Chris@16
|
578 typedef typename M::value_type value_type;
|
Chris@16
|
579 typedef value_type *pointer;
|
Chris@16
|
580
|
Chris@16
|
581 void constraints () {
|
Chris@16
|
582 function_requires< MatrixConcept<matrix_type> >();
|
Chris@16
|
583 function_requires< DefaultConstructible<matrix_type> >();
|
Chris@16
|
584 function_requires< Mutable_MatrixExpressionConcept<matrix_type> >();
|
Chris@16
|
585 size_type n (0);
|
Chris@16
|
586 value_type t = value_type ();
|
Chris@16
|
587 size_type i (0), j (0);
|
Chris@16
|
588 matrix_type m;
|
Chris@16
|
589 // Element support
|
Chris@16
|
590 #ifndef SKIP_BAD
|
Chris@16
|
591 pointer p = m.find_element (i, j);
|
Chris@16
|
592 ignore_unused_variable_warning (i);
|
Chris@16
|
593 ignore_unused_variable_warning (j);
|
Chris@16
|
594 #else
|
Chris@16
|
595 pointer p;
|
Chris@16
|
596 #endif
|
Chris@16
|
597 // Element assigment
|
Chris@16
|
598 value_type r = m.insert_element (i, j, t);
|
Chris@16
|
599 m.insert_element (i, j, t) = r;
|
Chris@16
|
600 // Zeroing
|
Chris@16
|
601 m.clear ();
|
Chris@16
|
602 // Resize
|
Chris@16
|
603 m.resize (n, n);
|
Chris@16
|
604 m.resize (n, n, false);
|
Chris@16
|
605
|
Chris@16
|
606 ignore_unused_variable_warning (p);
|
Chris@16
|
607 ignore_unused_variable_warning (r);
|
Chris@16
|
608 }
|
Chris@16
|
609 };
|
Chris@16
|
610
|
Chris@16
|
611 template<class M>
|
Chris@16
|
612 struct SparseMatrixConcept {
|
Chris@16
|
613 typedef M matrix_type;
|
Chris@16
|
614 typedef typename M::size_type size_type;
|
Chris@16
|
615
|
Chris@16
|
616 void constraints () {
|
Chris@16
|
617 function_requires< MatrixConcept<matrix_type> >();
|
Chris@16
|
618 }
|
Chris@16
|
619 };
|
Chris@16
|
620
|
Chris@16
|
621 template<class M>
|
Chris@16
|
622 struct Mutable_SparseMatrixConcept {
|
Chris@16
|
623 typedef M matrix_type;
|
Chris@16
|
624 typedef typename M::size_type size_type;
|
Chris@16
|
625 typedef typename M::value_type value_type;
|
Chris@16
|
626
|
Chris@16
|
627 void constraints () {
|
Chris@16
|
628 function_requires< SparseMatrixConcept<matrix_type> >();
|
Chris@16
|
629 function_requires< Mutable_MatrixConcept<matrix_type> >();
|
Chris@16
|
630 size_type i (0), j (0);
|
Chris@16
|
631 matrix_type m;
|
Chris@16
|
632 // Elemnent erasure
|
Chris@16
|
633 m.erase_element (i, j);
|
Chris@16
|
634 }
|
Chris@16
|
635 };
|
Chris@16
|
636
|
Chris@16
|
637 /** introduce anonymous namespace to make following functions
|
Chris@16
|
638 * local to the current compilation unit.
|
Chris@16
|
639 */
|
Chris@16
|
640 namespace {
|
Chris@16
|
641
|
Chris@101
|
642 // Replaced the ZeroElement and OneElement functions with the templated versions
|
Chris@101
|
643 // because the former where giving warnings with clang
|
Chris@16
|
644 template<class T>
|
Chris@16
|
645 T
|
Chris@101
|
646 ZeroElement (T) {
|
Chris@101
|
647 return T(0.0);
|
Chris@16
|
648 }
|
Chris@101
|
649
|
Chris@101
|
650 template<class T>
|
Chris@101
|
651 vector<T>
|
Chris@101
|
652 ZeroElement (vector<T>) {
|
Chris@101
|
653 return zero_vector<T> ();
|
Chris@16
|
654 }
|
Chris@101
|
655
|
Chris@101
|
656 template<class T>
|
Chris@101
|
657 matrix<T>
|
Chris@101
|
658 ZeroElement (matrix<T>) {
|
Chris@101
|
659 return zero_matrix<T> ();
|
Chris@16
|
660 }
|
Chris@16
|
661
|
Chris@16
|
662 template<class T>
|
Chris@16
|
663 T
|
Chris@101
|
664 OneElement (T) {
|
Chris@101
|
665 return T(0.0);
|
Chris@16
|
666 }
|
Chris@101
|
667
|
Chris@101
|
668 template<class T>
|
Chris@101
|
669 vector<T>
|
Chris@101
|
670 OneElement (vector<T>) {
|
Chris@101
|
671 return zero_vector<T> ();
|
Chris@16
|
672 }
|
Chris@101
|
673
|
Chris@101
|
674 template<class T>
|
Chris@101
|
675 matrix<T>
|
Chris@101
|
676 OneElement (matrix<T>) {
|
Chris@101
|
677 return identity_matrix<T> ();
|
Chris@16
|
678 }
|
Chris@101
|
679
|
Chris@101
|
680 // template<>
|
Chris@101
|
681 // float
|
Chris@101
|
682 // ZeroElement (float) {
|
Chris@101
|
683 // return 0.f;
|
Chris@101
|
684 // }
|
Chris@101
|
685 // template<>
|
Chris@101
|
686 // double
|
Chris@101
|
687 // ZeroElement (double) {
|
Chris@101
|
688 // return 0.;
|
Chris@101
|
689 // }
|
Chris@101
|
690 // template<>
|
Chris@101
|
691 // vector<float>
|
Chris@101
|
692 // ZeroElement (vector<float>) {
|
Chris@101
|
693 // return zero_vector<float> ();
|
Chris@101
|
694 // }
|
Chris@101
|
695 // template<>
|
Chris@101
|
696 // vector<double>
|
Chris@101
|
697 // ZeroElement (vector<double>) {
|
Chris@101
|
698 // return zero_vector<double> ();
|
Chris@101
|
699 // }
|
Chris@101
|
700 // template<>
|
Chris@101
|
701 // matrix<float>
|
Chris@101
|
702 // ZeroElement (matrix<float>) {
|
Chris@101
|
703 // return zero_matrix<float> ();
|
Chris@101
|
704 // }
|
Chris@101
|
705 // template<>
|
Chris@101
|
706 // matrix<double>
|
Chris@101
|
707 // ZeroElement (matrix<double>) {
|
Chris@101
|
708 // return zero_matrix<double> ();
|
Chris@101
|
709 // }
|
Chris@101
|
710 // template<>
|
Chris@101
|
711 // std::complex<float>
|
Chris@101
|
712 // ZeroElement (std::complex<float>) {
|
Chris@101
|
713 // return std::complex<float> (0.f);
|
Chris@101
|
714 // }
|
Chris@101
|
715 // template<>
|
Chris@101
|
716 // std::complex<double>
|
Chris@101
|
717 // ZeroElement (std::complex<double>) {
|
Chris@101
|
718 // return std::complex<double> (0.);
|
Chris@101
|
719 // }
|
Chris@101
|
720 // template<>
|
Chris@101
|
721 // vector<std::complex<float> >
|
Chris@101
|
722 // ZeroElement (vector<std::complex<float> >) {
|
Chris@101
|
723 // return zero_vector<std::complex<float> > ();
|
Chris@101
|
724 // }
|
Chris@101
|
725 // template<>
|
Chris@101
|
726 // vector<std::complex<double> >
|
Chris@101
|
727 // ZeroElement (vector<std::complex<double> >) {
|
Chris@101
|
728 // return zero_vector<std::complex<double> > ();
|
Chris@101
|
729 // }
|
Chris@101
|
730 // template<>
|
Chris@101
|
731 // matrix<std::complex<float> >
|
Chris@101
|
732 // ZeroElement (matrix<std::complex<float> >) {
|
Chris@101
|
733 // return zero_matrix<std::complex<float> > ();
|
Chris@101
|
734 // }
|
Chris@101
|
735 // template<>
|
Chris@101
|
736 // matrix<std::complex<double> >
|
Chris@101
|
737 // ZeroElement (matrix<std::complex<double> >) {
|
Chris@101
|
738 // return zero_matrix<std::complex<double> > ();
|
Chris@101
|
739 // }
|
Chris@101
|
740
|
Chris@101
|
741 // template<class T>
|
Chris@101
|
742 // T
|
Chris@101
|
743 // OneElement (T);
|
Chris@101
|
744 // template<>
|
Chris@101
|
745 // float
|
Chris@101
|
746 // OneElement (float) {
|
Chris@101
|
747 // return 1.f;
|
Chris@101
|
748 // }
|
Chris@101
|
749 // template<>
|
Chris@101
|
750 // double
|
Chris@101
|
751 // OneElement (double) {
|
Chris@101
|
752 // return 1.;
|
Chris@101
|
753 // }
|
Chris@101
|
754 // template<>
|
Chris@101
|
755 // matrix<float>
|
Chris@101
|
756 // OneElement (matrix<float>) {
|
Chris@101
|
757 // return identity_matrix<float> ();
|
Chris@101
|
758 // }
|
Chris@101
|
759 // template<>
|
Chris@101
|
760 // matrix<double>
|
Chris@101
|
761 // OneElement (matrix<double>) {
|
Chris@101
|
762 // return identity_matrix<double> ();
|
Chris@101
|
763 // }
|
Chris@101
|
764 // template<>
|
Chris@101
|
765 // std::complex<float>
|
Chris@101
|
766 // OneElement (std::complex<float>) {
|
Chris@101
|
767 // return std::complex<float> (1.f);
|
Chris@101
|
768 // }
|
Chris@101
|
769 // template<>
|
Chris@101
|
770 // std::complex<double>
|
Chris@101
|
771 // OneElement (std::complex<double>) {
|
Chris@101
|
772 // return std::complex<double> (1.);
|
Chris@101
|
773 // }
|
Chris@101
|
774 // template<>
|
Chris@101
|
775 // matrix<std::complex<float> >
|
Chris@101
|
776 // OneElement (matrix<std::complex<float> >) {
|
Chris@101
|
777 // return identity_matrix<std::complex<float> > ();
|
Chris@101
|
778 // }
|
Chris@101
|
779 // template<>
|
Chris@101
|
780 // matrix<std::complex<double> >
|
Chris@101
|
781 // OneElement (matrix<std::complex<double> >) {
|
Chris@101
|
782 // return identity_matrix<std::complex<double> > ();
|
Chris@101
|
783 // }
|
Chris@16
|
784
|
Chris@16
|
785 template<class E1, class E2>
|
Chris@16
|
786 bool
|
Chris@16
|
787 operator == (const vector_expression<E1> &e1, const vector_expression<E2> &e2) {
|
Chris@16
|
788 typedef typename promote_traits<typename E1::value_type,
|
Chris@16
|
789 typename E2::value_type>::promote_type value_type;
|
Chris@16
|
790 typedef typename type_traits<value_type>::real_type real_type;
|
Chris@16
|
791 return norm_inf (e1 - e2) == real_type/*zero*/();
|
Chris@16
|
792 }
|
Chris@16
|
793 template<class E1, class E2>
|
Chris@16
|
794 bool
|
Chris@16
|
795 operator == (const matrix_expression<E1> &e1, const matrix_expression<E2> &e2) {
|
Chris@16
|
796 typedef typename promote_traits<typename E1::value_type,
|
Chris@16
|
797 typename E2::value_type>::promote_type value_type;
|
Chris@16
|
798 typedef typename type_traits<value_type>::real_type real_type;
|
Chris@16
|
799 return norm_inf (e1 - e2) == real_type/*zero*/();
|
Chris@16
|
800 }
|
Chris@16
|
801
|
Chris@16
|
802 template<class T>
|
Chris@16
|
803 struct AdditiveAbelianGroupConcept {
|
Chris@16
|
804 typedef T value_type;
|
Chris@16
|
805
|
Chris@16
|
806 void constraints () {
|
Chris@16
|
807 bool r;
|
Chris@16
|
808 value_type a = value_type (), b = value_type (), c = value_type ();
|
Chris@16
|
809 r = (a + b) + c == a + (b + c);
|
Chris@16
|
810 r = ZeroElement (value_type ()) + a == a;
|
Chris@16
|
811 r = a + ZeroElement (value_type ()) == a;
|
Chris@16
|
812 r = a + (- a) == ZeroElement (value_type ());
|
Chris@16
|
813 r = (- a) + a == ZeroElement (value_type ());
|
Chris@16
|
814 r = a + b == b + a;
|
Chris@16
|
815 ignore_unused_variable_warning (r);
|
Chris@16
|
816 }
|
Chris@16
|
817 };
|
Chris@16
|
818
|
Chris@16
|
819 template<class T>
|
Chris@16
|
820 struct MultiplicativeAbelianGroupConcept {
|
Chris@16
|
821 typedef T value_type;
|
Chris@16
|
822
|
Chris@16
|
823 void constraints () {
|
Chris@16
|
824 bool r;
|
Chris@16
|
825 value_type a = value_type (), b = value_type (), c = value_type ();
|
Chris@16
|
826 r = (a * b) * c == a * (b * c);
|
Chris@16
|
827 r = OneElement (value_type ()) * a == a;
|
Chris@16
|
828 r = a * OneElement (value_type ()) == a;
|
Chris@16
|
829 r = a * (OneElement (value_type ()) / a) == a;
|
Chris@16
|
830 r = (OneElement (value_type ()) / a) * a == a;
|
Chris@16
|
831 r = a * b == b * a;
|
Chris@16
|
832 ignore_unused_variable_warning (r);
|
Chris@16
|
833 }
|
Chris@16
|
834 };
|
Chris@16
|
835
|
Chris@16
|
836 template<class T>
|
Chris@16
|
837 struct RingWithIdentityConcept {
|
Chris@16
|
838 typedef T value_type;
|
Chris@16
|
839
|
Chris@16
|
840 void constraints () {
|
Chris@16
|
841 function_requires< AdditiveAbelianGroupConcept<value_type> >();
|
Chris@16
|
842 bool r;
|
Chris@16
|
843 value_type a = value_type (), b = value_type (), c = value_type ();
|
Chris@16
|
844 r = (a * b) * c == a * (b * c);
|
Chris@16
|
845 r = (a + b) * c == a * c + b * c;
|
Chris@16
|
846 r = OneElement (value_type ()) * a == a;
|
Chris@16
|
847 r = a * OneElement (value_type ()) == a;
|
Chris@16
|
848 ignore_unused_variable_warning (r);
|
Chris@16
|
849 }
|
Chris@16
|
850 };
|
Chris@16
|
851
|
Chris@16
|
852 template<class T>
|
Chris@16
|
853 struct Prod_RingWithIdentityConcept {
|
Chris@16
|
854 typedef T value_type;
|
Chris@16
|
855
|
Chris@16
|
856 void constraints () {
|
Chris@16
|
857 function_requires< AdditiveAbelianGroupConcept<value_type> >();
|
Chris@16
|
858 bool r;
|
Chris@16
|
859 value_type a = value_type (), b = value_type (), c = value_type ();
|
Chris@16
|
860 r = prod (T (prod (a, b)), c) == prod (a, T (prod (b, c)));
|
Chris@16
|
861 r = prod (a + b, c) == prod (a, c) + prod (b, c);
|
Chris@16
|
862 r = prod (OneElement (value_type ()), a) == a;
|
Chris@16
|
863 r = prod (a, OneElement (value_type ())) == a;
|
Chris@16
|
864 ignore_unused_variable_warning (r);
|
Chris@16
|
865 }
|
Chris@16
|
866 };
|
Chris@16
|
867
|
Chris@16
|
868 template<class T>
|
Chris@16
|
869 struct CommutativeRingWithIdentityConcept {
|
Chris@16
|
870 typedef T value_type;
|
Chris@16
|
871
|
Chris@16
|
872 void constraints () {
|
Chris@16
|
873 function_requires< RingWithIdentityConcept<value_type> >();
|
Chris@16
|
874 bool r;
|
Chris@16
|
875 value_type a = value_type (), b = value_type ();
|
Chris@16
|
876 r = a * b == b * a;
|
Chris@16
|
877 ignore_unused_variable_warning (r);
|
Chris@16
|
878 }
|
Chris@16
|
879 };
|
Chris@16
|
880
|
Chris@16
|
881 template<class T>
|
Chris@16
|
882 struct FieldConcept {
|
Chris@16
|
883 typedef T value_type;
|
Chris@16
|
884
|
Chris@16
|
885 void constraints () {
|
Chris@16
|
886 function_requires< CommutativeRingWithIdentityConcept<value_type> >();
|
Chris@16
|
887 bool r;
|
Chris@16
|
888 value_type a = value_type ();
|
Chris@16
|
889 r = a == ZeroElement (value_type ()) || a * (OneElement (value_type ()) / a) == a;
|
Chris@16
|
890 r = a == ZeroElement (value_type ()) || (OneElement (value_type ()) / a) * a == a;
|
Chris@16
|
891 ignore_unused_variable_warning (r);
|
Chris@16
|
892 }
|
Chris@16
|
893 };
|
Chris@16
|
894
|
Chris@16
|
895 template<class T, class V>
|
Chris@16
|
896 struct VectorSpaceConcept {
|
Chris@16
|
897 typedef T value_type;
|
Chris@16
|
898 typedef V vector_type;
|
Chris@16
|
899
|
Chris@16
|
900 void constraints () {
|
Chris@16
|
901 function_requires< FieldConcept<value_type> >();
|
Chris@16
|
902 function_requires< AdditiveAbelianGroupConcept<vector_type> >();
|
Chris@16
|
903 bool r;
|
Chris@16
|
904 value_type alpha = value_type (), beta = value_type ();
|
Chris@16
|
905 vector_type a = vector_type (), b = vector_type ();
|
Chris@16
|
906 r = alpha * (a + b) == alpha * a + alpha * b;
|
Chris@16
|
907 r = (alpha + beta) * a == alpha * a + beta * a;
|
Chris@16
|
908 r = (alpha * beta) * a == alpha * (beta * a);
|
Chris@16
|
909 r = OneElement (value_type ()) * a == a;
|
Chris@16
|
910 ignore_unused_variable_warning (r);
|
Chris@16
|
911 }
|
Chris@16
|
912 };
|
Chris@16
|
913
|
Chris@16
|
914 template<class T, class V, class M>
|
Chris@16
|
915 struct LinearOperatorConcept {
|
Chris@16
|
916 typedef T value_type;
|
Chris@16
|
917 typedef V vector_type;
|
Chris@16
|
918 typedef M matrix_type;
|
Chris@16
|
919
|
Chris@16
|
920 void constraints () {
|
Chris@16
|
921 function_requires< VectorSpaceConcept<value_type, vector_type> >();
|
Chris@16
|
922 bool r;
|
Chris@16
|
923 value_type alpha = value_type (), beta = value_type ();
|
Chris@16
|
924 vector_type a = vector_type (), b = vector_type ();
|
Chris@16
|
925 matrix_type A = matrix_type ();
|
Chris@16
|
926 r = prod (A, alpha * a + beta * b) == alpha * prod (A, a) + beta * prod (A, b);
|
Chris@16
|
927 ignore_unused_variable_warning (r);
|
Chris@16
|
928 }
|
Chris@16
|
929 };
|
Chris@16
|
930
|
Chris@101
|
931 inline void concept_checks () {
|
Chris@16
|
932
|
Chris@16
|
933 // Allow tests to be group to keep down compiler storage requirement
|
Chris@16
|
934 #ifdef INTERAL
|
Chris@16
|
935 #define INTERNAL_STORAGE
|
Chris@16
|
936 #define INTERNAL_VECTOR
|
Chris@16
|
937 #define INTERNAL_MATRIX
|
Chris@16
|
938 #define INTERNAL_SPECIAL
|
Chris@16
|
939 #define INTERNAL_SPARSE
|
Chris@16
|
940 #define INTERNAL_EXPRESSION
|
Chris@16
|
941 #endif
|
Chris@16
|
942
|
Chris@16
|
943 // TODO enable this for development
|
Chris@16
|
944 // #define VIEW_CONCEPTS
|
Chris@16
|
945
|
Chris@16
|
946 // Element value type for tests
|
Chris@16
|
947 typedef float T;
|
Chris@16
|
948
|
Chris@16
|
949 // Storage Array
|
Chris@16
|
950 #if defined (INTERNAL_STORAGE) || defined (INTERNAL_STORAGE_DENSE)
|
Chris@16
|
951 {
|
Chris@16
|
952 typedef std::vector<T> container_model;
|
Chris@16
|
953 function_requires< Mutable_StorageArrayConcept<container_model> >();
|
Chris@16
|
954 function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
955 function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
|
Chris@16
|
956 }
|
Chris@16
|
957
|
Chris@16
|
958 {
|
Chris@16
|
959 typedef bounded_array<T, 1> container_model;
|
Chris@16
|
960 function_requires< Mutable_StorageArrayConcept<container_model> >();
|
Chris@16
|
961 function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
962 function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
|
Chris@16
|
963 }
|
Chris@16
|
964
|
Chris@16
|
965 {
|
Chris@16
|
966 typedef unbounded_array<T> container_model;
|
Chris@16
|
967 function_requires< Mutable_StorageArrayConcept<container_model> >();
|
Chris@16
|
968 function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
969 function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
|
Chris@16
|
970 }
|
Chris@16
|
971
|
Chris@16
|
972 /* FIXME array_adaptors are in progress
|
Chris@16
|
973 {
|
Chris@16
|
974 typedef array_adaptor<T> container_model;
|
Chris@16
|
975 function_requires< Mutable_StorageArrayConcept<container_model> >();
|
Chris@16
|
976 function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
977 function_requires< Mutable_RandomAccessIteratorConcept<container_model::iterator> >();
|
Chris@16
|
978 }
|
Chris@16
|
979 */
|
Chris@16
|
980
|
Chris@16
|
981 {
|
Chris@16
|
982 typedef range container_model;
|
Chris@16
|
983 function_requires< IndexSetConcept<range> >();
|
Chris@16
|
984 function_requires< RandomAccessIteratorConcept<range::const_iterator> >();
|
Chris@16
|
985 }
|
Chris@16
|
986
|
Chris@16
|
987 {
|
Chris@16
|
988 typedef slice container_model;
|
Chris@16
|
989 function_requires< IndexSetConcept<range> >();
|
Chris@16
|
990 function_requires< RandomAccessIteratorConcept<range::const_iterator> >();
|
Chris@16
|
991 }
|
Chris@16
|
992
|
Chris@16
|
993 {
|
Chris@16
|
994 typedef indirect_array<> container_model;
|
Chris@16
|
995 function_requires< IndexSetConcept<range> >();
|
Chris@16
|
996 function_requires< RandomAccessIteratorConcept<range::const_iterator> >();
|
Chris@16
|
997 }
|
Chris@16
|
998 #endif
|
Chris@16
|
999
|
Chris@16
|
1000 // Storage Sparse
|
Chris@16
|
1001 #if defined (INTERNAL_STORAGE) || defined (INTERNAL_STORAGE_SPARSE)
|
Chris@16
|
1002 {
|
Chris@16
|
1003 typedef map_array<std::size_t, T> container_model;
|
Chris@16
|
1004 function_requires< Mutable_StorageSparseConcept<container_model> >();
|
Chris@16
|
1005 function_requires< RandomAccessIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1006 function_requires< RandomAccessIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1007 }
|
Chris@16
|
1008
|
Chris@16
|
1009 {
|
Chris@16
|
1010 typedef std::map<std::size_t, T> container_model;
|
Chris@16
|
1011 function_requires< Mutable_StorageSparseConcept<container_model > >();
|
Chris@16
|
1012 function_requires< BidirectionalIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1013 function_requires< BidirectionalIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1014 }
|
Chris@16
|
1015 #endif
|
Chris@16
|
1016
|
Chris@16
|
1017 #ifdef VIEW_CONCEPTS
|
Chris@16
|
1018 // read only vectors
|
Chris@16
|
1019 {
|
Chris@16
|
1020 typedef vector_view<T> container_model;
|
Chris@16
|
1021 function_requires< RandomAccessContainerConcept<container_model> >();
|
Chris@16
|
1022 function_requires< VectorConcept<container_model> >();
|
Chris@16
|
1023 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1024 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1025 }
|
Chris@16
|
1026 #endif
|
Chris@16
|
1027
|
Chris@16
|
1028 // Vector
|
Chris@16
|
1029 #if defined (INTERNAL_VECTOR) || defined (INTERNAL_VECTOR_DENSE)
|
Chris@16
|
1030 {
|
Chris@16
|
1031 typedef vector<T> container_model;
|
Chris@16
|
1032 function_requires< RandomAccessContainerConcept<container_model> >();
|
Chris@16
|
1033 function_requires< Mutable_VectorConcept<container_model> >();
|
Chris@16
|
1034 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1035 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1036 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1037 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1038 }
|
Chris@16
|
1039
|
Chris@16
|
1040 {
|
Chris@16
|
1041 typedef zero_vector<T> container_model;
|
Chris@16
|
1042 function_requires< VectorConcept<container_model> >();
|
Chris@16
|
1043 function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1044 function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1045 }
|
Chris@16
|
1046
|
Chris@16
|
1047 {
|
Chris@16
|
1048 typedef unit_vector<T> container_model;
|
Chris@16
|
1049 function_requires< VectorConcept<container_model> >();
|
Chris@16
|
1050 function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1051 function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1052 }
|
Chris@16
|
1053
|
Chris@16
|
1054 {
|
Chris@16
|
1055 typedef scalar_vector<T> container_model;
|
Chris@16
|
1056 function_requires< VectorConcept<container_model> >();
|
Chris@16
|
1057 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1058 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1059 }
|
Chris@16
|
1060
|
Chris@16
|
1061 {
|
Chris@16
|
1062 typedef c_vector<T, 1> container_model;
|
Chris@16
|
1063 function_requires< Mutable_VectorConcept<container_model> >();
|
Chris@16
|
1064 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1065 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1066 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1067 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1068 }
|
Chris@16
|
1069 #endif
|
Chris@16
|
1070
|
Chris@16
|
1071 // Vector Proxies
|
Chris@16
|
1072 #if defined (INTERNAL_VECTOR) || defined (INTERNAL_VECTOR_PROXY)
|
Chris@16
|
1073 {
|
Chris@16
|
1074 typedef vector_range<vector<T> > container_model;
|
Chris@16
|
1075 function_requires< Mutable_VectorExpressionConcept<container_model> >();
|
Chris@16
|
1076 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1077 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1078 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1079 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1080 }
|
Chris@16
|
1081
|
Chris@16
|
1082 {
|
Chris@16
|
1083 typedef vector_slice<vector<T> > container_model;
|
Chris@16
|
1084 function_requires< Mutable_VectorExpressionConcept<container_model> >();
|
Chris@16
|
1085 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1086 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1087 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1088 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1089 }
|
Chris@16
|
1090
|
Chris@16
|
1091 {
|
Chris@16
|
1092 typedef vector_indirect<vector<T> > container_model;
|
Chris@16
|
1093 function_requires< Mutable_VectorExpressionConcept<container_model> >();
|
Chris@16
|
1094 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1095 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1096 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1097 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1098 }
|
Chris@16
|
1099 #endif
|
Chris@16
|
1100
|
Chris@16
|
1101 // Sparse Vector
|
Chris@16
|
1102 #if defined (INTERNAL_SPARSE) || defined (INTERNAL_VECTOR_SPARSE)
|
Chris@16
|
1103 {
|
Chris@16
|
1104 typedef mapped_vector<T> container_model;
|
Chris@16
|
1105 function_requires< Mutable_SparseVectorConcept<container_model> >();
|
Chris@16
|
1106 function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1107 function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1108 function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1109 function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1110 }
|
Chris@16
|
1111
|
Chris@16
|
1112 {
|
Chris@16
|
1113 typedef compressed_vector<T> container_model;
|
Chris@16
|
1114 function_requires< Mutable_SparseVectorConcept<container_model> >();
|
Chris@16
|
1115 function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1116 function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1117 function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1118 function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1119 }
|
Chris@16
|
1120
|
Chris@16
|
1121 {
|
Chris@16
|
1122 typedef coordinate_vector<T> container_model;
|
Chris@16
|
1123 function_requires< Mutable_SparseVectorConcept<container_model> >();
|
Chris@16
|
1124 function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1125 function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1126 function_requires< IndexedBidirectional1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1127 function_requires< Mutable_IndexedBidirectional1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1128 }
|
Chris@16
|
1129 #endif
|
Chris@16
|
1130
|
Chris@16
|
1131 // Matrix
|
Chris@16
|
1132 #if defined (INTERNAL_MATRIX) || defined (INTERNAL_MATRIX_DENSE)
|
Chris@16
|
1133 {
|
Chris@16
|
1134 typedef matrix<T> container_model;
|
Chris@16
|
1135 function_requires< Mutable_MatrixConcept<matrix<T> > >();
|
Chris@16
|
1136 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1137 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1138 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1139 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1140 }
|
Chris@16
|
1141
|
Chris@16
|
1142 {
|
Chris@16
|
1143 typedef vector_of_vector<T> container_model;
|
Chris@16
|
1144 function_requires< Mutable_MatrixConcept<matrix<T> > >();
|
Chris@16
|
1145 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1146 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1147 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1148 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1149 }
|
Chris@16
|
1150
|
Chris@16
|
1151 {
|
Chris@16
|
1152 typedef zero_matrix<T> container_model;
|
Chris@16
|
1153 function_requires< Mutable_MatrixConcept<matrix<T> > >();
|
Chris@16
|
1154 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1155 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1156 }
|
Chris@16
|
1157
|
Chris@16
|
1158 {
|
Chris@16
|
1159 typedef identity_matrix<T> container_model;
|
Chris@16
|
1160 function_requires< Mutable_MatrixConcept<matrix<T> > >();
|
Chris@16
|
1161 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1162 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1163 }
|
Chris@16
|
1164
|
Chris@16
|
1165 {
|
Chris@16
|
1166 typedef scalar_matrix<T> container_model;
|
Chris@16
|
1167 function_requires< Mutable_MatrixConcept<matrix<T> > >();
|
Chris@16
|
1168 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1169 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1170 }
|
Chris@16
|
1171
|
Chris@16
|
1172 {
|
Chris@16
|
1173 typedef c_matrix<T, 1, 1> container_model;
|
Chris@16
|
1174 function_requires< Mutable_MatrixConcept<matrix<T> > >();
|
Chris@16
|
1175 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1176 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1177 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1178 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1179 }
|
Chris@16
|
1180 #endif
|
Chris@16
|
1181
|
Chris@16
|
1182 // Matrix Proxies
|
Chris@16
|
1183 #if defined (INTERNAL_MATRIX) || defined (INTERNAL_MATRIX_PROXY)
|
Chris@16
|
1184 {
|
Chris@16
|
1185 typedef matrix_row<matrix<T> > container_model;
|
Chris@16
|
1186 function_requires< Mutable_VectorExpressionConcept<container_model> >();
|
Chris@16
|
1187 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1188 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1189 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1190 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1191 }
|
Chris@16
|
1192
|
Chris@16
|
1193 {
|
Chris@16
|
1194 typedef matrix_column<matrix<T> > container_model;
|
Chris@16
|
1195 function_requires< Mutable_VectorExpressionConcept<container_model> >();
|
Chris@16
|
1196 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1197 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1198 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1199 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1200 }
|
Chris@16
|
1201
|
Chris@16
|
1202 {
|
Chris@16
|
1203 typedef matrix_vector_range<matrix<T> > container_model;
|
Chris@16
|
1204 function_requires< Mutable_VectorExpressionConcept<container_model> >();
|
Chris@16
|
1205 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1206 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1207 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1208 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1209 }
|
Chris@16
|
1210
|
Chris@16
|
1211 {
|
Chris@16
|
1212 typedef matrix_vector_slice<matrix<T> > container_model;
|
Chris@16
|
1213 function_requires< Mutable_VectorExpressionConcept<container_model> >();
|
Chris@16
|
1214 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1215 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1216 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1217 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1218 }
|
Chris@16
|
1219
|
Chris@16
|
1220 {
|
Chris@16
|
1221 typedef matrix_vector_indirect<matrix<T> > container_model;
|
Chris@16
|
1222 function_requires< Mutable_VectorExpressionConcept<container_model> >();
|
Chris@16
|
1223 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_iterator> >();
|
Chris@16
|
1224 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::iterator> >();
|
Chris@16
|
1225 function_requires< IndexedRandomAccess1DIteratorConcept<container_model::const_reverse_iterator> >();
|
Chris@16
|
1226 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<container_model::reverse_iterator> >();
|
Chris@16
|
1227 }
|
Chris@16
|
1228
|
Chris@16
|
1229 {
|
Chris@16
|
1230 typedef matrix_range<matrix<T> > container_model;
|
Chris@16
|
1231 function_requires< Mutable_MatrixExpressionConcept<container_model> >();
|
Chris@16
|
1232 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1233 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1234 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1235 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1236 }
|
Chris@16
|
1237
|
Chris@16
|
1238 {
|
Chris@16
|
1239 typedef matrix_slice<matrix<T> > container_model;
|
Chris@16
|
1240 function_requires< Mutable_MatrixExpressionConcept<container_model> >();
|
Chris@16
|
1241 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1242 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1243 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1244 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1245 }
|
Chris@16
|
1246
|
Chris@16
|
1247 {
|
Chris@16
|
1248 typedef matrix_indirect<matrix<T> > container_model;
|
Chris@16
|
1249 function_requires< Mutable_MatrixExpressionConcept<container_model> >();
|
Chris@16
|
1250 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1251 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1252 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1253 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1254 }
|
Chris@16
|
1255 #endif
|
Chris@16
|
1256
|
Chris@16
|
1257 // Banded Matrix
|
Chris@16
|
1258 #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_BANDED)
|
Chris@16
|
1259 {
|
Chris@16
|
1260 typedef banded_matrix<T> container_model;
|
Chris@16
|
1261 function_requires< Mutable_MatrixConcept<container_model> >();
|
Chris@16
|
1262 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1263 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1264 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1265 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1266 }
|
Chris@16
|
1267
|
Chris@16
|
1268 {
|
Chris@16
|
1269 typedef banded_adaptor<matrix<T> > container_model;
|
Chris@16
|
1270 function_requires< Mutable_MatrixExpressionConcept<container_model> >();
|
Chris@16
|
1271 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1272 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1273 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1274 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1275 }
|
Chris@16
|
1276 #endif
|
Chris@16
|
1277
|
Chris@16
|
1278 // Triangular Matrix
|
Chris@16
|
1279 #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_TRIANGULAR)
|
Chris@16
|
1280 {
|
Chris@16
|
1281 typedef triangular_matrix<T> container_model;
|
Chris@16
|
1282 function_requires< Mutable_MatrixConcept<container_model> >();
|
Chris@16
|
1283 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1284 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1285 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1286 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1287 }
|
Chris@16
|
1288
|
Chris@16
|
1289 {
|
Chris@16
|
1290 typedef triangular_adaptor<matrix<T> > container_model;
|
Chris@16
|
1291 function_requires< Mutable_MatrixExpressionConcept<container_model> >();
|
Chris@16
|
1292 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1293 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1294 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1295 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1296 }
|
Chris@16
|
1297 #endif
|
Chris@16
|
1298
|
Chris@16
|
1299 // Symmetric Matrix
|
Chris@16
|
1300 #if defined (INTERNA_SPECIAL) || defined (INTERNAL_SYMMETRIC)
|
Chris@16
|
1301 {
|
Chris@16
|
1302 typedef symmetric_matrix<T> container_model;
|
Chris@16
|
1303 function_requires< Mutable_MatrixConcept<container_model> >();
|
Chris@16
|
1304 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1305 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1306 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1307 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1308 }
|
Chris@16
|
1309
|
Chris@16
|
1310 {
|
Chris@16
|
1311 typedef banded_adaptor<matrix<T> > container_model;
|
Chris@16
|
1312 #ifndef SKIP_BAD
|
Chris@16
|
1313 // const_iterator (iterator) constructor is bad
|
Chris@16
|
1314 function_requires< Mutable_MatrixExpressionConcept<container_model> >();
|
Chris@16
|
1315 #endif
|
Chris@16
|
1316 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1317 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1318 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1319 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1320 }
|
Chris@16
|
1321 #endif
|
Chris@16
|
1322
|
Chris@16
|
1323 // Hermitian Matrix
|
Chris@16
|
1324 #if defined (INTERNAL_SPECIAL) || defined (INTERNAL_HERMITIAN)
|
Chris@16
|
1325 {
|
Chris@16
|
1326 typedef hermitian_matrix<T> container_model;
|
Chris@16
|
1327 function_requires< Mutable_MatrixConcept<container_model> >();
|
Chris@16
|
1328 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1329 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1330 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1331 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1332 }
|
Chris@16
|
1333
|
Chris@16
|
1334 {
|
Chris@16
|
1335 typedef hermitian_adaptor<matrix<T> > container_model;
|
Chris@16
|
1336 #ifndef SKIP_BAD
|
Chris@16
|
1337 // const_iterator (iterator) constructor is bad
|
Chris@16
|
1338 function_requires< Mutable_MatrixExpressionConcept<container_model> >();
|
Chris@16
|
1339 #endif
|
Chris@16
|
1340 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1341 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1342 function_requires< IndexedRandomAccess2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1343 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1344 }
|
Chris@16
|
1345 #endif
|
Chris@16
|
1346
|
Chris@16
|
1347 // Sparse Matrix
|
Chris@16
|
1348 #if defined (INTERNAL_SPARSE) || defined (INTERNAL_MATRIX_SPARSE)
|
Chris@16
|
1349 {
|
Chris@16
|
1350 typedef mapped_matrix<T> container_model;
|
Chris@16
|
1351 function_requires< Mutable_SparseMatrixConcept<container_model> >();
|
Chris@16
|
1352 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1353 function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1354 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1355 function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1356 }
|
Chris@16
|
1357 {
|
Chris@16
|
1358 typedef mapped_vector_of_mapped_vector<T> container_model;
|
Chris@16
|
1359 function_requires< Mutable_SparseMatrixConcept<container_model> >();
|
Chris@16
|
1360 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1361 function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1362 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1363 function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1364 }
|
Chris@16
|
1365 {
|
Chris@16
|
1366 typedef compressed_matrix<T> container_model;
|
Chris@16
|
1367 function_requires< Mutable_SparseMatrixConcept<container_model> >();
|
Chris@16
|
1368 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1369 function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1370 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1371 function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1372 }
|
Chris@16
|
1373 {
|
Chris@16
|
1374 typedef coordinate_matrix<T> container_model;
|
Chris@16
|
1375 function_requires< Mutable_SparseMatrixConcept<container_model> >();
|
Chris@16
|
1376 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1377 function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1378 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1379 function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1380 }
|
Chris@16
|
1381 {
|
Chris@16
|
1382 typedef generalized_vector_of_vector<T, row_major, vector< coordinate_vector<T> > > container_model;
|
Chris@16
|
1383 function_requires< Mutable_SparseMatrixConcept<container_model> >();
|
Chris@16
|
1384 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_iterator1, container_model::const_iterator2> >();
|
Chris@16
|
1385 function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::iterator1, container_model::iterator2> >();
|
Chris@16
|
1386 function_requires< IndexedBidirectional2DIteratorConcept<container_model::const_reverse_iterator1, container_model::const_reverse_iterator2> >();
|
Chris@16
|
1387 function_requires< Mutable_IndexedBidirectional2DIteratorConcept<container_model::reverse_iterator1, container_model::reverse_iterator2> >();
|
Chris@16
|
1388 }
|
Chris@16
|
1389
|
Chris@16
|
1390 #endif
|
Chris@16
|
1391
|
Chris@16
|
1392 // Scalar Expressions
|
Chris@16
|
1393 #if defined (INTERNAL_EXPRESSION) || defined (INTERNAL_VECTOR_EXPRESSION)
|
Chris@16
|
1394 function_requires< ScalarExpressionConcept<scalar_value<T> > >();
|
Chris@16
|
1395 function_requires< ScalarExpressionConcept<scalar_reference<T> > >();
|
Chris@16
|
1396
|
Chris@16
|
1397 // Vector Expressions
|
Chris@16
|
1398 {
|
Chris@16
|
1399 typedef vector_reference<vector<T> > expression_model;
|
Chris@16
|
1400 function_requires< VectorExpressionConcept<expression_model> >();
|
Chris@16
|
1401 function_requires< Mutable_VectorExpressionConcept<expression_model> >();
|
Chris@16
|
1402 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
|
Chris@16
|
1403 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<expression_model::iterator> >();
|
Chris@16
|
1404 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
|
Chris@16
|
1405 function_requires< Mutable_IndexedRandomAccess1DIteratorConcept<expression_model::reverse_iterator> >();
|
Chris@16
|
1406 }
|
Chris@16
|
1407
|
Chris@16
|
1408 {
|
Chris@16
|
1409 typedef vector_unary<vector<T>, scalar_identity<T> > expression_model;
|
Chris@16
|
1410 function_requires< VectorExpressionConcept<expression_model> >();
|
Chris@16
|
1411 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
|
Chris@16
|
1412 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
|
Chris@16
|
1413 }
|
Chris@16
|
1414
|
Chris@16
|
1415 {
|
Chris@16
|
1416 typedef vector_binary<vector<T>, vector<T>, scalar_plus<T, T> > expression_model;
|
Chris@16
|
1417 function_requires< VectorExpressionConcept<expression_model> >();
|
Chris@16
|
1418 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
|
Chris@16
|
1419 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
|
Chris@16
|
1420 }
|
Chris@16
|
1421
|
Chris@16
|
1422 {
|
Chris@16
|
1423 typedef vector_binary_scalar1<T, vector<T>, scalar_multiplies<T, T> > expression_model;
|
Chris@16
|
1424 function_requires< VectorExpressionConcept<expression_model> >();
|
Chris@16
|
1425 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
|
Chris@16
|
1426 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
|
Chris@16
|
1427 }
|
Chris@16
|
1428
|
Chris@16
|
1429 {
|
Chris@16
|
1430 typedef vector_binary_scalar2<vector<T>, scalar_value<T>, scalar_multiplies<T, T> > expression_model;
|
Chris@16
|
1431 function_requires< VectorExpressionConcept<expression_model> >();
|
Chris@16
|
1432 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
|
Chris@16
|
1433 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
|
Chris@16
|
1434 }
|
Chris@16
|
1435
|
Chris@16
|
1436 {
|
Chris@16
|
1437 typedef vector_binary_scalar1<scalar_value<T>, vector<T>, scalar_multiplies<T, T> > expression_model;
|
Chris@16
|
1438 function_requires< VectorExpressionConcept<expression_model> >();
|
Chris@16
|
1439 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
|
Chris@16
|
1440 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
|
Chris@16
|
1441 }
|
Chris@16
|
1442
|
Chris@16
|
1443 {
|
Chris@16
|
1444 typedef vector_binary_scalar2<vector<T>, scalar_value<T>, scalar_multiplies<T, T> > expression_model;
|
Chris@16
|
1445 function_requires< VectorExpressionConcept<expression_model> >();
|
Chris@16
|
1446 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
|
Chris@16
|
1447 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
|
Chris@16
|
1448 }
|
Chris@16
|
1449
|
Chris@16
|
1450 function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_sum<vector<T> > > > >();
|
Chris@16
|
1451 function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_1<vector<T> > > > >();
|
Chris@16
|
1452 function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_2<vector<T> > > > >();
|
Chris@16
|
1453 function_requires< ScalarExpressionConcept<vector_scalar_unary<vector<T>, vector_norm_inf<vector<T> > > > >();
|
Chris@16
|
1454
|
Chris@16
|
1455 function_requires< ScalarExpressionConcept<vector_scalar_binary<vector<T>, vector<T>, vector_inner_prod<vector<T>, vector<T>, T> > > >();
|
Chris@16
|
1456 #endif
|
Chris@16
|
1457
|
Chris@16
|
1458 // Matrix Expressions
|
Chris@16
|
1459 #if defined (INTERNAL_EXPRESSION) || defined (INTERNAL_MATRIX_EXPRESSION)
|
Chris@16
|
1460 {
|
Chris@16
|
1461 typedef matrix_reference<matrix<T> > expression_model;
|
Chris@16
|
1462 function_requires< MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1463 function_requires< Mutable_MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1464 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
|
Chris@16
|
1465 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<expression_model::iterator1, expression_model::iterator2> >();
|
Chris@16
|
1466 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
|
Chris@16
|
1467 function_requires< Mutable_IndexedRandomAccess2DIteratorConcept<expression_model::reverse_iterator1, expression_model::reverse_iterator2> >();
|
Chris@16
|
1468 }
|
Chris@16
|
1469
|
Chris@16
|
1470 {
|
Chris@16
|
1471 typedef vector_matrix_binary<vector<T>, vector<T>, scalar_multiplies<T, T> > expression_model;
|
Chris@16
|
1472 function_requires< MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1473 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
|
Chris@16
|
1474 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
|
Chris@16
|
1475 }
|
Chris@16
|
1476
|
Chris@16
|
1477 {
|
Chris@16
|
1478 typedef matrix_unary1<matrix<T>, scalar_identity<T> > expression_model;
|
Chris@16
|
1479 function_requires< MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1480 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
|
Chris@16
|
1481 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
|
Chris@16
|
1482 }
|
Chris@16
|
1483
|
Chris@16
|
1484 {
|
Chris@16
|
1485 typedef matrix_unary2<matrix<T>, scalar_identity<T> > expression_model;
|
Chris@16
|
1486 function_requires< MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1487 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
|
Chris@16
|
1488 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
|
Chris@16
|
1489 }
|
Chris@16
|
1490
|
Chris@16
|
1491 {
|
Chris@16
|
1492 typedef matrix_binary<matrix<T>, matrix<T>, scalar_plus<T, T> > expression_model;
|
Chris@16
|
1493 function_requires< MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1494 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
|
Chris@16
|
1495 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
|
Chris@16
|
1496 }
|
Chris@16
|
1497
|
Chris@16
|
1498 {
|
Chris@16
|
1499 typedef matrix_binary_scalar1<T, matrix<T>, scalar_multiplies<T, T> > expression_model;
|
Chris@16
|
1500 function_requires< MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1501 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
|
Chris@16
|
1502 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
|
Chris@16
|
1503 }
|
Chris@16
|
1504
|
Chris@16
|
1505 {
|
Chris@16
|
1506 typedef matrix_binary_scalar2<matrix<T>, T, scalar_multiplies<T, T> > expression_model;
|
Chris@16
|
1507 function_requires< MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1508 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
|
Chris@16
|
1509 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
|
Chris@16
|
1510 }
|
Chris@16
|
1511
|
Chris@16
|
1512 {
|
Chris@16
|
1513 typedef matrix_binary_scalar1<scalar_value<T>, matrix<T>, scalar_multiplies<T, T> > expression_model;
|
Chris@16
|
1514 function_requires< MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1515 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
|
Chris@16
|
1516 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
|
Chris@16
|
1517 }
|
Chris@16
|
1518
|
Chris@16
|
1519 {
|
Chris@16
|
1520 typedef matrix_binary_scalar2<matrix<T>, scalar_value<T>, scalar_multiplies<T, T> > expression_model;
|
Chris@16
|
1521 function_requires< MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1522 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
|
Chris@16
|
1523 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
|
Chris@16
|
1524 }
|
Chris@16
|
1525
|
Chris@16
|
1526 {
|
Chris@16
|
1527 typedef matrix_vector_binary1<matrix<T>, vector<T>, matrix_vector_prod1<matrix<T>, vector<T>, T> > expression_model;
|
Chris@16
|
1528 function_requires< VectorExpressionConcept<expression_model> >();
|
Chris@16
|
1529 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
|
Chris@16
|
1530 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
|
Chris@16
|
1531 }
|
Chris@16
|
1532
|
Chris@16
|
1533 {
|
Chris@16
|
1534 typedef matrix_vector_binary2<vector<T>, matrix<T>, matrix_vector_prod2<matrix<T>, vector<T>, T > > expression_model;
|
Chris@16
|
1535 function_requires< VectorExpressionConcept<expression_model> >();
|
Chris@16
|
1536 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_iterator> >();
|
Chris@16
|
1537 function_requires< IndexedRandomAccess1DIteratorConcept<expression_model::const_reverse_iterator> >();
|
Chris@16
|
1538 }
|
Chris@16
|
1539
|
Chris@16
|
1540 {
|
Chris@16
|
1541 typedef matrix_matrix_binary<matrix<T>, matrix<T>, matrix_matrix_prod<matrix<T>, matrix<T>, T > > expression_model;
|
Chris@16
|
1542 function_requires< MatrixExpressionConcept<expression_model> >();
|
Chris@16
|
1543 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_iterator1, expression_model::const_iterator2> >();
|
Chris@16
|
1544 function_requires< IndexedRandomAccess2DIteratorConcept<expression_model::const_reverse_iterator1, expression_model::const_reverse_iterator2> >();
|
Chris@16
|
1545 }
|
Chris@16
|
1546
|
Chris@16
|
1547 function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_1<vector<T> > > > >();
|
Chris@16
|
1548 function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_frobenius<vector<T> > > > >();
|
Chris@16
|
1549 function_requires< ScalarExpressionConcept<matrix_scalar_unary<matrix<T>, matrix_norm_inf<vector<T> > > > >();
|
Chris@16
|
1550 #endif
|
Chris@16
|
1551
|
Chris@16
|
1552 #ifdef EXTERNAL
|
Chris@101
|
1553 function_requires< AdditiveAbelianGroupConcept<T> >();
|
Chris@101
|
1554 function_requires< CommutativeRingWithIdentityConcept<T> >();
|
Chris@101
|
1555 function_requires< FieldConcept<T> >();
|
Chris@101
|
1556 function_requires< VectorSpaceConcept<T, vector<T> > >();
|
Chris@101
|
1557 function_requires< Prod_RingWithIdentityConcept<matrix<T> > >();
|
Chris@101
|
1558 function_requires< VectorSpaceConcept<T, matrix<T> > >();
|
Chris@101
|
1559 function_requires< LinearOperatorConcept<T, vector<T>, matrix<T> > >();
|
Chris@16
|
1560
|
Chris@101
|
1561 function_requires< AdditiveAbelianGroupConcept<std::complex<T> > >();
|
Chris@101
|
1562 function_requires< CommutativeRingWithIdentityConcept<std::complex<T> > >();
|
Chris@101
|
1563 function_requires< FieldConcept<std::complex<T> > >();
|
Chris@101
|
1564 function_requires< VectorSpaceConcept<std::complex<T>, vector<std::complex<T> > > >();
|
Chris@101
|
1565 function_requires< Prod_RingWithIdentityConcept<matrix<std::complex<T> > > >();
|
Chris@101
|
1566 function_requires< VectorSpaceConcept<std::complex<T>, matrix<std::complex<T> > > >();
|
Chris@101
|
1567 function_requires< LinearOperatorConcept<std::complex<T>, vector<std::complex<T> >, matrix<std::complex<T> > > >();
|
Chris@16
|
1568 #endif
|
Chris@16
|
1569 }
|
Chris@16
|
1570
|
Chris@16
|
1571 } // end of anonymous namespace
|
Chris@16
|
1572
|
Chris@16
|
1573 }}}
|
Chris@16
|
1574
|
Chris@16
|
1575 #endif
|