ColumnExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_COLUMNEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_COLUMNEXPRTRAIT_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... CCAs > // Compile time column arguments
72 {
73  private:
74  //**********************************************************************************************
76  struct Failure { using Type = INVALID_TYPE; };
78  //**********************************************************************************************
79 
80  //**********************************************************************************************
82  struct CompileTime { using Type = decltype( column<CCAs...>( std::declval<MT>() ) ); };
84  //**********************************************************************************************
85 
86  //**********************************************************************************************
88  struct Runtime { using Type = decltype( column( std::declval<MT>(), std::declval<size_t>() ) ); };
90  //**********************************************************************************************
91 
92  public:
93  //**********************************************************************************************
95  using Type = typename If_< IsMatrix< RemoveReference_<MT> >
96  , IfTrue_< ( sizeof...( CCAs ) > 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... CCAs > // Compile time column arguments
121 using ColumnExprTrait_ = typename ColumnExprTrait<MT,CCAs...>::Type;
122 //*************************************************************************************************
123 
124 } // namespace blaze
125 
126 #endif
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
Header file for basic type definitions.
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.
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.
typename ColumnExprTrait< MT, CCAs... >::Type ColumnExprTrait_
Auxiliary alias declaration for the ColumnExprTrait type trait.The ColumnExprTrait_ alias declaration...
Definition: ColumnExprTrait.h:121
Evaluation of the expression type type of a column operation.Via this type trait it is possible to ev...
Definition: ColumnExprTrait.h:71