Qdrt.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_QDRT_H_
36 #define _BLAZE_MATH_FUNCTORS_QDRT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/shims/Qdrt.h>
66 #include <blaze/system/Inline.h>
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // CLASS DEFINITION
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
81 struct Qdrt
82 {
83  //**********************************************************************************************
86  explicit inline Qdrt()
87  {}
88  //**********************************************************************************************
89 
90  //**********************************************************************************************
96  template< typename T >
97  BLAZE_ALWAYS_INLINE decltype(auto) operator()( const T& a ) const
98  {
99  return qdrt( a );
100  }
101  //**********************************************************************************************
102 
103  //**********************************************************************************************
108  template< typename T >
109  static constexpr bool simdEnabled() { return HasSIMDSqrt_v<T>; }
110  //**********************************************************************************************
111 
112  //**********************************************************************************************
117  static constexpr bool paddingEnabled() { return true; }
118  //**********************************************************************************************
119 
120  //**********************************************************************************************
126  template< typename T >
127  BLAZE_ALWAYS_INLINE decltype(auto) load( const T& a ) const
128  {
130  return qdrt( a );
131  }
132  //**********************************************************************************************
133 };
134 //*************************************************************************************************
135 
136 
137 
138 
139 //=================================================================================================
140 //
141 // YIELDSUNIFORM SPECIALIZATIONS
142 //
143 //=================================================================================================
144 
145 //*************************************************************************************************
147 template< typename T >
148 struct YieldsUniform<Qdrt,T>
149  : public IsUniform<T>
150 {};
152 //*************************************************************************************************
153 
154 
155 
156 
157 //=================================================================================================
158 //
159 // YIELDSSYMMETRIC SPECIALIZATIONS
160 //
161 //=================================================================================================
162 
163 //*************************************************************************************************
165 template< typename MT >
166 struct YieldsSymmetric<Qdrt,MT>
167  : public IsSymmetric<MT>
168 {};
170 //*************************************************************************************************
171 
172 
173 
174 
175 //=================================================================================================
176 //
177 // YIELDSHERMITIAN SPECIALIZATIONS
178 //
179 //=================================================================================================
180 
181 //*************************************************************************************************
183 template< typename MT >
184 struct YieldsHermitian<Qdrt,MT>
185  : public IsHermitian<MT>
186 {};
188 //*************************************************************************************************
189 
190 
191 
192 
193 //=================================================================================================
194 //
195 // YIELDSLOWER SPECIALIZATIONS
196 //
197 //=================================================================================================
198 
199 //*************************************************************************************************
201 template< typename MT >
202 struct YieldsLower<Qdrt,MT>
203  : public IsLower<MT>
204 {};
206 //*************************************************************************************************
207 
208 
209 
210 
211 //=================================================================================================
212 //
213 // YIELDSUNILOWER SPECIALIZATIONS
214 //
215 //=================================================================================================
216 
217 //*************************************************************************************************
219 template< typename MT >
220 struct YieldsUniLower<Qdrt,MT>
221  : public IsUniLower<MT>
222 {};
224 //*************************************************************************************************
225 
226 
227 
228 
229 //=================================================================================================
230 //
231 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
232 //
233 //=================================================================================================
234 
235 //*************************************************************************************************
237 template< typename MT >
238 struct YieldsStrictlyLower<Qdrt,MT>
239  : public IsStrictlyLower<MT>
240 {};
242 //*************************************************************************************************
243 
244 
245 
246 
247 //=================================================================================================
248 //
249 // YIELDSUPPER SPECIALIZATIONS
250 //
251 //=================================================================================================
252 
253 //*************************************************************************************************
255 template< typename MT >
256 struct YieldsUpper<Qdrt,MT>
257  : public IsUpper<MT>
258 {};
260 //*************************************************************************************************
261 
262 
263 
264 
265 //=================================================================================================
266 //
267 // YIELDSUNIUPPER SPECIALIZATIONS
268 //
269 //=================================================================================================
270 
271 //*************************************************************************************************
273 template< typename MT >
274 struct YieldsUniUpper<Qdrt,MT>
275  : public IsUniUpper<MT>
276 {};
278 //*************************************************************************************************
279 
280 
281 
282 
283 //=================================================================================================
284 //
285 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
286 //
287 //=================================================================================================
288 
289 //*************************************************************************************************
291 template< typename MT >
292 struct YieldsStrictlyUpper<Qdrt,MT>
293  : public IsStrictlyUpper<MT>
294 {};
296 //*************************************************************************************************
297 
298 
299 
300 
301 //=================================================================================================
302 //
303 // YIELDSZERO SPECIALIZATIONS
304 //
305 //=================================================================================================
306 
307 //*************************************************************************************************
309 template< typename T >
310 struct YieldsZero<Qdrt,T>
311  : public IsZero<T>
312 {};
314 //*************************************************************************************************
315 
316 } // namespace blaze
317 
318 #endif
Header file for the IsUniUpper type trait.
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero type trait.
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Qdrt.h:109
Generic wrapper for the qdrt() function.
Definition: Qdrt.h:81
Header file for the IsUniLower type trait.
#define BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK(T)
Constraint on the data type.In case the given data type T is not a SIMD pack, a compilation error is ...
Definition: SIMDPack.h:60
decltype(auto) BLAZE_ALWAYS_INLINE qdrt(const T &a)
Computing the quad root (4th root) of the given value/object.
Definition: Qdrt.h:65
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
Header file for the YieldsStrictlyUpper type trait.
Header file for the YieldsUniLower type trait.
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Qdrt.h:117
Header file for the IsLower type trait.
Header file for the qdrt shim.
Constraint on the data type.
Header file for the IsStrictlyLower type trait.
decltype(auto) BLAZE_ALWAYS_INLINE load(const T &a) const
Returns the result of the qdrt() function for the given SIMD vector.
Definition: Qdrt.h:127
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 HasSIMDSqrt type trait.
Qdrt()
Default constructor of the Qdrt functor.
Definition: Qdrt.h:86
Header file for the YieldsLower type trait.
Header file for the IsUpper type trait.
Header file for the YieldsUniUpper type trait.
Header file for the YieldsHermitian type trait.
Header file for the IsHermitian type trait.
System settings for the inline keywords.