1 //=================================================================================================
2 /*!
3 //  \file blaze/math/Aliases.h
4 //  \brief Header file for auxiliary alias declarations
5 //
6 //  Copyright (C) 2012-2020 Klaus Iglberger - All Rights Reserved
7 //
8 //  This file is part of the Blaze library. You can redistribute it and/or modify it under
9 //  the terms of the New (Revised) BSD License. Redistribution and use in source and binary
10 //  forms, with or without modification, are permitted provided that the following conditions
11 //  are met:
12 //
13 //  1. Redistributions of source code must retain the above copyright notice, this list of
14 //     conditions and the following disclaimer.
15 //  2. Redistributions in binary form must reproduce the above copyright notice, this list
16 //     of conditions and the following disclaimer in the documentation and/or other materials
17 //     provided with the distribution.
18 //  3. Neither the names of the Blaze development group nor the names of its contributors
19 //     may be used to endorse or promote products derived from this software without specific
20 //     prior written permission.
21 //
22 //  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
23 //  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 //  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25 //  SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 //  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
27 //  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
28 //  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 //  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 //  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
31 //  DAMAGE.
32 */
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ALIASES_H_
36 #define _BLAZE_MATH_ALIASES_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/Types.h>
44 
45 
46 namespace blaze {
47 
48 //=================================================================================================
49 //
50 //  ALIAS DECLARATION
51 //
52 //=================================================================================================
53 
54 //*************************************************************************************************
55 /*!\brief Alias declaration for nested \c AllocatorType type definitions.
56 // \ingroup aliases
57 //
58 // The AllocatorType_t alias declaration provides a convenient shortcut to access the nested
59 // \a AllocatorType type definition of the given type \a T. The following code example shows
60 // both ways to access the nested type definition:
61 
62    \code
63    using Type1 = typename T::AllocatorType;
64    using Type2 = AllocatorType_t<T>;
65 
66    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
67    \endcode
68 */
69 template< typename T >
70 using AllocatorType_t = typename T::AllocatorType;
71 //*************************************************************************************************
72 
73 
74 //*************************************************************************************************
75 /*!\brief Alias declaration for nested \c BaseType type definitions.
76 // \ingroup aliases
77 //
78 // The BaseType_t alias declaration provides a convenient shortcut to access the nested
79 // \a BaseType type definition of the given type \a T. The following code example shows
80 // both ways to access the nested type definition:
81 
82    \code
83    using Type1 = typename T::BaseType;
84    using Type2 = BaseType_t<T>;
85 
86    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
87    \endcode
88 */
89 template< typename T >
90 using BaseType_t = typename T::BaseType;
91 //*************************************************************************************************
92 
93 
94 //*************************************************************************************************
95 /*!\brief Alias declaration for nested \c CompositeType type definitions.
96 // \ingroup aliases
97 //
98 // The CompositeType_t alias declaration provides a convenient shortcut to access the nested
99 // \a CompositeType type definition of the given type \a T. The following code example shows
100 // both ways to access the nested type definition:
101 
102    \code
103    using Type1 = typename T::CompositeType;
104    using Type2 = CompositeType_t<T>;
105 
106    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
107    \endcode
108 */
109 template< typename T >
110 using CompositeType_t = typename T::CompositeType;
111 //*************************************************************************************************
112 
113 
114 //*************************************************************************************************
115 /*!\brief Alias declaration for nested \c ConstIterator type definitions.
116 // \ingroup aliases
117 //
118 // The ConstIterator_t alias declaration provides a convenient shortcut to access the nested
119 // \a ConstIterator type definition of the given type \a T. The following code example shows
120 // both ways to access the nested type definition:
121 
122    \code
123    using Type1 = typename T::ConstIterator;
124    using Type2 = ConstIterator_t<T>;
125 
126    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
127    \endcode
128 */
129 template< typename T >
130 using ConstIterator_t = typename T::ConstIterator;
131 //*************************************************************************************************
132 
133 
134 //*************************************************************************************************
135 /*!\brief Alias declaration for nested \c ConstPointer type definitions.
136 // \ingroup aliases
137 //
138 // The ConstPointer_t alias declaration provides a convenient shortcut to access the nested
139 // \a ConstPointer type definition of the given type \a T. The following code example shows
140 // both ways to access the nested type definition:
141 
142    \code
143    using Type1 = typename T::ConstPointer;
144    using Type2 = ConstPointer_t<T>;
145 
146    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
147    \endcode
148 */
149 template< typename T >
150 using ConstPointer_t = typename T::ConstPointer;
151 //*************************************************************************************************
152 
153 
154 //*************************************************************************************************
155 /*!\brief Alias declaration for nested \c ConstReference type definitions.
156 // \ingroup aliases
157 //
158 // The ConstReference_t alias declaration provides a convenient shortcut to access the nested
159 // \a ConstReference type definition of the given type \a T. The following code example shows
160 // both ways to access the nested type definition:
161 
162    \code
163    using Type1 = typename T::ConstReference;
164    using Type2 = ConstReference_t<T>;
165 
166    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
167    \endcode
168 */
169 template< typename T >
170 using ConstReference_t = typename T::ConstReference;
171 //*************************************************************************************************
172 
173 
174 //*************************************************************************************************
175 /*!\brief Alias declaration for nested \c ElementType type definitions.
176 // \ingroup aliases
177 //
178 // The ElementType_t alias declaration provides a convenient shortcut to access the nested
179 // \a ElementType type definition of the given type \a T. The following code example shows
180 // both ways to access the nested type definition:
181 
182    \code
183    using Type1 = typename T::ElementType;
184    using Type2 = ElementType_t<T>;
185 
186    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
187    \endcode
188 */
189 template< typename T >
190 using ElementType_t = typename T::ElementType;
191 //*************************************************************************************************
192 
193 
194 //*************************************************************************************************
195 /*!\brief Alias declaration for nested \c Iterator type definitions.
196 // \ingroup aliases
197 //
198 // The Iterator_t alias declaration provides a convenient shortcut to access the nested
199 // \a Iterator type definition of the given type \a T. The following code example shows
200 // both ways to access the nested type definition:
201 
202    \code
203    using Type1 = typename T::Iterator;
204    using Type2 = Iterator_t<T>;
205 
206    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
207    \endcode
208 */
209 template< typename T >
210 using Iterator_t = typename T::Iterator;
211 //*************************************************************************************************
212 
213 
214 //*************************************************************************************************
215 /*!\brief Alias declaration for nested \c LeftOperand type definitions.
216 // \ingroup aliases
217 //
218 // The LeftOperand_t alias declaration provides a convenient shortcut to access the nested
219 // \a LeftOperand type definition of the given type \a T. The following code example shows
220 // both ways to access the nested type definition:
221 
222    \code
223    using Type1 = typename T::LeftOperand;
224    using Type2 = LeftOperand_t<T>;
225 
226    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
227    \endcode
228 */
229 template< typename T >
230 using LeftOperand_t = typename T::LeftOperand;
231 //*************************************************************************************************
232 
233 
234 //*************************************************************************************************
235 /*!\brief Alias declaration for nested \c MatrixType type definitions.
236 // \ingroup aliases
237 //
238 // The MatrixType_t alias declaration provides a convenient shortcut to access the nested
239 // \a MatrixType type definition of the given type \a T. The following code example shows
240 // both ways to access the nested type definition:
241 
242    \code
243    using Type1 = typename T::MatrixType;
244    using Type2 = MatrixType_t<T>;
245 
246    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
247    \endcode
248 */
249 template< typename T >
250 using MatrixType_t = typename T::MatrixType;
251 //*************************************************************************************************
252 
253 
254 //*************************************************************************************************
255 /*!\brief Alias declaration for nested \c Operand type definitions.
256 // \ingroup aliases
257 //
258 // The Operand_t alias declaration provides a convenient shortcut to access the nested \a Operand
259 // type definition of the given type \a T. The following code example shows both ways to access
260 // the nested type definition:
261 
262    \code
263    using Type1 = typename T::Operand;
264    using Type2 = Operand_t<T>;
265 
266    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
267    \endcode
268 */
269 template< typename T >
270 using Operand_t = typename T::Operand;
271 //*************************************************************************************************
272 
273 
274 //*************************************************************************************************
275 /*!\brief Alias declaration for nested \c Operation type definitions.
276 // \ingroup aliases
277 //
278 // The Operation_t alias declaration provides a convenient shortcut to access the nested
279 // \a Operation type definition of the given type \a T. The following code example shows both
280 // ways to access the nested type definition:
281 
282    \code
283    using Type1 = typename T::Operation;
284    using Type2 = Operation_t<T>;
285 
286    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
287    \endcode
288 */
289 template< typename T >
290 using Operation_t = typename T::Operation;
291 //*************************************************************************************************
292 
293 
294 //*************************************************************************************************
295 /*!\brief Alias declaration for nested \c OppositeType type definitions.
296 // \ingroup aliases
297 //
298 // The OppositeType_t alias declaration provides a convenient shortcut to access the nested
299 // \a OppositeType type definition of the given type \a T. The following code example shows
300 // both ways to access the nested type definition:
301 
302    \code
303    using Type1 = typename T::OppositeType;
304    using Type2 = OppositeType_t<T>;
305 
306    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
307    \endcode
308 */
309 template< typename T >
310 using OppositeType_t = typename T::OppositeType;
311 //*************************************************************************************************
312 
313 
314 //*************************************************************************************************
315 /*!\brief Alias declaration for nested \c Pointer type definitions.
316 // \ingroup aliases
317 //
318 // The Pointer_t alias declaration provides a convenient shortcut to access the nested
319 // \a Pointer type definition of the given type \a T. The following code example shows
320 // both ways to access the nested type definition:
321 
322    \code
323    using Type1 = typename T::Pointer;
324    using Type2 = Pointer_t<T>;
325 
326    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
327    \endcode
328 */
329 template< typename T >
330 using Pointer_t = typename T::Pointer;
331 //*************************************************************************************************
332 
333 
334 //*************************************************************************************************
335 /*!\brief Alias declaration for nested \c Rebind class templates.
336 // \ingroup aliases
337 //
338 // The Rebind_t alias declaration provides a convenient shortcut to access the nested \a Rebind
339 // class template of the given type \a T1. The following code example shows both ways to access
340 // the nested class template:
341 
342    \code
343    using Type1 = typename T1::template Rebind<T2>::Other;
344    using Type2 = Rebind_t<T1,T2>;
345 
346    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
347    \endcode
348 */
349 template< typename T1, typename T2 >
350 using Rebind_t = typename T1::template Rebind<T2>::Other;
351 //*************************************************************************************************
352 
353 
354 //*************************************************************************************************
355 /*!\brief Alias declaration for nested \c rebind class templates.
356 // \ingroup aliases
357 //
358 // The rebind_t alias declaration provides a convenient shortcut to access the nested \a rebind
359 // class template of the given type \a T1. The following code example shows both ways to access
360 // the nested class template:
361 
362    \code
363    using Type1 = typename T1::template rebind<T2>::Other;
364    using Type2 = rebind_t<T1,T2>;
365 
366    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
367    \endcode
368 */
369 template< typename T1, typename T2 >
370 using rebind_t = typename T1::template rebind<T2>::other;
371 //*************************************************************************************************
372 
373 
374 //*************************************************************************************************
375 /*!\brief Alias declaration for nested \c Reference type definitions.
376 // \ingroup aliases
377 //
378 // The Reference_t alias declaration provides a convenient shortcut to access the nested
379 // \a Reference type definition of the given type \a T. The following code example shows
380 // both ways to access the nested type definition:
381 
382    \code
383    using Type1 = typename T::Reference;
384    using Type2 = Reference_t<T>;
385 
386    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
387    \endcode
388 */
389 template< typename T >
390 using Reference_t = typename T::Reference;
391 //*************************************************************************************************
392 
393 
394 //*************************************************************************************************
395 /*!\brief Alias declaration for nested \c RepresentedType type definitions.
396 // \ingroup aliases
397 //
398 // The RepresentedType_t alias declaration provides a convenient shortcut to access the nested
399 // \a RepresentedType type definition of the given type \a T. The following code example shows
400 // both ways to access the nested type definition:
401 
402    \code
403    using Type1 = typename T::RepresentedType;
404    using Type2 = RepresentedType_t<T>;
405 
406    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
407    \endcode
408 */
409 template< typename T >
410 using RepresentedType_t = typename T::RepresentedType;
411 //*************************************************************************************************
412 
413 
414 //*************************************************************************************************
415 /*!\brief Alias declaration for nested \c Resize class templates.
416 // \ingroup aliases
417 //
418 // The Resize_t alias declaration provides a convenient shortcut to access the nested \a Resize
419 // class template of the given type \a T1. The following code example shows both ways to access
420 // the nested class template:
421 
422    \code
423    using Type1 = typename T::template Resize<N>::Other;
424    using Type2 = Resize_t<T,N>;
425 
426    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
427    \endcode
428 */
429 template< typename T, size_t... Ns >
430 using Resize_t = typename T::template Resize<Ns...>::Other;
431 //*************************************************************************************************
432 
433 
434 //*************************************************************************************************
435 /*!\brief Alias declaration for nested \c ResultType type definitions.
436 // \ingroup aliases
437 //
438 // The ResultType_t alias declaration provides a convenient shortcut to access the nested
439 // \a ResultType type definition of the given type \a T. The following code example shows
440 // both ways to access the nested type definition:
441 
442    \code
443    using Type1 = typename T::ResultType;
444    using Type2 = ResultType_t<T>;
445 
446    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
447    \endcode
448 */
449 template< typename T >
450 using ResultType_t = typename T::ResultType;
451 //*************************************************************************************************
452 
453 
454 //*************************************************************************************************
455 /*!\brief Alias declaration for nested \c ReturnType type definitions.
456 // \ingroup aliases
457 //
458 // The ReturnType_t alias declaration provides a convenient shortcut to access the nested
459 // \a ReturnType type definition of the given type \a T. The following code example shows
460 // both ways to access the nested type definition:
461 
462    \code
463    using Type1 = typename T::ReturnType;
464    using Type2 = ReturnType_t<T>;
465 
466    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
467    \endcode
468 */
469 template< typename T >
470 using ReturnType_t = typename T::ReturnType;
471 //*************************************************************************************************
472 
473 
474 //*************************************************************************************************
475 /*!\brief Alias declaration for nested \c RightOperand type definitions.
476 // \ingroup aliases
477 //
478 // The RightOperand_t alias declaration provides a convenient shortcut to access the nested
479 // \a RightOperand type definition of the given type \a T. The following code example shows
480 // both ways to access the nested type definition:
481 
482    \code
483    using Type1 = typename T::RightOperand;
484    using Type2 = RightOperand_t<T>;
485 
486    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
487    \endcode
488 */
489 template< typename T >
490 using RightOperand_t = typename T::RightOperand;
491 //*************************************************************************************************
492 
493 
494 //*************************************************************************************************
495 /*!\brief Alias declaration for nested \c SIMDType type definitions.
496 // \ingroup aliases
497 //
498 // The SIMDType_t alias declaration provides a convenient shortcut to access the nested
499 // \a SIMDType type definition of the given type \a T. The following code example shows
500 // both ways to access the nested type definition:
501 
502    \code
503    using Type1 = typename T::SIMDType;
504    using Type2 = SIMDType_t<T>;
505 
506    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
507    \endcode
508 */
509 template< typename T >
510 using SIMDType_t = typename T::SIMDType;
511 //*************************************************************************************************
512 
513 
514 //*************************************************************************************************
515 /*!\brief Alias declaration for nested \c TagType type definitions.
516 // \ingroup aliases
517 //
518 // The TagType_t alias declaration provides a convenient shortcut to access the nested
519 // \a TagType type definition of the given type \a T. The following code example shows
520 // both ways to access the nested type definition:
521 
522    \code
523    using Type1 = typename T::TagType;
524    using Type2 = TagType_t<T>;
525 
526    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
527    \endcode
528 */
529 template< typename T >
530 using TagType_t = typename ResultType_t<T>::TagType;
531 //*************************************************************************************************
532 
533 
534 //*************************************************************************************************
535 /*!\brief Alias declaration for nested \c TransposeType type definitions.
536 // \ingroup aliases
537 //
538 // The TransposeType_t alias declaration provides a convenient shortcut to access the nested
539 // \a TransposeType type definition of the given type \a T. The following code example shows
540 // both ways to access the nested type definition:
541 
542    \code
543    using Type1 = typename T::TransposeType;
544    using Type2 = TransposeType_t<T>;
545 
546    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
547    \endcode
548 */
549 template< typename T >
550 using TransposeType_t = typename T::TransposeType;
551 //*************************************************************************************************
552 
553 
554 //*************************************************************************************************
555 /*!\brief Alias declaration for nested \c ValueType type definitions.
556 // \ingroup aliases
557 //
558 // The ValueType_t alias declaration provides a convenient shortcut to access the nested
559 // \a ValueType type definition of the given type \a T. The following code example shows
560 // both ways to access the nested type definition:
561 
562    \code
563    using Type1 = typename T::ValueType;
564    using Type2 = ValueType_t<T>;
565 
566    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
567    \endcode
568 */
569 template< typename T >
570 using ValueType_t = typename T::ValueType;
571 //*************************************************************************************************
572 
573 
574 //*************************************************************************************************
575 /*!\brief Alias declaration for nested \c VectorType type definitions.
576 // \ingroup aliases
577 //
578 // The VectorType_t alias declaration provides a convenient shortcut to access the nested
579 // \a VectorType type definition of the given type \a T. The following code example shows
580 // both ways to access the nested type definition:
581 
582    \code
583    using Type1 = typename T::VectorType;
584    using Type2 = VectorType_t<T>;
585 
586    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
587    \endcode
588 */
589 template< typename T >
590 using VectorType_t = typename T::VectorType;
591 //*************************************************************************************************
592 
593 
594 //*************************************************************************************************
595 /*!\brief Alias declaration for nested \c ViewedType type definitions.
596 // \ingroup aliases
597 //
598 // The ViewedType_t alias declaration provides a convenient shortcut to access the nested
599 // \a ViewedType type definition of the given type \a T. The following code example shows
600 // both ways to access the nested type definition:
601 
602    \code
603    using Type1 = typename T::ViewedType;
604    using Type2 = ViewedType_t<T>;
605 
606    BLAZE_CONSTRAINT_MUST_BE_STRICTLY_SAME_TYPE( Type1, Type2 );
607    \endcode
608 */
609 template< typename T >
610 using ViewedType_t = typename T::ViewedType;
611 //*************************************************************************************************
612 
613 } // namespace blaze
614 
615 #endif
616