Chris@49
|
1 // Copyright (C) 2008-2013 NICTA (www.nicta.com.au)
|
Chris@49
|
2 // Copyright (C) 2008-2013 Conrad Sanderson
|
Chris@49
|
3 //
|
Chris@49
|
4 // This Source Code Form is subject to the terms of the Mozilla Public
|
Chris@49
|
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
|
Chris@49
|
6 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
Chris@49
|
7
|
Chris@49
|
8
|
Chris@49
|
9 //! \addtogroup traits
|
Chris@49
|
10 //! @{
|
Chris@49
|
11
|
Chris@49
|
12
|
Chris@49
|
13 template<typename T1>
|
Chris@49
|
14 struct get_pod_type
|
Chris@49
|
15 { typedef T1 result; };
|
Chris@49
|
16
|
Chris@49
|
17 template<typename T2>
|
Chris@49
|
18 struct get_pod_type< std::complex<T2> >
|
Chris@49
|
19 { typedef T2 result; };
|
Chris@49
|
20
|
Chris@49
|
21
|
Chris@49
|
22
|
Chris@49
|
23 template<typename T>
|
Chris@49
|
24 struct is_Mat_fixed_only
|
Chris@49
|
25 {
|
Chris@49
|
26 typedef char yes[1];
|
Chris@49
|
27 typedef char no[2];
|
Chris@49
|
28
|
Chris@49
|
29 template<typename X> static yes& check(typename X::Mat_fixed_type*);
|
Chris@49
|
30 template<typename> static no& check(...);
|
Chris@49
|
31
|
Chris@49
|
32 static const bool value = ( sizeof(check<T>(0)) == sizeof(yes) );
|
Chris@49
|
33 };
|
Chris@49
|
34
|
Chris@49
|
35
|
Chris@49
|
36
|
Chris@49
|
37 template<typename T>
|
Chris@49
|
38 struct is_Row_fixed_only
|
Chris@49
|
39 {
|
Chris@49
|
40 typedef char yes[1];
|
Chris@49
|
41 typedef char no[2];
|
Chris@49
|
42
|
Chris@49
|
43 template<typename X> static yes& check(typename X::Row_fixed_type*);
|
Chris@49
|
44 template<typename> static no& check(...);
|
Chris@49
|
45
|
Chris@49
|
46 static const bool value = ( sizeof(check<T>(0)) == sizeof(yes) );
|
Chris@49
|
47 };
|
Chris@49
|
48
|
Chris@49
|
49
|
Chris@49
|
50
|
Chris@49
|
51 template<typename T>
|
Chris@49
|
52 struct is_Col_fixed_only
|
Chris@49
|
53 {
|
Chris@49
|
54 typedef char yes[1];
|
Chris@49
|
55 typedef char no[2];
|
Chris@49
|
56
|
Chris@49
|
57 template<typename X> static yes& check(typename X::Col_fixed_type*);
|
Chris@49
|
58 template<typename> static no& check(...);
|
Chris@49
|
59
|
Chris@49
|
60 static const bool value = ( sizeof(check<T>(0)) == sizeof(yes) );
|
Chris@49
|
61 };
|
Chris@49
|
62
|
Chris@49
|
63
|
Chris@49
|
64
|
Chris@49
|
65 template<typename T>
|
Chris@49
|
66 struct is_Mat_fixed
|
Chris@49
|
67 { static const bool value = ( is_Mat_fixed_only<T>::value || is_Row_fixed_only<T>::value || is_Col_fixed_only<T>::value ); };
|
Chris@49
|
68
|
Chris@49
|
69
|
Chris@49
|
70
|
Chris@49
|
71 template<typename T>
|
Chris@49
|
72 struct is_Mat_only
|
Chris@49
|
73 { static const bool value = is_Mat_fixed_only<T>::value; };
|
Chris@49
|
74
|
Chris@49
|
75 template<typename eT>
|
Chris@49
|
76 struct is_Mat_only< Mat<eT> >
|
Chris@49
|
77 { static const bool value = true; };
|
Chris@49
|
78
|
Chris@49
|
79 template<typename eT>
|
Chris@49
|
80 struct is_Mat_only< const Mat<eT> >
|
Chris@49
|
81 { static const bool value = true; };
|
Chris@49
|
82
|
Chris@49
|
83
|
Chris@49
|
84
|
Chris@49
|
85 template<typename T>
|
Chris@49
|
86 struct is_Mat
|
Chris@49
|
87 { static const bool value = ( is_Mat_fixed_only<T>::value || is_Row_fixed_only<T>::value || is_Col_fixed_only<T>::value ); };
|
Chris@49
|
88
|
Chris@49
|
89 template<typename eT>
|
Chris@49
|
90 struct is_Mat< Mat<eT> >
|
Chris@49
|
91 { static const bool value = true; };
|
Chris@49
|
92
|
Chris@49
|
93 template<typename eT>
|
Chris@49
|
94 struct is_Mat< const Mat<eT> >
|
Chris@49
|
95 { static const bool value = true; };
|
Chris@49
|
96
|
Chris@49
|
97 template<typename eT>
|
Chris@49
|
98 struct is_Mat< Row<eT> >
|
Chris@49
|
99 { static const bool value = true; };
|
Chris@49
|
100
|
Chris@49
|
101 template<typename eT>
|
Chris@49
|
102 struct is_Mat< const Row<eT> >
|
Chris@49
|
103 { static const bool value = true; };
|
Chris@49
|
104
|
Chris@49
|
105 template<typename eT>
|
Chris@49
|
106 struct is_Mat< Col<eT> >
|
Chris@49
|
107 { static const bool value = true; };
|
Chris@49
|
108
|
Chris@49
|
109 template<typename eT>
|
Chris@49
|
110 struct is_Mat< const Col<eT> >
|
Chris@49
|
111 { static const bool value = true; };
|
Chris@49
|
112
|
Chris@49
|
113
|
Chris@49
|
114
|
Chris@49
|
115 template<typename T>
|
Chris@49
|
116 struct is_Row
|
Chris@49
|
117 { static const bool value = is_Row_fixed_only<T>::value; };
|
Chris@49
|
118
|
Chris@49
|
119 template<typename eT>
|
Chris@49
|
120 struct is_Row< Row<eT> >
|
Chris@49
|
121 { static const bool value = true; };
|
Chris@49
|
122
|
Chris@49
|
123 template<typename eT>
|
Chris@49
|
124 struct is_Row< const Row<eT> >
|
Chris@49
|
125 { static const bool value = true; };
|
Chris@49
|
126
|
Chris@49
|
127
|
Chris@49
|
128
|
Chris@49
|
129 template<typename T>
|
Chris@49
|
130 struct is_Col
|
Chris@49
|
131 { static const bool value = is_Col_fixed_only<T>::value; };
|
Chris@49
|
132
|
Chris@49
|
133 template<typename eT>
|
Chris@49
|
134 struct is_Col< Col<eT> >
|
Chris@49
|
135 { static const bool value = true; };
|
Chris@49
|
136
|
Chris@49
|
137 template<typename eT>
|
Chris@49
|
138 struct is_Col< const Col<eT> >
|
Chris@49
|
139 { static const bool value = true; };
|
Chris@49
|
140
|
Chris@49
|
141
|
Chris@49
|
142
|
Chris@49
|
143 template<typename T>
|
Chris@49
|
144 struct is_diagview
|
Chris@49
|
145 { static const bool value = false; };
|
Chris@49
|
146
|
Chris@49
|
147 template<typename eT>
|
Chris@49
|
148 struct is_diagview< diagview<eT> >
|
Chris@49
|
149 { static const bool value = true; };
|
Chris@49
|
150
|
Chris@49
|
151 template<typename eT>
|
Chris@49
|
152 struct is_diagview< const diagview<eT> >
|
Chris@49
|
153 { static const bool value = true; };
|
Chris@49
|
154
|
Chris@49
|
155
|
Chris@49
|
156 template<typename T>
|
Chris@49
|
157 struct is_subview
|
Chris@49
|
158 { static const bool value = false; };
|
Chris@49
|
159
|
Chris@49
|
160 template<typename eT>
|
Chris@49
|
161 struct is_subview< subview<eT> >
|
Chris@49
|
162 { static const bool value = true; };
|
Chris@49
|
163
|
Chris@49
|
164 template<typename eT>
|
Chris@49
|
165 struct is_subview< const subview<eT> >
|
Chris@49
|
166 { static const bool value = true; };
|
Chris@49
|
167
|
Chris@49
|
168
|
Chris@49
|
169 template<typename T>
|
Chris@49
|
170 struct is_subview_row
|
Chris@49
|
171 { static const bool value = false; };
|
Chris@49
|
172
|
Chris@49
|
173 template<typename eT>
|
Chris@49
|
174 struct is_subview_row< subview_row<eT> >
|
Chris@49
|
175 { static const bool value = true; };
|
Chris@49
|
176
|
Chris@49
|
177 template<typename eT>
|
Chris@49
|
178 struct is_subview_row< const subview_row<eT> >
|
Chris@49
|
179 { static const bool value = true; };
|
Chris@49
|
180
|
Chris@49
|
181
|
Chris@49
|
182 template<typename T>
|
Chris@49
|
183 struct is_subview_col
|
Chris@49
|
184 { static const bool value = false; };
|
Chris@49
|
185
|
Chris@49
|
186 template<typename eT>
|
Chris@49
|
187 struct is_subview_col< subview_col<eT> >
|
Chris@49
|
188 { static const bool value = true; };
|
Chris@49
|
189
|
Chris@49
|
190 template<typename eT>
|
Chris@49
|
191 struct is_subview_col< const subview_col<eT> >
|
Chris@49
|
192 { static const bool value = true; };
|
Chris@49
|
193
|
Chris@49
|
194
|
Chris@49
|
195 template<typename T>
|
Chris@49
|
196 struct is_subview_elem1
|
Chris@49
|
197 { static const bool value = false; };
|
Chris@49
|
198
|
Chris@49
|
199 template<typename eT, typename T1>
|
Chris@49
|
200 struct is_subview_elem1< subview_elem1<eT, T1> >
|
Chris@49
|
201 { static const bool value = true; };
|
Chris@49
|
202
|
Chris@49
|
203 template<typename eT, typename T1>
|
Chris@49
|
204 struct is_subview_elem1< const subview_elem1<eT, T1> >
|
Chris@49
|
205 { static const bool value = true; };
|
Chris@49
|
206
|
Chris@49
|
207
|
Chris@49
|
208 template<typename T>
|
Chris@49
|
209 struct is_subview_elem2
|
Chris@49
|
210 { static const bool value = false; };
|
Chris@49
|
211
|
Chris@49
|
212 template<typename eT, typename T1, typename T2>
|
Chris@49
|
213 struct is_subview_elem2< subview_elem2<eT, T1, T2> >
|
Chris@49
|
214 { static const bool value = true; };
|
Chris@49
|
215
|
Chris@49
|
216 template<typename eT, typename T1, typename T2>
|
Chris@49
|
217 struct is_subview_elem2< const subview_elem2<eT, T1, T2> >
|
Chris@49
|
218 { static const bool value = true; };
|
Chris@49
|
219
|
Chris@49
|
220
|
Chris@49
|
221
|
Chris@49
|
222 //
|
Chris@49
|
223 //
|
Chris@49
|
224 //
|
Chris@49
|
225
|
Chris@49
|
226
|
Chris@49
|
227
|
Chris@49
|
228 template<typename T>
|
Chris@49
|
229 struct is_Cube
|
Chris@49
|
230 { static const bool value = false; };
|
Chris@49
|
231
|
Chris@49
|
232 template<typename eT>
|
Chris@49
|
233 struct is_Cube< Cube<eT> >
|
Chris@49
|
234 { static const bool value = true; };
|
Chris@49
|
235
|
Chris@49
|
236 template<typename T>
|
Chris@49
|
237 struct is_subview_cube
|
Chris@49
|
238 { static const bool value = false; };
|
Chris@49
|
239
|
Chris@49
|
240 template<typename eT>
|
Chris@49
|
241 struct is_subview_cube< subview_cube<eT> >
|
Chris@49
|
242 { static const bool value = true; };
|
Chris@49
|
243
|
Chris@49
|
244
|
Chris@49
|
245
|
Chris@49
|
246 //
|
Chris@49
|
247 //
|
Chris@49
|
248 //
|
Chris@49
|
249
|
Chris@49
|
250
|
Chris@49
|
251 template<typename T>
|
Chris@49
|
252 struct is_Gen
|
Chris@49
|
253 { static const bool value = false; };
|
Chris@49
|
254
|
Chris@49
|
255 template<typename T1, typename gen_type>
|
Chris@49
|
256 struct is_Gen< Gen<T1,gen_type> >
|
Chris@49
|
257 { static const bool value = true; };
|
Chris@49
|
258
|
Chris@49
|
259 template<typename T1, typename gen_type>
|
Chris@49
|
260 struct is_Gen< const Gen<T1,gen_type> >
|
Chris@49
|
261 { static const bool value = true; };
|
Chris@49
|
262
|
Chris@49
|
263
|
Chris@49
|
264 template<typename T>
|
Chris@49
|
265 struct is_Op
|
Chris@49
|
266 { static const bool value = false; };
|
Chris@49
|
267
|
Chris@49
|
268 template<typename T1, typename op_type>
|
Chris@49
|
269 struct is_Op< Op<T1,op_type> >
|
Chris@49
|
270 { static const bool value = true; };
|
Chris@49
|
271
|
Chris@49
|
272 template<typename T1, typename op_type>
|
Chris@49
|
273 struct is_Op< const Op<T1,op_type> >
|
Chris@49
|
274 { static const bool value = true; };
|
Chris@49
|
275
|
Chris@49
|
276 template<typename T>
|
Chris@49
|
277 struct is_eOp
|
Chris@49
|
278 { static const bool value = false; };
|
Chris@49
|
279
|
Chris@49
|
280 template<typename T1, typename eop_type>
|
Chris@49
|
281 struct is_eOp< eOp<T1,eop_type> >
|
Chris@49
|
282 { static const bool value = true; };
|
Chris@49
|
283
|
Chris@49
|
284 template<typename T1, typename eop_type>
|
Chris@49
|
285 struct is_eOp< const eOp<T1,eop_type> >
|
Chris@49
|
286 { static const bool value = true; };
|
Chris@49
|
287
|
Chris@49
|
288
|
Chris@49
|
289 template<typename T>
|
Chris@49
|
290 struct is_mtOp
|
Chris@49
|
291 { static const bool value = false; };
|
Chris@49
|
292
|
Chris@49
|
293 template<typename eT, typename T1, typename op_type>
|
Chris@49
|
294 struct is_mtOp< mtOp<eT, T1, op_type> >
|
Chris@49
|
295 { static const bool value = true; };
|
Chris@49
|
296
|
Chris@49
|
297 template<typename eT, typename T1, typename op_type>
|
Chris@49
|
298 struct is_mtOp< const mtOp<eT, T1, op_type> >
|
Chris@49
|
299 { static const bool value = true; };
|
Chris@49
|
300
|
Chris@49
|
301
|
Chris@49
|
302 template<typename T>
|
Chris@49
|
303 struct is_Glue
|
Chris@49
|
304 { static const bool value = false; };
|
Chris@49
|
305
|
Chris@49
|
306 template<typename T1, typename T2, typename glue_type>
|
Chris@49
|
307 struct is_Glue< Glue<T1,T2,glue_type> >
|
Chris@49
|
308 { static const bool value = true; };
|
Chris@49
|
309
|
Chris@49
|
310 template<typename T1, typename T2, typename glue_type>
|
Chris@49
|
311 struct is_Glue< const Glue<T1,T2,glue_type> >
|
Chris@49
|
312 { static const bool value = true; };
|
Chris@49
|
313
|
Chris@49
|
314
|
Chris@49
|
315 template<typename T>
|
Chris@49
|
316 struct is_eGlue
|
Chris@49
|
317 { static const bool value = false; };
|
Chris@49
|
318
|
Chris@49
|
319 template<typename T1, typename T2, typename eglue_type>
|
Chris@49
|
320 struct is_eGlue< eGlue<T1,T2,eglue_type> >
|
Chris@49
|
321 { static const bool value = true; };
|
Chris@49
|
322
|
Chris@49
|
323 template<typename T1, typename T2, typename eglue_type>
|
Chris@49
|
324 struct is_eGlue< const eGlue<T1,T2,eglue_type> >
|
Chris@49
|
325 { static const bool value = true; };
|
Chris@49
|
326
|
Chris@49
|
327
|
Chris@49
|
328 template<typename T>
|
Chris@49
|
329 struct is_mtGlue
|
Chris@49
|
330 { static const bool value = false; };
|
Chris@49
|
331
|
Chris@49
|
332 template<typename eT, typename T1, typename T2, typename glue_type>
|
Chris@49
|
333 struct is_mtGlue< mtGlue<eT, T1, T2, glue_type> >
|
Chris@49
|
334 { static const bool value = true; };
|
Chris@49
|
335
|
Chris@49
|
336 template<typename eT, typename T1, typename T2, typename glue_type>
|
Chris@49
|
337 struct is_mtGlue< const mtGlue<eT, T1, T2, glue_type> >
|
Chris@49
|
338 { static const bool value = true; };
|
Chris@49
|
339
|
Chris@49
|
340
|
Chris@49
|
341 //
|
Chris@49
|
342 //
|
Chris@49
|
343
|
Chris@49
|
344
|
Chris@49
|
345 template<typename T>
|
Chris@49
|
346 struct is_glue_times
|
Chris@49
|
347 { static const bool value = false; };
|
Chris@49
|
348
|
Chris@49
|
349 template<typename T1, typename T2>
|
Chris@49
|
350 struct is_glue_times< Glue<T1,T2,glue_times> >
|
Chris@49
|
351 { static const bool value = true; };
|
Chris@49
|
352
|
Chris@49
|
353 template<typename T1, typename T2>
|
Chris@49
|
354 struct is_glue_times< const Glue<T1,T2,glue_times> >
|
Chris@49
|
355 { static const bool value = true; };
|
Chris@49
|
356
|
Chris@49
|
357
|
Chris@49
|
358 template<typename T>
|
Chris@49
|
359 struct is_glue_times_diag
|
Chris@49
|
360 { static const bool value = false; };
|
Chris@49
|
361
|
Chris@49
|
362 template<typename T1, typename T2>
|
Chris@49
|
363 struct is_glue_times_diag< Glue<T1,T2,glue_times_diag> >
|
Chris@49
|
364 { static const bool value = true; };
|
Chris@49
|
365
|
Chris@49
|
366 template<typename T1, typename T2>
|
Chris@49
|
367 struct is_glue_times_diag< const Glue<T1,T2,glue_times_diag> >
|
Chris@49
|
368 { static const bool value = true; };
|
Chris@49
|
369
|
Chris@49
|
370
|
Chris@49
|
371 template<typename T>
|
Chris@49
|
372 struct is_op_diagmat
|
Chris@49
|
373 { static const bool value = false; };
|
Chris@49
|
374
|
Chris@49
|
375 template<typename T1>
|
Chris@49
|
376 struct is_op_diagmat< Op<T1,op_diagmat> >
|
Chris@49
|
377 { static const bool value = true; };
|
Chris@49
|
378
|
Chris@49
|
379 template<typename T1>
|
Chris@49
|
380 struct is_op_diagmat< const Op<T1,op_diagmat> >
|
Chris@49
|
381 { static const bool value = true; };
|
Chris@49
|
382
|
Chris@49
|
383
|
Chris@49
|
384 template<typename T>
|
Chris@49
|
385 struct is_op_htrans2
|
Chris@49
|
386 { static const bool value = false; };
|
Chris@49
|
387
|
Chris@49
|
388 template<typename T1>
|
Chris@49
|
389 struct is_op_htrans2< Op<T1,op_htrans2> >
|
Chris@49
|
390 { static const bool value = true; };
|
Chris@49
|
391
|
Chris@49
|
392 template<typename T1>
|
Chris@49
|
393 struct is_op_htrans2< const Op<T1,op_htrans2> >
|
Chris@49
|
394 { static const bool value = true; };
|
Chris@49
|
395
|
Chris@49
|
396
|
Chris@49
|
397 //
|
Chris@49
|
398 //
|
Chris@49
|
399
|
Chris@49
|
400
|
Chris@49
|
401 template<typename T>
|
Chris@49
|
402 struct is_GenCube
|
Chris@49
|
403 { static const bool value = false; };
|
Chris@49
|
404
|
Chris@49
|
405 template<typename eT, typename gen_type>
|
Chris@49
|
406 struct is_GenCube< GenCube<eT,gen_type> >
|
Chris@49
|
407 { static const bool value = true; };
|
Chris@49
|
408
|
Chris@49
|
409
|
Chris@49
|
410 template<typename T>
|
Chris@49
|
411 struct is_OpCube
|
Chris@49
|
412 { static const bool value = false; };
|
Chris@49
|
413
|
Chris@49
|
414 template<typename T1, typename op_type>
|
Chris@49
|
415 struct is_OpCube< OpCube<T1,op_type> >
|
Chris@49
|
416 { static const bool value = true; };
|
Chris@49
|
417
|
Chris@49
|
418
|
Chris@49
|
419 template<typename T>
|
Chris@49
|
420 struct is_eOpCube
|
Chris@49
|
421 { static const bool value = false; };
|
Chris@49
|
422
|
Chris@49
|
423 template<typename T1, typename eop_type>
|
Chris@49
|
424 struct is_eOpCube< eOpCube<T1,eop_type> >
|
Chris@49
|
425 { static const bool value = true; };
|
Chris@49
|
426
|
Chris@49
|
427
|
Chris@49
|
428 template<typename T>
|
Chris@49
|
429 struct is_mtOpCube
|
Chris@49
|
430 { static const bool value = false; };
|
Chris@49
|
431
|
Chris@49
|
432 template<typename eT, typename T1, typename op_type>
|
Chris@49
|
433 struct is_mtOpCube< mtOpCube<eT, T1, op_type> >
|
Chris@49
|
434 { static const bool value = true; };
|
Chris@49
|
435
|
Chris@49
|
436
|
Chris@49
|
437 template<typename T>
|
Chris@49
|
438 struct is_GlueCube
|
Chris@49
|
439 { static const bool value = false; };
|
Chris@49
|
440
|
Chris@49
|
441 template<typename T1, typename T2, typename glue_type>
|
Chris@49
|
442 struct is_GlueCube< GlueCube<T1,T2,glue_type> >
|
Chris@49
|
443 { static const bool value = true; };
|
Chris@49
|
444
|
Chris@49
|
445
|
Chris@49
|
446 template<typename T>
|
Chris@49
|
447 struct is_eGlueCube
|
Chris@49
|
448 { static const bool value = false; };
|
Chris@49
|
449
|
Chris@49
|
450 template<typename T1, typename T2, typename eglue_type>
|
Chris@49
|
451 struct is_eGlueCube< eGlueCube<T1,T2,eglue_type> >
|
Chris@49
|
452 { static const bool value = true; };
|
Chris@49
|
453
|
Chris@49
|
454
|
Chris@49
|
455 template<typename T>
|
Chris@49
|
456 struct is_mtGlueCube
|
Chris@49
|
457 { static const bool value = false; };
|
Chris@49
|
458
|
Chris@49
|
459 template<typename eT, typename T1, typename T2, typename glue_type>
|
Chris@49
|
460 struct is_mtGlueCube< mtGlueCube<eT, T1, T2, glue_type> >
|
Chris@49
|
461 { static const bool value = true; };
|
Chris@49
|
462
|
Chris@49
|
463
|
Chris@49
|
464 //
|
Chris@49
|
465 //
|
Chris@49
|
466 //
|
Chris@49
|
467
|
Chris@49
|
468
|
Chris@49
|
469 template<typename T>
|
Chris@49
|
470 struct is_op_rel
|
Chris@49
|
471 { static const bool value = false; };
|
Chris@49
|
472
|
Chris@49
|
473 template<typename out_eT, typename T1>
|
Chris@49
|
474 struct is_op_rel< mtOp<out_eT, T1, op_rel_lt_pre> >
|
Chris@49
|
475 { static const bool value = true; };
|
Chris@49
|
476
|
Chris@49
|
477 template<typename out_eT, typename T1>
|
Chris@49
|
478 struct is_op_rel< mtOp<out_eT, T1, op_rel_lt_post> >
|
Chris@49
|
479 { static const bool value = true; };
|
Chris@49
|
480
|
Chris@49
|
481 template<typename out_eT, typename T1>
|
Chris@49
|
482 struct is_op_rel< mtOp<out_eT, T1, op_rel_gt_pre> >
|
Chris@49
|
483 { static const bool value = true; };
|
Chris@49
|
484
|
Chris@49
|
485 template<typename out_eT, typename T1>
|
Chris@49
|
486 struct is_op_rel< mtOp<out_eT, T1, op_rel_gt_post> >
|
Chris@49
|
487 { static const bool value = true; };
|
Chris@49
|
488
|
Chris@49
|
489 template<typename out_eT, typename T1>
|
Chris@49
|
490 struct is_op_rel< mtOp<out_eT, T1, op_rel_lteq_pre> >
|
Chris@49
|
491 { static const bool value = true; };
|
Chris@49
|
492
|
Chris@49
|
493 template<typename out_eT, typename T1>
|
Chris@49
|
494 struct is_op_rel< mtOp<out_eT, T1, op_rel_lteq_post> >
|
Chris@49
|
495 { static const bool value = true; };
|
Chris@49
|
496
|
Chris@49
|
497 template<typename out_eT, typename T1>
|
Chris@49
|
498 struct is_op_rel< mtOp<out_eT, T1, op_rel_gteq_pre> >
|
Chris@49
|
499 { static const bool value = true; };
|
Chris@49
|
500
|
Chris@49
|
501 template<typename out_eT, typename T1>
|
Chris@49
|
502 struct is_op_rel< mtOp<out_eT, T1, op_rel_gteq_post> >
|
Chris@49
|
503 { static const bool value = true; };
|
Chris@49
|
504
|
Chris@49
|
505 template<typename out_eT, typename T1>
|
Chris@49
|
506 struct is_op_rel< mtOp<out_eT, T1, op_rel_eq> >
|
Chris@49
|
507 { static const bool value = true; };
|
Chris@49
|
508
|
Chris@49
|
509 template<typename out_eT, typename T1>
|
Chris@49
|
510 struct is_op_rel< mtOp<out_eT, T1, op_rel_noteq> >
|
Chris@49
|
511 { static const bool value = true; };
|
Chris@49
|
512
|
Chris@49
|
513
|
Chris@49
|
514
|
Chris@49
|
515 //
|
Chris@49
|
516 //
|
Chris@49
|
517 //
|
Chris@49
|
518
|
Chris@49
|
519
|
Chris@49
|
520
|
Chris@49
|
521 template<typename T>
|
Chris@49
|
522 struct is_basevec
|
Chris@49
|
523 { static const bool value = ( is_Row_fixed_only<T>::value || is_Col_fixed_only<T>::value ); };
|
Chris@49
|
524
|
Chris@49
|
525 template<typename eT>
|
Chris@49
|
526 struct is_basevec< Row<eT> >
|
Chris@49
|
527 { static const bool value = true; };
|
Chris@49
|
528
|
Chris@49
|
529 template<typename eT>
|
Chris@49
|
530 struct is_basevec< const Row<eT> >
|
Chris@49
|
531 { static const bool value = true; };
|
Chris@49
|
532
|
Chris@49
|
533 template<typename eT>
|
Chris@49
|
534 struct is_basevec< Col<eT> >
|
Chris@49
|
535 { static const bool value = true; };
|
Chris@49
|
536
|
Chris@49
|
537 template<typename eT>
|
Chris@49
|
538 struct is_basevec< const Col<eT> >
|
Chris@49
|
539 { static const bool value = true; };
|
Chris@49
|
540
|
Chris@49
|
541 template<typename eT>
|
Chris@49
|
542 struct is_basevec< subview_row<eT> >
|
Chris@49
|
543 { static const bool value = true; };
|
Chris@49
|
544
|
Chris@49
|
545 template<typename eT>
|
Chris@49
|
546 struct is_basevec< const subview_row<eT> >
|
Chris@49
|
547 { static const bool value = true; };
|
Chris@49
|
548
|
Chris@49
|
549 template<typename eT>
|
Chris@49
|
550 struct is_basevec< subview_col<eT> >
|
Chris@49
|
551 { static const bool value = true; };
|
Chris@49
|
552
|
Chris@49
|
553 template<typename eT>
|
Chris@49
|
554 struct is_basevec< const subview_col<eT> >
|
Chris@49
|
555 { static const bool value = true; };
|
Chris@49
|
556
|
Chris@49
|
557 template<typename eT>
|
Chris@49
|
558 struct is_basevec< diagview<eT> >
|
Chris@49
|
559 { static const bool value = true; };
|
Chris@49
|
560
|
Chris@49
|
561 template<typename eT>
|
Chris@49
|
562 struct is_basevec< const diagview<eT> >
|
Chris@49
|
563 { static const bool value = true; };
|
Chris@49
|
564
|
Chris@49
|
565 template<typename eT, typename T1>
|
Chris@49
|
566 struct is_basevec< subview_elem1<eT,T1> >
|
Chris@49
|
567 { static const bool value = true; };
|
Chris@49
|
568
|
Chris@49
|
569 template<typename eT, typename T1>
|
Chris@49
|
570 struct is_basevec< const subview_elem1<eT,T1> >
|
Chris@49
|
571 { static const bool value = true; };
|
Chris@49
|
572
|
Chris@49
|
573
|
Chris@49
|
574 //
|
Chris@49
|
575 //
|
Chris@49
|
576 //
|
Chris@49
|
577
|
Chris@49
|
578
|
Chris@49
|
579
|
Chris@49
|
580 template<typename T1>
|
Chris@49
|
581 struct is_arma_type
|
Chris@49
|
582 {
|
Chris@49
|
583 static const bool value
|
Chris@49
|
584 = is_Mat<T1>::value
|
Chris@49
|
585 || is_Gen<T1>::value
|
Chris@49
|
586 || is_Op<T1>::value
|
Chris@49
|
587 || is_Glue<T1>::value
|
Chris@49
|
588 || is_eOp<T1>::value
|
Chris@49
|
589 || is_eGlue<T1>::value
|
Chris@49
|
590 || is_mtOp<T1>::value
|
Chris@49
|
591 || is_mtGlue<T1>::value
|
Chris@49
|
592 || is_diagview<T1>::value
|
Chris@49
|
593 || is_subview<T1>::value
|
Chris@49
|
594 || is_subview_row<T1>::value
|
Chris@49
|
595 || is_subview_col<T1>::value
|
Chris@49
|
596 || is_subview_elem1<T1>::value
|
Chris@49
|
597 || is_subview_elem2<T1>::value
|
Chris@49
|
598 ;
|
Chris@49
|
599 };
|
Chris@49
|
600
|
Chris@49
|
601
|
Chris@49
|
602
|
Chris@49
|
603 template<typename T1>
|
Chris@49
|
604 struct is_arma_cube_type
|
Chris@49
|
605 {
|
Chris@49
|
606 static const bool value
|
Chris@49
|
607 = is_Cube<T1>::value
|
Chris@49
|
608 || is_GenCube<T1>::value
|
Chris@49
|
609 || is_OpCube<T1>::value
|
Chris@49
|
610 || is_eOpCube<T1>::value
|
Chris@49
|
611 || is_mtOpCube<T1>::value
|
Chris@49
|
612 || is_GlueCube<T1>::value
|
Chris@49
|
613 || is_eGlueCube<T1>::value
|
Chris@49
|
614 || is_mtGlueCube<T1>::value
|
Chris@49
|
615 || is_subview_cube<T1>::value
|
Chris@49
|
616 ;
|
Chris@49
|
617 };
|
Chris@49
|
618
|
Chris@49
|
619
|
Chris@49
|
620
|
Chris@49
|
621 //
|
Chris@49
|
622 //
|
Chris@49
|
623 //
|
Chris@49
|
624
|
Chris@49
|
625
|
Chris@49
|
626
|
Chris@49
|
627 template<typename T>
|
Chris@49
|
628 struct is_SpMat
|
Chris@49
|
629 { static const bool value = false; };
|
Chris@49
|
630
|
Chris@49
|
631 template<typename eT>
|
Chris@49
|
632 struct is_SpMat< SpMat<eT> >
|
Chris@49
|
633 { static const bool value = true; };
|
Chris@49
|
634
|
Chris@49
|
635 template<typename eT>
|
Chris@49
|
636 struct is_SpMat< SpCol<eT> >
|
Chris@49
|
637 { static const bool value = true; };
|
Chris@49
|
638
|
Chris@49
|
639 template<typename eT>
|
Chris@49
|
640 struct is_SpMat< SpRow<eT> >
|
Chris@49
|
641 { static const bool value = true; };
|
Chris@49
|
642
|
Chris@49
|
643
|
Chris@49
|
644
|
Chris@49
|
645 template<typename T>
|
Chris@49
|
646 struct is_SpRow
|
Chris@49
|
647 { static const bool value = false; };
|
Chris@49
|
648
|
Chris@49
|
649 template<typename eT>
|
Chris@49
|
650 struct is_SpRow< SpRow<eT> >
|
Chris@49
|
651 { static const bool value = true; };
|
Chris@49
|
652
|
Chris@49
|
653
|
Chris@49
|
654
|
Chris@49
|
655 template<typename T>
|
Chris@49
|
656 struct is_SpCol
|
Chris@49
|
657 { static const bool value = false; };
|
Chris@49
|
658
|
Chris@49
|
659 template<typename eT>
|
Chris@49
|
660 struct is_SpCol< SpCol<eT> >
|
Chris@49
|
661 { static const bool value = true; };
|
Chris@49
|
662
|
Chris@49
|
663
|
Chris@49
|
664
|
Chris@49
|
665 template<typename T>
|
Chris@49
|
666 struct is_SpSubview
|
Chris@49
|
667 { static const bool value = false; };
|
Chris@49
|
668
|
Chris@49
|
669 template<typename eT>
|
Chris@49
|
670 struct is_SpSubview< SpSubview<eT> >
|
Chris@49
|
671 { static const bool value = true; };
|
Chris@49
|
672
|
Chris@49
|
673
|
Chris@49
|
674 template<typename T>
|
Chris@49
|
675 struct is_SpOp
|
Chris@49
|
676 { static const bool value = false; };
|
Chris@49
|
677
|
Chris@49
|
678 template<typename T1, typename op_type>
|
Chris@49
|
679 struct is_SpOp< SpOp<T1,op_type> >
|
Chris@49
|
680 { static const bool value = true; };
|
Chris@49
|
681
|
Chris@49
|
682
|
Chris@49
|
683 template<typename T>
|
Chris@49
|
684 struct is_SpGlue
|
Chris@49
|
685 { static const bool value = false; };
|
Chris@49
|
686
|
Chris@49
|
687 template<typename T1, typename T2, typename glue_type>
|
Chris@49
|
688 struct is_SpGlue< SpGlue<T1,T2,glue_type> >
|
Chris@49
|
689 { static const bool value = true; };
|
Chris@49
|
690
|
Chris@49
|
691
|
Chris@49
|
692 template<typename T>
|
Chris@49
|
693 struct is_mtSpOp
|
Chris@49
|
694 { static const bool value = false; };
|
Chris@49
|
695
|
Chris@49
|
696 template<typename eT, typename T1, typename spop_type>
|
Chris@49
|
697 struct is_mtSpOp< mtSpOp<eT, T1, spop_type> >
|
Chris@49
|
698 { static const bool value = true; };
|
Chris@49
|
699
|
Chris@49
|
700
|
Chris@49
|
701
|
Chris@49
|
702 template<typename T1>
|
Chris@49
|
703 struct is_arma_sparse_type
|
Chris@49
|
704 {
|
Chris@49
|
705 static const bool value
|
Chris@49
|
706 = is_SpMat<T1>::value
|
Chris@49
|
707 || is_SpSubview<T1>::value
|
Chris@49
|
708 || is_SpOp<T1>::value
|
Chris@49
|
709 || is_SpGlue<T1>::value
|
Chris@49
|
710 || is_mtSpOp<T1>::value
|
Chris@49
|
711 ;
|
Chris@49
|
712 };
|
Chris@49
|
713
|
Chris@49
|
714
|
Chris@49
|
715
|
Chris@49
|
716 //
|
Chris@49
|
717 //
|
Chris@49
|
718 //
|
Chris@49
|
719
|
Chris@49
|
720
|
Chris@49
|
721 template<typename T1, typename T2>
|
Chris@49
|
722 struct is_same_type
|
Chris@49
|
723 { static const bool value = false; };
|
Chris@49
|
724
|
Chris@49
|
725
|
Chris@49
|
726 template<typename T1>
|
Chris@49
|
727 struct is_same_type<T1,T1>
|
Chris@49
|
728 { static const bool value = true; };
|
Chris@49
|
729
|
Chris@49
|
730
|
Chris@49
|
731
|
Chris@49
|
732 //
|
Chris@49
|
733 //
|
Chris@49
|
734 //
|
Chris@49
|
735
|
Chris@49
|
736
|
Chris@49
|
737 template<typename T1>
|
Chris@49
|
738 struct is_u8
|
Chris@49
|
739 { static const bool value = false; };
|
Chris@49
|
740
|
Chris@49
|
741 template<>
|
Chris@49
|
742 struct is_u8<u8>
|
Chris@49
|
743 { static const bool value = true; };
|
Chris@49
|
744
|
Chris@49
|
745
|
Chris@49
|
746
|
Chris@49
|
747 template<typename T1>
|
Chris@49
|
748 struct is_s8
|
Chris@49
|
749 { static const bool value = false; };
|
Chris@49
|
750
|
Chris@49
|
751 template<>
|
Chris@49
|
752 struct is_s8<s8>
|
Chris@49
|
753 { static const bool value = true; };
|
Chris@49
|
754
|
Chris@49
|
755
|
Chris@49
|
756
|
Chris@49
|
757 template<typename T1>
|
Chris@49
|
758 struct is_u16
|
Chris@49
|
759 { static const bool value = false; };
|
Chris@49
|
760
|
Chris@49
|
761 template<>
|
Chris@49
|
762 struct is_u16<u16>
|
Chris@49
|
763 { static const bool value = true; };
|
Chris@49
|
764
|
Chris@49
|
765
|
Chris@49
|
766
|
Chris@49
|
767 template<typename T1>
|
Chris@49
|
768 struct is_s16
|
Chris@49
|
769 { static const bool value = false; };
|
Chris@49
|
770
|
Chris@49
|
771 template<>
|
Chris@49
|
772 struct is_s16<s16>
|
Chris@49
|
773 { static const bool value = true; };
|
Chris@49
|
774
|
Chris@49
|
775
|
Chris@49
|
776
|
Chris@49
|
777 template<typename T1>
|
Chris@49
|
778 struct is_u32
|
Chris@49
|
779 { static const bool value = false; };
|
Chris@49
|
780
|
Chris@49
|
781 template<>
|
Chris@49
|
782 struct is_u32<u32>
|
Chris@49
|
783 { static const bool value = true; };
|
Chris@49
|
784
|
Chris@49
|
785
|
Chris@49
|
786
|
Chris@49
|
787 template<typename T1>
|
Chris@49
|
788 struct is_s32
|
Chris@49
|
789 { static const bool value = false; };
|
Chris@49
|
790
|
Chris@49
|
791 template<>
|
Chris@49
|
792 struct is_s32<s32>
|
Chris@49
|
793 { static const bool value = true; };
|
Chris@49
|
794
|
Chris@49
|
795
|
Chris@49
|
796
|
Chris@49
|
797 #if defined(ARMA_USE_U64S64)
|
Chris@49
|
798 template<typename T1>
|
Chris@49
|
799 struct is_u64
|
Chris@49
|
800 { static const bool value = false; };
|
Chris@49
|
801
|
Chris@49
|
802 template<>
|
Chris@49
|
803 struct is_u64<u64>
|
Chris@49
|
804 { static const bool value = true; };
|
Chris@49
|
805
|
Chris@49
|
806
|
Chris@49
|
807 template<typename T1>
|
Chris@49
|
808 struct is_s64
|
Chris@49
|
809 { static const bool value = false; };
|
Chris@49
|
810
|
Chris@49
|
811 template<>
|
Chris@49
|
812 struct is_s64<s64>
|
Chris@49
|
813 { static const bool value = true; };
|
Chris@49
|
814 #endif
|
Chris@49
|
815
|
Chris@49
|
816
|
Chris@49
|
817
|
Chris@49
|
818 template<typename T1>
|
Chris@49
|
819 struct is_ulng_t
|
Chris@49
|
820 { static const bool value = false; };
|
Chris@49
|
821
|
Chris@49
|
822 template<>
|
Chris@49
|
823 struct is_ulng_t<ulng_t>
|
Chris@49
|
824 { static const bool value = true; };
|
Chris@49
|
825
|
Chris@49
|
826
|
Chris@49
|
827
|
Chris@49
|
828 template<typename T1>
|
Chris@49
|
829 struct is_slng_t
|
Chris@49
|
830 { static const bool value = false; };
|
Chris@49
|
831
|
Chris@49
|
832 template<>
|
Chris@49
|
833 struct is_slng_t<slng_t>
|
Chris@49
|
834 { static const bool value = true; };
|
Chris@49
|
835
|
Chris@49
|
836
|
Chris@49
|
837
|
Chris@49
|
838 template<typename T1>
|
Chris@49
|
839 struct is_ulng_t_32
|
Chris@49
|
840 { static const bool value = false; };
|
Chris@49
|
841
|
Chris@49
|
842 template<>
|
Chris@49
|
843 struct is_ulng_t_32<ulng_t>
|
Chris@49
|
844 { static const bool value = (sizeof(ulng_t) == 4); };
|
Chris@49
|
845
|
Chris@49
|
846
|
Chris@49
|
847
|
Chris@49
|
848 template<typename T1>
|
Chris@49
|
849 struct is_slng_t_32
|
Chris@49
|
850 { static const bool value = false; };
|
Chris@49
|
851
|
Chris@49
|
852 template<>
|
Chris@49
|
853 struct is_slng_t_32<slng_t>
|
Chris@49
|
854 { static const bool value = (sizeof(slng_t) == 4); };
|
Chris@49
|
855
|
Chris@49
|
856
|
Chris@49
|
857
|
Chris@49
|
858 template<typename T1>
|
Chris@49
|
859 struct is_ulng_t_64
|
Chris@49
|
860 { static const bool value = false; };
|
Chris@49
|
861
|
Chris@49
|
862 template<>
|
Chris@49
|
863 struct is_ulng_t_64<ulng_t>
|
Chris@49
|
864 { static const bool value = (sizeof(ulng_t) == 8); };
|
Chris@49
|
865
|
Chris@49
|
866
|
Chris@49
|
867
|
Chris@49
|
868 template<typename T1>
|
Chris@49
|
869 struct is_slng_t_64
|
Chris@49
|
870 { static const bool value = false; };
|
Chris@49
|
871
|
Chris@49
|
872 template<>
|
Chris@49
|
873 struct is_slng_t_64<slng_t>
|
Chris@49
|
874 { static const bool value = (sizeof(slng_t) == 8); };
|
Chris@49
|
875
|
Chris@49
|
876
|
Chris@49
|
877
|
Chris@49
|
878 template<typename T1>
|
Chris@49
|
879 struct is_uword
|
Chris@49
|
880 { static const bool value = false; };
|
Chris@49
|
881
|
Chris@49
|
882 template<>
|
Chris@49
|
883 struct is_uword<uword>
|
Chris@49
|
884 { static const bool value = true; };
|
Chris@49
|
885
|
Chris@49
|
886
|
Chris@49
|
887
|
Chris@49
|
888 template<typename T1>
|
Chris@49
|
889 struct is_sword
|
Chris@49
|
890 { static const bool value = false; };
|
Chris@49
|
891
|
Chris@49
|
892 template<>
|
Chris@49
|
893 struct is_sword<sword>
|
Chris@49
|
894 { static const bool value = true; };
|
Chris@49
|
895
|
Chris@49
|
896
|
Chris@49
|
897
|
Chris@49
|
898 template<typename T1>
|
Chris@49
|
899 struct is_float
|
Chris@49
|
900 { static const bool value = false; };
|
Chris@49
|
901
|
Chris@49
|
902 template<>
|
Chris@49
|
903 struct is_float<float>
|
Chris@49
|
904 { static const bool value = true; };
|
Chris@49
|
905
|
Chris@49
|
906
|
Chris@49
|
907
|
Chris@49
|
908 template<typename T1>
|
Chris@49
|
909 struct is_double
|
Chris@49
|
910 { static const bool value = false; };
|
Chris@49
|
911
|
Chris@49
|
912 template<>
|
Chris@49
|
913 struct is_double<double>
|
Chris@49
|
914 { static const bool value = true; };
|
Chris@49
|
915
|
Chris@49
|
916
|
Chris@49
|
917
|
Chris@49
|
918 template<typename T1>
|
Chris@49
|
919 struct is_real
|
Chris@49
|
920 { static const bool value = false; };
|
Chris@49
|
921
|
Chris@49
|
922 template<>
|
Chris@49
|
923 struct is_real<float>
|
Chris@49
|
924 { static const bool value = true; };
|
Chris@49
|
925
|
Chris@49
|
926 template<>
|
Chris@49
|
927 struct is_real<double>
|
Chris@49
|
928 { static const bool value = true; };
|
Chris@49
|
929
|
Chris@49
|
930
|
Chris@49
|
931
|
Chris@49
|
932
|
Chris@49
|
933 template<typename T1>
|
Chris@49
|
934 struct is_not_complex
|
Chris@49
|
935 { static const bool value = true; };
|
Chris@49
|
936
|
Chris@49
|
937 template<typename eT>
|
Chris@49
|
938 struct is_not_complex< std::complex<eT> >
|
Chris@49
|
939 { static const bool value = false; };
|
Chris@49
|
940
|
Chris@49
|
941
|
Chris@49
|
942
|
Chris@49
|
943 template<typename T1>
|
Chris@49
|
944 struct is_complex
|
Chris@49
|
945 { static const bool value = false; };
|
Chris@49
|
946
|
Chris@49
|
947 // template<>
|
Chris@49
|
948 template<typename eT>
|
Chris@49
|
949 struct is_complex< std::complex<eT> >
|
Chris@49
|
950 { static const bool value = true; };
|
Chris@49
|
951
|
Chris@49
|
952
|
Chris@49
|
953
|
Chris@49
|
954 template<typename T1>
|
Chris@49
|
955 struct is_complex_float
|
Chris@49
|
956 { static const bool value = false; };
|
Chris@49
|
957
|
Chris@49
|
958 template<>
|
Chris@49
|
959 struct is_complex_float< std::complex<float> >
|
Chris@49
|
960 { static const bool value = true; };
|
Chris@49
|
961
|
Chris@49
|
962
|
Chris@49
|
963
|
Chris@49
|
964 template<typename T1>
|
Chris@49
|
965 struct is_complex_double
|
Chris@49
|
966 { static const bool value = false; };
|
Chris@49
|
967
|
Chris@49
|
968 template<>
|
Chris@49
|
969 struct is_complex_double< std::complex<double> >
|
Chris@49
|
970 { static const bool value = true; };
|
Chris@49
|
971
|
Chris@49
|
972
|
Chris@49
|
973
|
Chris@49
|
974 template<typename T1>
|
Chris@49
|
975 struct is_complex_strict
|
Chris@49
|
976 { static const bool value = false; };
|
Chris@49
|
977
|
Chris@49
|
978 template<>
|
Chris@49
|
979 struct is_complex_strict< std::complex<float> >
|
Chris@49
|
980 { static const bool value = true; };
|
Chris@49
|
981
|
Chris@49
|
982 template<>
|
Chris@49
|
983 struct is_complex_strict< std::complex<double> >
|
Chris@49
|
984 { static const bool value = true; };
|
Chris@49
|
985
|
Chris@49
|
986
|
Chris@49
|
987
|
Chris@49
|
988 //! check for a weird implementation of the std::complex class
|
Chris@49
|
989 template<typename T1>
|
Chris@49
|
990 struct is_supported_complex
|
Chris@49
|
991 { static const bool value = false; };
|
Chris@49
|
992
|
Chris@49
|
993 //template<>
|
Chris@49
|
994 template<typename eT>
|
Chris@49
|
995 struct is_supported_complex< std::complex<eT> >
|
Chris@49
|
996 { static const bool value = ( sizeof(std::complex<eT>) == 2*sizeof(eT) ); };
|
Chris@49
|
997
|
Chris@49
|
998
|
Chris@49
|
999
|
Chris@49
|
1000 template<typename T1>
|
Chris@49
|
1001 struct is_supported_complex_float
|
Chris@49
|
1002 { static const bool value = false; };
|
Chris@49
|
1003
|
Chris@49
|
1004 template<>
|
Chris@49
|
1005 struct is_supported_complex_float< std::complex<float> >
|
Chris@49
|
1006 { static const bool value = ( sizeof(std::complex<float>) == 2*sizeof(float) ); };
|
Chris@49
|
1007
|
Chris@49
|
1008
|
Chris@49
|
1009
|
Chris@49
|
1010 template<typename T1>
|
Chris@49
|
1011 struct is_supported_complex_double
|
Chris@49
|
1012 { static const bool value = false; };
|
Chris@49
|
1013
|
Chris@49
|
1014 template<>
|
Chris@49
|
1015 struct is_supported_complex_double< std::complex<double> >
|
Chris@49
|
1016 { static const bool value = ( sizeof(std::complex<double>) == 2*sizeof(double) ); };
|
Chris@49
|
1017
|
Chris@49
|
1018
|
Chris@49
|
1019
|
Chris@49
|
1020 template<typename T1>
|
Chris@49
|
1021 struct is_supported_elem_type
|
Chris@49
|
1022 {
|
Chris@49
|
1023 static const bool value = \
|
Chris@49
|
1024 is_u8<T1>::value ||
|
Chris@49
|
1025 is_s8<T1>::value ||
|
Chris@49
|
1026 is_u16<T1>::value ||
|
Chris@49
|
1027 is_s16<T1>::value ||
|
Chris@49
|
1028 is_u32<T1>::value ||
|
Chris@49
|
1029 is_s32<T1>::value ||
|
Chris@49
|
1030 #if defined(ARMA_USE_U64S64)
|
Chris@49
|
1031 is_u64<T1>::value ||
|
Chris@49
|
1032 is_s64<T1>::value ||
|
Chris@49
|
1033 #endif
|
Chris@49
|
1034 #if defined(ARMA_ALLOW_LONG)
|
Chris@49
|
1035 is_ulng_t<T1>::value ||
|
Chris@49
|
1036 is_slng_t<T1>::value ||
|
Chris@49
|
1037 #endif
|
Chris@49
|
1038 is_float<T1>::value ||
|
Chris@49
|
1039 is_double<T1>::value ||
|
Chris@49
|
1040 is_supported_complex_float<T1>::value ||
|
Chris@49
|
1041 is_supported_complex_double<T1>::value;
|
Chris@49
|
1042 };
|
Chris@49
|
1043
|
Chris@49
|
1044
|
Chris@49
|
1045
|
Chris@49
|
1046 template<typename T1>
|
Chris@49
|
1047 struct is_supported_blas_type
|
Chris@49
|
1048 {
|
Chris@49
|
1049 static const bool value = \
|
Chris@49
|
1050 is_float<T1>::value ||
|
Chris@49
|
1051 is_double<T1>::value ||
|
Chris@49
|
1052 is_supported_complex_float<T1>::value ||
|
Chris@49
|
1053 is_supported_complex_double<T1>::value;
|
Chris@49
|
1054 };
|
Chris@49
|
1055
|
Chris@49
|
1056
|
Chris@49
|
1057
|
Chris@49
|
1058 template<typename T>
|
Chris@49
|
1059 struct is_signed
|
Chris@49
|
1060 {
|
Chris@49
|
1061 static const bool value = true;
|
Chris@49
|
1062 };
|
Chris@49
|
1063
|
Chris@49
|
1064
|
Chris@49
|
1065 template<> struct is_signed<u8> { static const bool value = false; };
|
Chris@49
|
1066 template<> struct is_signed<u16> { static const bool value = false; };
|
Chris@49
|
1067 template<> struct is_signed<u32> { static const bool value = false; };
|
Chris@49
|
1068 #if defined(ARMA_USE_U64S64)
|
Chris@49
|
1069 template<> struct is_signed<u64> { static const bool value = false; };
|
Chris@49
|
1070 #endif
|
Chris@49
|
1071 #if defined(ARMA_ALLOW_LONG)
|
Chris@49
|
1072 template<> struct is_signed<ulng_t> { static const bool value = false; };
|
Chris@49
|
1073 #endif
|
Chris@49
|
1074
|
Chris@49
|
1075
|
Chris@49
|
1076 template<typename T>
|
Chris@49
|
1077 struct is_non_integral
|
Chris@49
|
1078 {
|
Chris@49
|
1079 static const bool value = false;
|
Chris@49
|
1080 };
|
Chris@49
|
1081
|
Chris@49
|
1082
|
Chris@49
|
1083 template<> struct is_non_integral< float > { static const bool value = true; };
|
Chris@49
|
1084 template<> struct is_non_integral< double > { static const bool value = true; };
|
Chris@49
|
1085 template<> struct is_non_integral< std::complex<float> > { static const bool value = true; };
|
Chris@49
|
1086 template<> struct is_non_integral< std::complex<double> > { static const bool value = true; };
|
Chris@49
|
1087
|
Chris@49
|
1088
|
Chris@49
|
1089
|
Chris@49
|
1090
|
Chris@49
|
1091 //
|
Chris@49
|
1092
|
Chris@49
|
1093 class arma_junk_class;
|
Chris@49
|
1094
|
Chris@49
|
1095 template<typename T1, typename T2>
|
Chris@49
|
1096 struct force_different_type
|
Chris@49
|
1097 {
|
Chris@49
|
1098 typedef T1 T1_result;
|
Chris@49
|
1099 typedef T2 T2_result;
|
Chris@49
|
1100 };
|
Chris@49
|
1101
|
Chris@49
|
1102
|
Chris@49
|
1103 template<typename T1>
|
Chris@49
|
1104 struct force_different_type<T1,T1>
|
Chris@49
|
1105 {
|
Chris@49
|
1106 typedef T1 T1_result;
|
Chris@49
|
1107 typedef arma_junk_class T2_result;
|
Chris@49
|
1108 };
|
Chris@49
|
1109
|
Chris@49
|
1110
|
Chris@49
|
1111
|
Chris@49
|
1112 //
|
Chris@49
|
1113
|
Chris@49
|
1114
|
Chris@49
|
1115 template<typename T1>
|
Chris@49
|
1116 struct resolves_to_vector_default { static const bool value = false; };
|
Chris@49
|
1117
|
Chris@49
|
1118 template<typename T1>
|
Chris@49
|
1119 struct resolves_to_vector_test { static const bool value = T1::is_col || T1::is_row; };
|
Chris@49
|
1120
|
Chris@49
|
1121
|
Chris@49
|
1122 template<typename T1, bool condition>
|
Chris@49
|
1123 struct resolves_to_vector_redirect {};
|
Chris@49
|
1124
|
Chris@49
|
1125 template<typename T1>
|
Chris@49
|
1126 struct resolves_to_vector_redirect<T1, false> { typedef resolves_to_vector_default<T1> result; };
|
Chris@49
|
1127
|
Chris@49
|
1128 template<typename T1>
|
Chris@49
|
1129 struct resolves_to_vector_redirect<T1, true> { typedef resolves_to_vector_test<T1> result; };
|
Chris@49
|
1130
|
Chris@49
|
1131
|
Chris@49
|
1132 template<typename T1>
|
Chris@49
|
1133 struct resolves_to_vector : public resolves_to_vector_redirect<T1, is_arma_type<T1>::value>::result {};
|
Chris@49
|
1134
|
Chris@49
|
1135 template<typename T1>
|
Chris@49
|
1136 struct resolves_to_sparse_vector : public resolves_to_vector_redirect<T1, is_arma_sparse_type<T1>::value>::result {};
|
Chris@49
|
1137
|
Chris@49
|
1138
|
Chris@49
|
1139
|
Chris@49
|
1140 template<typename glue_type> struct is_glue_mixed_times { static const bool value = false; };
|
Chris@49
|
1141 template<> struct is_glue_mixed_times<glue_mixed_times> { static const bool value = true; };
|
Chris@49
|
1142
|
Chris@49
|
1143
|
Chris@49
|
1144
|
Chris@49
|
1145 template<typename glue_type> struct is_glue_mixed_elem { static const bool value = false; };
|
Chris@49
|
1146
|
Chris@49
|
1147 template<> struct is_glue_mixed_elem<glue_mixed_plus> { static const bool value = true; };
|
Chris@49
|
1148 template<> struct is_glue_mixed_elem<glue_mixed_minus> { static const bool value = true; };
|
Chris@49
|
1149 template<> struct is_glue_mixed_elem<glue_mixed_div> { static const bool value = true; };
|
Chris@49
|
1150 template<> struct is_glue_mixed_elem<glue_mixed_schur> { static const bool value = true; };
|
Chris@49
|
1151
|
Chris@49
|
1152 template<> struct is_glue_mixed_elem<glue_rel_lt> { static const bool value = true; };
|
Chris@49
|
1153 template<> struct is_glue_mixed_elem<glue_rel_gt> { static const bool value = true; };
|
Chris@49
|
1154 template<> struct is_glue_mixed_elem<glue_rel_lteq> { static const bool value = true; };
|
Chris@49
|
1155 template<> struct is_glue_mixed_elem<glue_rel_gteq> { static const bool value = true; };
|
Chris@49
|
1156 template<> struct is_glue_mixed_elem<glue_rel_eq> { static const bool value = true; };
|
Chris@49
|
1157 template<> struct is_glue_mixed_elem<glue_rel_noteq> { static const bool value = true; };
|
Chris@49
|
1158
|
Chris@49
|
1159
|
Chris@49
|
1160
|
Chris@49
|
1161 template<typename op_type> struct is_op_mixed_elem { static const bool value = false; };
|
Chris@49
|
1162
|
Chris@49
|
1163 template<> struct is_op_mixed_elem<op_cx_scalar_times> { static const bool value = true; };
|
Chris@49
|
1164 template<> struct is_op_mixed_elem<op_cx_scalar_plus> { static const bool value = true; };
|
Chris@49
|
1165 template<> struct is_op_mixed_elem<op_cx_scalar_minus_pre> { static const bool value = true; };
|
Chris@49
|
1166 template<> struct is_op_mixed_elem<op_cx_scalar_minus_post> { static const bool value = true; };
|
Chris@49
|
1167 template<> struct is_op_mixed_elem<op_cx_scalar_div_pre> { static const bool value = true; };
|
Chris@49
|
1168 template<> struct is_op_mixed_elem<op_cx_scalar_div_post> { static const bool value = true; };
|
Chris@49
|
1169
|
Chris@49
|
1170 template<> struct is_op_mixed_elem<op_rel_lt_pre> { static const bool value = true; };
|
Chris@49
|
1171 template<> struct is_op_mixed_elem<op_rel_lt_post> { static const bool value = true; };
|
Chris@49
|
1172 template<> struct is_op_mixed_elem<op_rel_gt_pre> { static const bool value = true; };
|
Chris@49
|
1173 template<> struct is_op_mixed_elem<op_rel_gt_post> { static const bool value = true; };
|
Chris@49
|
1174 template<> struct is_op_mixed_elem<op_rel_lteq_pre> { static const bool value = true; };
|
Chris@49
|
1175 template<> struct is_op_mixed_elem<op_rel_lteq_post> { static const bool value = true; };
|
Chris@49
|
1176 template<> struct is_op_mixed_elem<op_rel_gteq_pre> { static const bool value = true; };
|
Chris@49
|
1177 template<> struct is_op_mixed_elem<op_rel_gteq_post> { static const bool value = true; };
|
Chris@49
|
1178 template<> struct is_op_mixed_elem<op_rel_eq> { static const bool value = true; };
|
Chris@49
|
1179 template<> struct is_op_mixed_elem<op_rel_noteq> { static const bool value = true; };
|
Chris@49
|
1180
|
Chris@49
|
1181
|
Chris@49
|
1182
|
Chris@49
|
1183 template<typename spop_type> struct is_spop_elem { static const bool value = false; };
|
Chris@49
|
1184 template<> struct is_spop_elem<spop_scalar_times> { static const bool value = true; };
|
Chris@49
|
1185
|
Chris@49
|
1186
|
Chris@49
|
1187 template<typename spglue_type> struct is_spglue_elem { static const bool value = false; };
|
Chris@49
|
1188 template<> struct is_spglue_elem<spglue_plus> { static const bool value = true; };
|
Chris@49
|
1189 template<> struct is_spglue_elem<spglue_plus2> { static const bool value = true; };
|
Chris@49
|
1190 template<> struct is_spglue_elem<spglue_minus> { static const bool value = true; };
|
Chris@49
|
1191 template<> struct is_spglue_elem<spglue_minus2> { static const bool value = true; };
|
Chris@49
|
1192
|
Chris@49
|
1193
|
Chris@49
|
1194 template<typename spglue_type> struct is_spglue_times { static const bool value = false; };
|
Chris@49
|
1195 template<> struct is_spglue_times<spglue_times> { static const bool value = true; };
|
Chris@49
|
1196
|
Chris@49
|
1197
|
Chris@49
|
1198 template<typename spglue_type> struct is_spglue_times2 { static const bool value = false; };
|
Chris@49
|
1199 template<> struct is_spglue_times<spglue_times2> { static const bool value = true; };
|
Chris@49
|
1200
|
Chris@49
|
1201
|
Chris@49
|
1202
|
Chris@49
|
1203 //! @}
|