Blaze  3.6
Tan.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_TAN_H_
36 #define _BLAZE_MATH_FUNCTORS_TAN_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/shims/Tan.h>
45 #include <blaze/math/simd/Tan.h>
64 #include <blaze/system/Inline.h>
65 
66 
67 namespace blaze {
68 
69 //=================================================================================================
70 //
71 // CLASS DEFINITION
72 //
73 //=================================================================================================
74 
75 //*************************************************************************************************
79 struct Tan
80 {
81  //**********************************************************************************************
87  template< typename T >
88  BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) operator()( const T& a ) const
89  {
90  return tan( a );
91  }
92  //**********************************************************************************************
93 
94  //**********************************************************************************************
99  template< typename T >
100  static constexpr bool simdEnabled() { return HasSIMDTan_v<T>; }
101  //**********************************************************************************************
102 
103  //**********************************************************************************************
108  static constexpr bool paddingEnabled() { return true; }
109  //**********************************************************************************************
110 
111  //**********************************************************************************************
117  template< typename T >
118  BLAZE_ALWAYS_INLINE decltype(auto) load( const T& a ) const
119  {
121  return tan( a );
122  }
123  //**********************************************************************************************
124 };
125 //*************************************************************************************************
126 
127 
128 
129 
130 //=================================================================================================
131 //
132 // YIELDSUNIFORM SPECIALIZATIONS
133 //
134 //=================================================================================================
135 
136 //*************************************************************************************************
138 template< typename T >
139 struct YieldsUniform<Tan,T>
140  : public IsUniform<T>
141 {};
143 //*************************************************************************************************
144 
145 
146 
147 
148 //=================================================================================================
149 //
150 // YIELDSSYMMETRIC SPECIALIZATIONS
151 //
152 //=================================================================================================
153 
154 //*************************************************************************************************
156 template< typename MT >
157 struct YieldsSymmetric<Tan,MT>
158  : public IsSymmetric<MT>
159 {};
161 //*************************************************************************************************
162 
163 
164 
165 
166 //=================================================================================================
167 //
168 // YIELDSHERMITIAN SPECIALIZATIONS
169 //
170 //=================================================================================================
171 
172 //*************************************************************************************************
174 template< typename MT >
175 struct YieldsHermitian<Tan,MT>
176  : public IsHermitian<MT>
177 {};
179 //*************************************************************************************************
180 
181 
182 
183 
184 //=================================================================================================
185 //
186 // YIELDSLOWER SPECIALIZATIONS
187 //
188 //=================================================================================================
189 
190 //*************************************************************************************************
192 template< typename MT >
193 struct YieldsLower<Tan,MT>
194  : public IsLower<MT>
195 {};
197 //*************************************************************************************************
198 
199 
200 
201 
202 //=================================================================================================
203 //
204 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
205 //
206 //=================================================================================================
207 
208 //*************************************************************************************************
210 template< typename MT >
211 struct YieldsStrictlyLower<Tan,MT>
212  : public IsStrictlyLower<MT>
213 {};
215 //*************************************************************************************************
216 
217 
218 
219 
220 //=================================================================================================
221 //
222 // YIELDSUPPER SPECIALIZATIONS
223 //
224 //=================================================================================================
225 
226 //*************************************************************************************************
228 template< typename MT >
229 struct YieldsUpper<Tan,MT>
230  : public IsUpper<MT>
231 {};
233 //*************************************************************************************************
234 
235 
236 
237 
238 //=================================================================================================
239 //
240 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
241 //
242 //=================================================================================================
243 
244 //*************************************************************************************************
246 template< typename MT >
247 struct YieldsStrictlyUpper<Tan,MT>
248  : public IsStrictlyUpper<MT>
249 {};
251 //*************************************************************************************************
252 
253 
254 
255 
256 //=================================================================================================
257 //
258 // YIELDSZERO SPECIALIZATIONS
259 //
260 //=================================================================================================
261 
262 //*************************************************************************************************
264 template< typename T >
265 struct YieldsZero<Tan,T>
266  : public IsZero<T>
267 {};
269 //*************************************************************************************************
270 
271 } // namespace blaze
272 
273 #endif
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero type trait.
Header file for the tan shim.
#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
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Tan.h:100
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.
decltype(auto) BLAZE_ALWAYS_INLINE load(const T &a) const
Returns the result of the tan() function for the given SIMD vector.
Definition: Tan.h:118
Header file for the IsLower type trait.
Header file for the SIMD tangent functionality.
Header file for the HasSIMDTan type trait.
Constraint on the data type.
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.
Generic wrapper for the tan() function.
Definition: Tan.h:79
Header file for the IsZero type trait.
Header file for the YieldsLower type trait.
Macro for CUDA compatibility.
decltype(auto) tan(const DenseMatrix< MT, SO > &dm)
Computes the tangent for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:2042
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Tan.h:108
#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.
Header file for the YieldsHermitian type trait.
Header file for the IsHermitian type trait.
System settings for the inline keywords.