SubmatrixExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_SUBMATRIXEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_SUBMATRIXEXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
47 #include <blaze/util/InvalidType.h>
48 #include <blaze/util/mpl/If.h>
50 
51 
52 namespace blaze {
53 
54 //=================================================================================================
55 //
56 // CLASS DEFINITION
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
69 template< typename MT // Type of the matrix operand
70  , AlignmentFlag AF = unaligned // Alignment flag
71  , size_t... CSAs > // Compile time submatrix arguments
73 {
74  private:
75  //**********************************************************************************************
77  struct Failure { using Type = INVALID_TYPE; };
79  //**********************************************************************************************
80 
81  //**********************************************************************************************
83  struct CompileTime { using Type = decltype( submatrix<AF,CSAs...>( std::declval<MT>() ) ); };
85  //**********************************************************************************************
86 
87  //**********************************************************************************************
89  struct Runtime { using Type = decltype( submatrix<AF>( std::declval<MT>()
90  , std::declval<size_t>()
91  , std::declval<size_t>()
92  , std::declval<size_t>()
93  , std::declval<size_t>() ) ); };
95  //**********************************************************************************************
96 
97  public:
98  //**********************************************************************************************
100  using Type = typename If_< IsMatrix< RemoveReference_<MT> >
101  , IfTrue_< ( sizeof...( CSAs ) > 0UL )
102  , CompileTime
103  , Runtime >
104  , Failure >::Type;
106  //**********************************************************************************************
107 };
108 //*************************************************************************************************
109 
110 
111 //*************************************************************************************************
124 template< typename MT // Type of the matrix operand
125  , AlignmentFlag AF = unaligned // Alignment flag
126  , size_t... CSAs > // Compile time submatrix arguments
127 using SubmatrixExprTrait_ = typename SubmatrixExprTrait<MT,AF,CSAs...>::Type;
128 //*************************************************************************************************
129 
130 } // namespace blaze
131 
132 #endif
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.Via these flags it is possible to specify subvec...
Definition: AlignmentFlag.h:62
Header file for the alignment flag values.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
Header file for the IsMatrix type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:72
Header file for all forward declarations for views.
Utility type for generic codes.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
typename SubmatrixExprTrait< MT, AF, CSAs... >::Type SubmatrixExprTrait_
Auxiliary alias declaration for the SubmatrixExprTrait type trait.The SubmatrixExprTrait_ alias decla...
Definition: SubmatrixExprTrait.h:127
Header file for the RemoveReference type trait.
Flag for unaligned vectors and matrices.
Definition: AlignmentFlag.h:64