RowTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_ROWTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_ROWTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
44 #include <blaze/math/Infinity.h>
45 #include <blaze/util/InvalidType.h>
46 #include <blaze/util/Types.h>
47 
48 
49 namespace blaze {
50 
51 //=================================================================================================
52 //
53 // CLASS DEFINITION
54 //
55 //=================================================================================================
56 
57 //*************************************************************************************************
59 template< typename, size_t... > struct RowTrait;
60 template< typename, size_t, typename = void > struct RowTraitEval1;
61 template< typename, size_t, typename = void > struct RowTraitEval2;
63 //*************************************************************************************************
64 
65 
66 //*************************************************************************************************
68 template< size_t I, typename T >
69 auto evalRowTrait( T& )
70  -> typename RowTraitEval1<T,I>::Type;
71 
72 template< typename T >
73 auto evalRowTrait( T& )
74  -> typename RowTraitEval2<T,inf>::Type;
75 
76 template< size_t I, typename T >
77 auto evalRowTrait( const T& )
78  -> typename RowTrait<T,I>::Type;
79 
80 template< typename T >
81 auto evalRowTrait( const T& )
82  -> typename RowTrait<T>::Type;
83 
84 template< size_t I, typename T >
85 auto evalRowTrait( const volatile T& )
86  -> typename RowTrait<T,I>::Type;
87 
88 template< typename T >
89 auto evalRowTrait( const volatile T& )
90  -> typename RowTrait<T>::Type;
92 //*************************************************************************************************
93 
94 
95 //*************************************************************************************************
141 template< typename MT // Type of the matrix
142  , size_t... CRAs > // Compile time row arguments
143 struct RowTrait
144 {
145  public:
146  //**********************************************************************************************
148  using Type = decltype( evalRowTrait<CRAs...>( std::declval<MT&>() ) );
150  //**********************************************************************************************
151 };
152 //*************************************************************************************************
153 
154 
155 //*************************************************************************************************
168 template< typename MT // Type of the matrix
169  , size_t... CRAs > // Compile time row arguments
170 using RowTrait_t = typename RowTrait<MT,CRAs...>::Type;
171 //*************************************************************************************************
172 
173 
174 //*************************************************************************************************
179 template< typename MT // Type of the matrix
180  , size_t I // Compile time row index
181  , typename > // Restricting condition
182 struct RowTraitEval1
183 {
184  public:
185  //**********************************************************************************************
186  using Type = typename RowTraitEval2<MT,I>::Type;
187  //**********************************************************************************************
188 };
190 //*************************************************************************************************
191 
192 
193 //*************************************************************************************************
198 template< typename MT // Type of the matrix
199  , size_t I // Compile time row index
200  , typename > // Restricting condition
201 struct RowTraitEval2
202 {
203  public:
204  //**********************************************************************************************
205  using Type = INVALID_TYPE;
206  //**********************************************************************************************
207 };
209 //*************************************************************************************************
210 
211 } // namespace blaze
212 
213 #endif
Header file for basic type definitions.
Base template for the RowTrait class.
Definition: RowTrait.h:143
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Numerical infinity for built-in data types.
Utility type for generic codes.
typename RowTrait< MT, CRAs... >::Type RowTrait_t
Auxiliary alias declaration for the RowTrait type trait.The RowTrait_t alias declaration provides a c...
Definition: RowTrait.h:170