Blaze  3.6
KronTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_KRONTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_KRONTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
44 #include <blaze/util/EnableIf.h>
45 #include <blaze/util/InvalidType.h>
46 #include <blaze/util/mpl/If.h>
47 
48 
49 namespace blaze {
50 
51 //=================================================================================================
52 //
53 // CLASS DEFINITION
54 //
55 //=================================================================================================
56 
57 //*************************************************************************************************
59 template< typename, typename, typename = void > struct KronTrait;
60 template< typename, typename, typename = void > struct KronTraitEval1;
61 template< typename, typename, typename = void > struct KronTraitEval2;
63 //*************************************************************************************************
64 
65 
66 //*************************************************************************************************
68 template< typename T1, typename T2 >
69 auto evalKronTrait( T1&, T2& )
70  -> typename KronTraitEval1<T1,T2>::Type;
71 
72 template< typename T1, typename T2 >
73 auto evalKronTrait( const T1&, const T2& )
74  -> typename KronTrait<T1,T2>::Type;
75 
76 template< typename T1, typename T2 >
77 auto evalKronTrait( const volatile T1&, const T2& )
78  -> typename KronTrait<T1,T2>::Type;
79 
80 template< typename T1, typename T2 >
81 auto evalKronTrait( const T1&, const volatile T2& )
82  -> typename KronTrait<T1,T2>::Type;
83 
84 template< typename T1, typename T2 >
85 auto evalKronTrait( const volatile T1&, const volatile T2& )
86  -> typename KronTrait<T1,T2>::Type;
88 //*************************************************************************************************
89 
90 
91 //*************************************************************************************************
134 template< typename T1 // Type of the left-hand side operand
135  , typename T2 // Type of the right-hand side operand
136  , typename > // Restricting condition
137 struct KronTrait
138 {
139  public:
140  //**********************************************************************************************
142  using Type = decltype( evalKronTrait( std::declval<T1&>(), std::declval<T2&>() ) );
144  //**********************************************************************************************
145 };
146 //*************************************************************************************************
147 
148 
149 //*************************************************************************************************
162 template< typename T1, typename T2 >
164 //*************************************************************************************************
165 
166 
167 //*************************************************************************************************
172 template< typename T1 // Type of the left-hand side operand
173  , typename T2 // Type of the right-hand side operand
174  , typename > // Restricting condition
175 struct KronTraitEval1
176 {
177  public:
178  //**********************************************************************************************
179  using Type = typename KronTraitEval2<T1,T2>::Type;
180  //**********************************************************************************************
181 };
183 //*************************************************************************************************
184 
185 
186 //*************************************************************************************************
191 template< typename T1 // Type of the left-hand side operand
192  , typename T2 // Type of the right-hand side operand
193  , typename > // Restricting condition
194 struct KronTraitEval2
195 {
196  public:
197  //**********************************************************************************************
198  using Type = INVALID_TYPE;
199  //**********************************************************************************************
200 };
202 //*************************************************************************************************
203 
204 } // namespace blaze
205 
206 #endif
Base template for the KronTrait class.
Definition: KronTrait.h:137
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
typename KronTrait< T1, T2 >::Type KronTrait_t
Auxiliary alias declaration for the KronTrait class template.The KronTrait_t alias declaration provid...
Definition: KronTrait.h:163
Header file for the EnableIf class template.
Utility type for generic codes.