RowsExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_ROWSEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_ROWSEXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
46 #include <blaze/util/InvalidType.h>
47 #include <blaze/util/mpl/If.h>
48 #include <blaze/util/Types.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  , size_t... CRAs > // Compile time row arguments
72 {
73  private:
74  //**********************************************************************************************
76  struct Failure { using Type = INVALID_TYPE; };
78  //**********************************************************************************************
79 
80  //**********************************************************************************************
82  struct CompileTime { using Type = decltype( rows<CRAs...>( std::declval<MT>() ) ); };
84  //**********************************************************************************************
85 
86  //**********************************************************************************************
88  struct Runtime { using Type = decltype( rows( std::declval<MT>(), { std::declval<size_t>() } ) ); };
90  //**********************************************************************************************
91 
92  public:
93  //**********************************************************************************************
95  using Type = typename If_< IsMatrix< RemoveReference_<MT> >
96  , IfTrue_< ( sizeof...( CRAs ) > 0UL )
97  , CompileTime
98  , Runtime >
99  , Failure >::Type;
101  //**********************************************************************************************
102 };
103 //*************************************************************************************************
104 
105 
106 //*************************************************************************************************
119 template< typename MT // Type of the matrix operand
120  , size_t... CRAs > // Compile time row arguments
121 using RowsExprTrait_ = typename RowsExprTrait<MT,CRAs...>::Type;
122 //*************************************************************************************************
123 
124 } // namespace blaze
125 
126 #endif
Header file for basic type definitions.
typename RowsExprTrait< MT, CRAs... >::Type RowsExprTrait_
Auxiliary alias declaration for the RowsExprTrait type trait.The RowsExprTrait_ alias declaration pro...
Definition: RowsExprTrait.h:121
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 rows operation.Via this type trait it is possible to eval...
Definition: RowsExprTrait.h:71
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
Header file for the RemoveReference type trait.
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490