BandTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_BANDTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_BANDTRAIT_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, ptrdiff_t... > struct BandTrait;
60 template< typename, ptrdiff_t, typename = void > struct BandTraitEval1;
61 template< typename, ptrdiff_t, typename = void > struct BandTraitEval2;
63 //*************************************************************************************************
64 
65 
66 //*************************************************************************************************
68 template< ptrdiff_t I, typename T >
69 auto evalBandTrait( T& )
70  -> typename BandTraitEval1<T,I>::Type;
71 
72 template< typename T >
73 auto evalBandTrait( T& )
74  -> typename BandTraitEval2<T,inf>::Type;
75 
76 template< ptrdiff_t I, typename T >
77 auto evalBandTrait( const T& )
78  -> typename BandTrait<T,I>::Type;
79 
80 template< typename T >
81 auto evalBandTrait( const T& )
82  -> typename BandTrait<T>::Type;
83 
84 template< ptrdiff_t I, typename T >
85 auto evalBandTrait( const volatile T& )
86  -> typename BandTrait<T,I>::Type;
87 
88 template< typename T >
89 auto evalBandTrait( const volatile T& )
90  -> typename BandTrait<T>::Type;
92 //*************************************************************************************************
93 
94 
95 //*************************************************************************************************
141 template< typename MT // Type of the matrix
142  , ptrdiff_t... CBAs > // Compile time band arguments
143 struct BandTrait
144 {
145  public:
146  //**********************************************************************************************
148  using Type = decltype( evalBandTrait<CBAs...>( std::declval<MT&>() ) );
150  //**********************************************************************************************
151 };
152 //*************************************************************************************************
153 
154 
155 //*************************************************************************************************
168 template< typename MT // Type of the matrix
169  , ptrdiff_t... CBAs > // Compile time band arguments
170 using BandTrait_t = typename BandTrait<MT,CBAs...>::Type;
171 //*************************************************************************************************
172 
173 
174 //*************************************************************************************************
179 template< typename MT // Type of the matrix
180  , ptrdiff_t I // Compile time band index
181  , typename > // Restricting condition
182 struct BandTraitEval1
183 {
184  using Type = typename BandTraitEval2<MT,I>::Type;
185 };
187 //*************************************************************************************************
188 
189 
190 //*************************************************************************************************
195 template< typename MT // Type of the matrix
196  , ptrdiff_t I // Compile time band index
197  , typename > // Restricting condition
198 struct BandTraitEval2
199 {
200  using Type = INVALID_TYPE;
201 };
203 //*************************************************************************************************
204 
205 } // namespace blaze
206 
207 #endif
Pointer difference type of the Blaze library.
Header file for basic type definitions.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Numerical infinity for built-in data types.
Utility type for generic codes.
typename BandTrait< MT, CBAs... >::Type BandTrait_t
Auxiliary alias declaration for the BandTrait type trait.The BandTrait_t alias declaration provides a...
Definition: BandTrait.h:170
Base template for the BandTrait class.
Definition: BandTrait.h:143