Blaze  3.6
Kron.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_KRON_H_
36 #define _BLAZE_MATH_FUNCTORS_KRON_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
61 #include <blaze/system/Inline.h>
63 
64 
65 namespace blaze {
66 
67 //=================================================================================================
68 //
69 // CLASS DEFINITION
70 //
71 //=================================================================================================
72 
73 //*************************************************************************************************
77 struct Kron
78 {
79  //**********************************************************************************************
86  template< typename T1, typename T2 >
87  BLAZE_ALWAYS_INLINE decltype(auto) operator()( const T1& a, const T2& b ) const
88  {
89  return kron( a, b );
90  }
91  //**********************************************************************************************
92 };
93 //*************************************************************************************************
94 
95 
96 
97 
98 //=================================================================================================
99 //
100 // YIELDSUNIFORM SPECIALIZATIONS
101 //
102 //=================================================================================================
103 
104 //*************************************************************************************************
106 template< typename T1, typename T2 >
107 struct YieldsUniform<Kron,T1,T2>
108  : public BoolConstant< IsUniform_v<T1> && IsUniform_v<T2> >
109 {};
111 //*************************************************************************************************
112 
113 
114 
115 
116 //=================================================================================================
117 //
118 // YIELDSSYMMETRIC SPECIALIZATIONS
119 //
120 //=================================================================================================
121 
122 //*************************************************************************************************
124 template< typename MT1, typename MT2 >
125 struct YieldsSymmetric<Kron,MT1,MT2>
126  : public BoolConstant< IsSymmetric_v<MT1> && IsSymmetric_v<MT2> >
127 {};
129 //*************************************************************************************************
130 
131 
132 
133 
134 //=================================================================================================
135 //
136 // YIELDSLOWER SPECIALIZATIONS
137 //
138 //=================================================================================================
139 
140 //*************************************************************************************************
142 template< typename MT1, typename MT2 >
143 struct YieldsLower<Kron,MT1,MT2>
144  : public BoolConstant< IsLower_v<MT1> && IsLower_v<MT2> >
145 {};
147 //*************************************************************************************************
148 
149 
150 
151 
152 //=================================================================================================
153 //
154 // YIELDSUNILOWER SPECIALIZATIONS
155 //
156 //=================================================================================================
157 
158 //*************************************************************************************************
160 template< typename MT1, typename MT2 >
161 struct YieldsUniLower<Kron,MT1,MT2>
162  : public BoolConstant< IsUniLower_v<MT1> && IsUniLower_v<MT2> >
163 {};
165 //*************************************************************************************************
166 
167 
168 
169 
170 //=================================================================================================
171 //
172 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
173 //
174 //=================================================================================================
175 
176 //*************************************************************************************************
178 template< typename MT1, typename MT2 >
179 struct YieldsStrictlyLower<Kron,MT1,MT2>
180  : public BoolConstant< IsStrictlyLower_v<MT1> || ( IsLower_v<MT1> && IsStrictlyLower_v<MT2> ) >
181 {};
183 //*************************************************************************************************
184 
185 
186 
187 
188 //=================================================================================================
189 //
190 // YIELDSUPPER SPECIALIZATIONS
191 //
192 //=================================================================================================
193 
194 //*************************************************************************************************
196 template< typename MT1, typename MT2 >
197 struct YieldsUpper<Kron,MT1,MT2>
198  : public BoolConstant< IsUpper_v<MT1> && IsUpper_v<MT2> >
199 {};
201 //*************************************************************************************************
202 
203 
204 
205 
206 //=================================================================================================
207 //
208 // YIELDUNISUPPER SPECIALIZATIONS
209 //
210 //=================================================================================================
211 
212 //*************************************************************************************************
214 template< typename MT1, typename MT2 >
215 struct YieldsUniUpper<Kron,MT1,MT2>
216  : public BoolConstant< IsUniUpper_v<MT1> && IsUniUpper_v<MT2> >
217 {};
219 //*************************************************************************************************
220 
221 
222 
223 
224 //=================================================================================================
225 //
226 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
227 //
228 //=================================================================================================
229 
230 //*************************************************************************************************
232 template< typename MT1, typename MT2 >
233 struct YieldsStrictlyUpper<Kron,MT1,MT2>
234  : public BoolConstant< IsStrictlyUpper_v<MT1> || ( IsUpper_v<MT1> && IsStrictlyUpper_v<MT2> ) >
235 {};
237 //*************************************************************************************************
238 
239 
240 
241 
242 //=================================================================================================
243 //
244 // YIELDSZERO SPECIALIZATIONS
245 //
246 //=================================================================================================
247 
248 //*************************************************************************************************
250 template< typename T1, typename T2 >
251 struct YieldsZero<Kron,T1,T2>
252  : public BoolConstant< IsZero_v<T1> || IsZero_v<T2> >
253 {};
255 //*************************************************************************************************
256 
257 } // namespace blaze
258 
259 #endif
Header file for the IsUniUpper type trait.
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero type trait.
Header file for the IsUniLower type trait.
decltype(auto) kron(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the Kronecker product of two dense matrices ( ).
Definition: DMatDMatKronExpr.h:954
Header file for the IsUniform type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Generic wrapper for the Kronecker product.
Definition: Kron.h:77
Header file for the YieldsStrictlyUpper type trait.
Header file for the YieldsUniLower type trait.
Header file for the IsLower type trait.
Header file for the IsStrictlyLower type trait.
Header file for the YieldsUniform type trait.
Header file for the YieldsSymmetric type trait.
Header file for the YieldsUpper type trait.
Header file for the IsZero type trait.
Header file for the YieldsLower type trait.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
Header file for the IntegralConstant class template.
Header file for the IsUpper type trait.
Header file for the YieldsUniUpper type trait.
System settings for the inline keywords.