Sin.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_SIN_H_
36 #define _BLAZE_MATH_FUNCTORS_SIN_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/shims/Sin.h>
45 #include <blaze/math/simd/Sin.h>
63 #include <blaze/system/Inline.h>
64 
65 
66 namespace blaze {
67 
68 //=================================================================================================
69 //
70 // CLASS DEFINITION
71 //
72 //=================================================================================================
73 
74 //*************************************************************************************************
78 struct Sin
79 {
80  //**********************************************************************************************
83  explicit inline Sin()
84  {}
85  //**********************************************************************************************
86 
87  //**********************************************************************************************
93  template< typename T >
94  BLAZE_ALWAYS_INLINE decltype(auto) operator()( const T& a ) const
95  {
96  return sin( a );
97  }
98  //**********************************************************************************************
99 
100  //**********************************************************************************************
105  template< typename T >
106  static constexpr bool simdEnabled() { return HasSIMDSin_v<T>; }
107  //**********************************************************************************************
108 
109  //**********************************************************************************************
114  static constexpr bool paddingEnabled() { return true; }
115  //**********************************************************************************************
116 
117  //**********************************************************************************************
123  template< typename T >
124  BLAZE_ALWAYS_INLINE decltype(auto) load( const T& a ) const
125  {
127  return sin( a );
128  }
129  //**********************************************************************************************
130 };
131 //*************************************************************************************************
132 
133 
134 
135 
136 //=================================================================================================
137 //
138 // YIELDSUNIFORM SPECIALIZATIONS
139 //
140 //=================================================================================================
141 
142 //*************************************************************************************************
144 template< typename T >
145 struct YieldsUniform<Sin,T>
146  : public IsUniform<T>
147 {};
149 //*************************************************************************************************
150 
151 
152 
153 
154 //=================================================================================================
155 //
156 // YIELDSSYMMETRIC SPECIALIZATIONS
157 //
158 //=================================================================================================
159 
160 //*************************************************************************************************
162 template< typename MT >
163 struct YieldsSymmetric<Sin,MT>
164  : public IsSymmetric<MT>
165 {};
167 //*************************************************************************************************
168 
169 
170 
171 
172 //=================================================================================================
173 //
174 // YIELDSHERMITIAN SPECIALIZATIONS
175 //
176 //=================================================================================================
177 
178 //*************************************************************************************************
180 template< typename MT >
181 struct YieldsHermitian<Sin,MT>
182  : public IsHermitian<MT>
183 {};
185 //*************************************************************************************************
186 
187 
188 
189 
190 //=================================================================================================
191 //
192 // YIELDSLOWER SPECIALIZATIONS
193 //
194 //=================================================================================================
195 
196 //*************************************************************************************************
198 template< typename MT >
199 struct YieldsLower<Sin,MT>
200  : public IsLower<MT>
201 {};
203 //*************************************************************************************************
204 
205 
206 
207 
208 //=================================================================================================
209 //
210 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
211 //
212 //=================================================================================================
213 
214 //*************************************************************************************************
216 template< typename MT >
217 struct YieldsStrictlyLower<Sin,MT>
218  : public IsStrictlyLower<MT>
219 {};
221 //*************************************************************************************************
222 
223 
224 
225 
226 //=================================================================================================
227 //
228 // YIELDSUPPER SPECIALIZATIONS
229 //
230 //=================================================================================================
231 
232 //*************************************************************************************************
234 template< typename MT >
235 struct YieldsUpper<Sin,MT>
236  : public IsUpper<MT>
237 {};
239 //*************************************************************************************************
240 
241 
242 
243 
244 //=================================================================================================
245 //
246 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
247 //
248 //=================================================================================================
249 
250 //*************************************************************************************************
252 template< typename MT >
253 struct YieldsStrictlyUpper<Sin,MT>
254  : public IsStrictlyUpper<MT>
255 {};
257 //*************************************************************************************************
258 
259 
260 
261 
262 //=================================================================================================
263 //
264 // YIELDSZERO SPECIALIZATIONS
265 //
266 //=================================================================================================
267 
268 //*************************************************************************************************
270 template< typename T >
271 struct YieldsZero<Sin,T>
272  : public IsZero<T>
273 {};
275 //*************************************************************************************************
276 
277 } // namespace blaze
278 
279 #endif
Generic wrapper for the sin() function.
Definition: Sin.h:78
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero type trait.
Header file for the HasSIMDSin type trait.
Sin()
Default constructor of the Sin functor.
Definition: Sin.h:83
#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 paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Sin.h:114
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 sin() function for the given SIMD vector.
Definition: Sin.h:124
Header file for the IsLower type trait.
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Sin.h:106
Header file for the sin shim.
Constraint on the data type.
Header file for the SIMD sine functionality.
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.
decltype(auto) sin(const DenseMatrix< MT, SO > &dm)
Computes the sine for each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1826
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.