Blaze  3.6
Atan2.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_ATAN2_H_
36 #define _BLAZE_MATH_FUNCTORS_ATAN2_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/shims/Atan2.h>
45 #include <blaze/math/simd/Atan2.h>
62 #include <blaze/system/Inline.h>
64 
65 
66 namespace blaze {
67 
68 //=================================================================================================
69 //
70 // CLASS DEFINITION
71 //
72 //=================================================================================================
73 
74 //*************************************************************************************************
78 struct Atan2
79 {
80  //**********************************************************************************************
87  template< typename T1, typename T2 >
88  BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) operator()( const T1& a, const T2& b ) const
89  {
90  return atan2( a, b );
91  }
92  //**********************************************************************************************
93 
94  //**********************************************************************************************
99  template< typename T1, typename T2 >
100  static constexpr bool simdEnabled() { return HasSIMDAtan2_v<T1,T2>; }
101  //**********************************************************************************************
102 
103  //**********************************************************************************************
108  static constexpr bool paddingEnabled() { return true; }
109  //**********************************************************************************************
110 
111  //**********************************************************************************************
118  template< typename T1, typename T2 >
119  BLAZE_ALWAYS_INLINE decltype(auto) load( const T1& a, const T2& b ) const
120  {
123  return atan2( a, b );
124  }
125  //**********************************************************************************************
126 };
127 //*************************************************************************************************
128 
129 
130 
131 
132 //=================================================================================================
133 //
134 // YIELDSUNIFORM SPECIALIZATIONS
135 //
136 //=================================================================================================
137 
138 //*************************************************************************************************
140 template< typename T1, typename T2 >
141 struct YieldsUniform<Atan2,T1,T2>
142  : public BoolConstant< IsUniform_v<T1> && IsUniform_v<T2> >
143 {};
145 //*************************************************************************************************
146 
147 
148 
149 
150 //=================================================================================================
151 //
152 // YIELDSSYMMETRIC SPECIALIZATIONS
153 //
154 //=================================================================================================
155 
156 //*************************************************************************************************
158 template< typename MT1, typename MT2 >
159 struct YieldsSymmetric<Atan2,MT1,MT2>
160  : public BoolConstant< IsSymmetric_v<MT1> && IsSymmetric_v<MT2> >
161 {};
163 //*************************************************************************************************
164 
165 
166 
167 
168 //=================================================================================================
169 //
170 // YIELDSLOWER SPECIALIZATIONS
171 //
172 //=================================================================================================
173 
174 //*************************************************************************************************
176 template< typename MT1, typename MT2 >
177 struct YieldsLower<Atan2,MT1,MT2>
178  : public BoolConstant< IsLower_v<MT1> && IsLower_v<MT2> >
179 {};
181 //*************************************************************************************************
182 
183 
184 
185 
186 //=================================================================================================
187 //
188 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
189 //
190 //=================================================================================================
191 
192 //*************************************************************************************************
194 template< typename MT1, typename MT2 >
195 struct YieldsStrictlyLower<Atan2,MT1,MT2>
196  : public BoolConstant< IsStrictlyLower_v<MT1> && IsStrictlyLower_v<MT2> >
197 {};
199 //*************************************************************************************************
200 
201 
202 
203 
204 //=================================================================================================
205 //
206 // YIELDSUPPER SPECIALIZATIONS
207 //
208 //=================================================================================================
209 
210 //*************************************************************************************************
212 template< typename MT1, typename MT2 >
213 struct YieldsUpper<Atan2,MT1,MT2>
214  : public BoolConstant< IsUpper_v<MT1> && IsUpper_v<MT2> >
215 {};
217 //*************************************************************************************************
218 
219 
220 
221 
222 //=================================================================================================
223 //
224 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
225 //
226 //=================================================================================================
227 
228 //*************************************************************************************************
230 template< typename MT1, typename MT2 >
231 struct YieldsStrictlyUpper<Atan2,MT1,MT2>
232  : public BoolConstant< IsStrictlyUpper_v<MT1> && IsStrictlyUpper_v<MT2> >
233 {};
235 //*************************************************************************************************
236 
237 
238 
239 
240 //=================================================================================================
241 //
242 // YIELDSZERO SPECIALIZATIONS
243 //
244 //=================================================================================================
245 
246 //*************************************************************************************************
248 template< typename T1, typename T2 >
249 struct YieldsZero<Atan2,T1,T2>
250  : public BoolConstant< IsZero_v<T1> && IsZero_v<T2> >
251 {};
253 //*************************************************************************************************
254 
255 } // namespace blaze
256 
257 #endif
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Atan2.h:108
Generic wrapper for the atan2() function.
Definition: Atan2.h:78
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero 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 T1 &a, const T2 &b) const
Returns the result of the atan2() function for the given SIMD vectors.
Definition: Atan2.h:119
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 IsLower type trait.
decltype(auto) atan2(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the multi-valued inverse tangent of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1307
Constraint on the data type.
Header file for the IsStrictlyLower type trait.
Header file for the YieldsUniform type trait.
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data types T1 and T2.
Definition: Atan2.h:100
Header file for the YieldsSymmetric type trait.
Header file for the HasSIMDAtan2 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 SIMD multi-valued inverse tangent functionality.
Macro for CUDA compatibility.
Header file for the IntegralConstant class template.
Header file for the atan2 shim.
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
Header file for the IsUpper type trait.
System settings for the inline keywords.