Cbrt.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_CBRT_H_
36 #define _BLAZE_MATH_FUNCTORS_CBRT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/shims/Cbrt.h>
45 #include <blaze/math/simd/Cbrt.h>
65 #include <blaze/system/Inline.h>
66 
67 
68 namespace blaze {
69 
70 //=================================================================================================
71 //
72 // CLASS DEFINITION
73 //
74 //=================================================================================================
75 
76 //*************************************************************************************************
80 struct Cbrt
81 {
82  //**********************************************************************************************
85  explicit inline Cbrt()
86  {}
87  //**********************************************************************************************
88 
89  //**********************************************************************************************
95  template< typename T >
96  BLAZE_ALWAYS_INLINE decltype(auto) operator()( const T& a ) const
97  {
98  return cbrt( a );
99  }
100  //**********************************************************************************************
101 
102  //**********************************************************************************************
107  template< typename T >
108  static constexpr bool simdEnabled() { return HasSIMDCbrt_v<T>; }
109  //**********************************************************************************************
110 
111  //**********************************************************************************************
116  static constexpr bool paddingEnabled() { return true; }
117  //**********************************************************************************************
118 
119  //**********************************************************************************************
125  template< typename T >
126  BLAZE_ALWAYS_INLINE decltype(auto) load( const T& a ) const
127  {
129  return cbrt( a );
130  }
131  //**********************************************************************************************
132 };
133 //*************************************************************************************************
134 
135 
136 
137 
138 //=================================================================================================
139 //
140 // YIELDSUNIFORM SPECIALIZATIONS
141 //
142 //=================================================================================================
143 
144 //*************************************************************************************************
146 template< typename T >
147 struct YieldsUniform<Cbrt,T>
148  : public IsUniform<T>
149 {};
151 //*************************************************************************************************
152 
153 
154 
155 
156 //=================================================================================================
157 //
158 // YIELDSSYMMETRIC SPECIALIZATIONS
159 //
160 //=================================================================================================
161 
162 //*************************************************************************************************
164 template< typename MT >
165 struct YieldsSymmetric<Cbrt,MT>
166  : public IsSymmetric<MT>
167 {};
169 //*************************************************************************************************
170 
171 
172 
173 
174 //=================================================================================================
175 //
176 // YIELDSLOWER SPECIALIZATIONS
177 //
178 //=================================================================================================
179 
180 //*************************************************************************************************
182 template< typename MT >
183 struct YieldsLower<Cbrt,MT>
184  : public IsLower<MT>
185 {};
187 //*************************************************************************************************
188 
189 
190 
191 
192 //=================================================================================================
193 //
194 // YIELDSUNILOWER SPECIALIZATIONS
195 //
196 //=================================================================================================
197 
198 //*************************************************************************************************
200 template< typename MT >
201 struct YieldsUniLower<Cbrt,MT>
202  : public IsUniLower<MT>
203 {};
205 //*************************************************************************************************
206 
207 
208 
209 
210 //=================================================================================================
211 //
212 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
213 //
214 //=================================================================================================
215 
216 //*************************************************************************************************
218 template< typename MT >
219 struct YieldsStrictlyLower<Cbrt,MT>
220  : public IsStrictlyLower<MT>
221 {};
223 //*************************************************************************************************
224 
225 
226 
227 
228 //=================================================================================================
229 //
230 // YIELDSUPPER SPECIALIZATIONS
231 //
232 //=================================================================================================
233 
234 //*************************************************************************************************
236 template< typename MT >
237 struct YieldsUpper<Cbrt,MT>
238  : public IsUpper<MT>
239 {};
241 //*************************************************************************************************
242 
243 
244 
245 
246 //=================================================================================================
247 //
248 // YIELDSUNIUPPER SPECIALIZATIONS
249 //
250 //=================================================================================================
251 
252 //*************************************************************************************************
254 template< typename MT >
255 struct YieldsUniUpper<Cbrt,MT>
256  : public IsUniUpper<MT>
257 {};
259 //*************************************************************************************************
260 
261 
262 
263 
264 //=================================================================================================
265 //
266 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
267 //
268 //=================================================================================================
269 
270 //*************************************************************************************************
272 template< typename MT >
273 struct YieldsStrictlyUpper<Cbrt,MT>
274  : public IsStrictlyUpper<MT>
275 {};
277 //*************************************************************************************************
278 
279 
280 
281 
282 //=================================================================================================
283 //
284 // YIELDSZERO SPECIALIZATIONS
285 //
286 //=================================================================================================
287 
288 //*************************************************************************************************
290 template< typename T >
291 struct YieldsZero<Cbrt,T>
292  : public IsZero<T>
293 {};
295 //*************************************************************************************************
296 
297 } // namespace blaze
298 
299 #endif
Header file for the SIMD cubit root functionality.
Generic wrapper for the cbrt() function.
Definition: Cbrt.h:80
Header file for the IsUniUpper type trait.
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Cbrt.h:108
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero type trait.
Header file for the IsUniLower type trait.
Header file for the HasSIMDCbrt 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 load(const T &a) const
Returns the result of the cbrt() function for the given SIMD vector.
Definition: Cbrt.h:126
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.
decltype(auto) cbrt(const DenseMatrix< MT, SO > &dm)
Computes the cubic root of each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1517
Header file for the IsLower type trait.
Constraint on the data type.
Header file for the IsStrictlyLower type trait.
Cbrt()
Default constructor of the Cbrt functor.
Definition: Cbrt.h:85
Header file for the YieldsUniform type trait.
Header file for the YieldsSymmetric type trait.
Header file for the cbrt shim.
Header file for the YieldsUpper type trait.
Header file for the IsZero type trait.
Header file for the YieldsLower type trait.
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Cbrt.h:116
Header file for the IsUpper type trait.
Header file for the YieldsUniUpper type trait.
System settings for the inline keywords.