ReactOS 0.4.16-dev-1059-gb1cf981
complex.h
Go to the documentation of this file.
1//
2// complex.h
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// The complex math library.
7//
8#pragma once
9#ifndef _COMPLEX
10#define _COMPLEX
11
12#include <corecrt.h>
13
14#if (_CRT_HAS_CXX17 == 1) && !defined(_CRT_USE_C_COMPLEX_H)
15#include <ccomplex>
16#else // ^^^^ /std:c++17 ^^^^ // vvvv _CRT_USE_C_COMPLEX_H vvvv
17
18#pragma warning(push)
19#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
21
23
24//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
25//
26// Types
27//
28//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
29#ifndef _C_COMPLEX_T
30 #define _C_COMPLEX_T
31 typedef struct _C_double_complex
32 {
33 double _Val[2];
35
36 typedef struct _C_float_complex
37 {
38 float _Val[2];
40
41 typedef struct _C_ldouble_complex
42 {
43 long double _Val[2];
45#endif
46
50
51
52
53//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
54//
55// Macros
56//
57//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
58#define _DCOMPLEX_(re, im) _Cbuild(re, im)
59#define _FCOMPLEX_(re, im) _FCbuild(re, im)
60#define _LCOMPLEX_(re, im) _LCbuild(re, im)
61
62#define _Complex_I _FCbuild(0.0F, 1.0F)
63#define I _Complex_I
64
65
66
67//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
68//
69// Functions
70//
71//-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
96
121
146
147_ACRTIMP _Dcomplex __cdecl _Cbuild(_In_ double _Re, _In_ double _Im);
150
154
155_ACRTIMP _Lcomplex __cdecl _LCbuild(_In_ long double _Re, _In_ long double _Im);
158
159
160
161#ifdef __cplusplus
162extern "C++"
163{
164 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
165 //
166 // double complex overloads
167 //
168 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
169 inline _Dcomplex __CRTDECL acos(_In_ _Dcomplex _X) throw()
170 {
171 return cacos(_X);
172 }
173
174 inline _Dcomplex __CRTDECL acosh(_In_ _Dcomplex _X) throw()
175 {
176 return cacosh(_X);
177 }
178
179 inline _Dcomplex __CRTDECL asin(_In_ _Dcomplex _X) throw()
180 {
181 return casin(_X);
182 }
183
184 inline _Dcomplex __CRTDECL asinh(_In_ _Dcomplex _X) throw()
185 {
186 return casinh(_X);
187 }
188
189 inline _Dcomplex __CRTDECL atan(_In_ _Dcomplex _X) throw()
190 {
191 return catan(_X);
192 }
193
194 inline _Dcomplex __CRTDECL atanh(_In_ _Dcomplex _X) throw()
195 {
196 return catanh(_X);
197 }
198
199 inline _Dcomplex __CRTDECL cos(_In_ _Dcomplex _X) throw()
200 {
201 return ccos(_X);
202 }
203
204 inline _Dcomplex __CRTDECL cosh(_In_ _Dcomplex _X) throw()
205 {
206 return ccosh(_X);
207 }
208
209 inline _Dcomplex __CRTDECL proj(_In_ _Dcomplex _X) throw()
210 {
211 return cproj(_X);
212 }
213
214 inline _Dcomplex __CRTDECL exp(_In_ _Dcomplex _X) throw()
215 {
216 return cexp(_X);
217 }
218
219 inline _Dcomplex __CRTDECL log(_In_ _Dcomplex _X) throw()
220 {
221 return clog(_X);
222 }
223
224 inline _Dcomplex __CRTDECL log10(_In_ _Dcomplex _X) throw()
225 {
226 return clog10(_X);
227 }
228
230 {
231 return cpow(_X, _Y);
232 }
233
234 inline _Dcomplex __CRTDECL sin(_In_ _Dcomplex _X) throw()
235 {
236 return csin(_X);
237 }
238
239 inline _Dcomplex __CRTDECL sinh(_In_ _Dcomplex _X) throw()
240 {
241 return csinh(_X);
242 }
243
244 inline _Dcomplex __CRTDECL sqrt(_In_ _Dcomplex _X) throw()
245 {
246 return csqrt(_X);
247 }
248
249 inline _Dcomplex __CRTDECL tan(_In_ _Dcomplex _X) throw()
250 {
251 return ctan(_X);
252 }
253
254 inline _Dcomplex __CRTDECL tanh(_In_ _Dcomplex _X) throw()
255 {
256 return ctanh(_X);
257 }
258
259 inline double __CRTDECL abs(_In_ _Dcomplex _X) throw()
260 {
261 return cabs(_X);
262 }
263
264 inline double __CRTDECL arg(_In_ _Dcomplex _X) throw()
265 {
266 return carg(_X);
267 }
268
269 inline double __CRTDECL imag(_In_ _Dcomplex _X) throw()
270 {
271 return cimag(_X);
272 }
273
274 inline double __CRTDECL real(_In_ _Dcomplex _X) throw()
275 {
276 return creal(_X);
277 }
278
279
280
281 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
282 //
283 // float complex overloads
284 //
285 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
286 inline _Fcomplex __CRTDECL acos(_In_ _Fcomplex _X) throw()
287 {
288 return cacosf(_X);
289 }
290
291 inline _Fcomplex __CRTDECL acosh(_In_ _Fcomplex _X) throw()
292 {
293 return cacoshf(_X);
294 }
295
296 inline _Fcomplex __CRTDECL asin(_In_ _Fcomplex _X) throw()
297 {
298 return casinf(_X);
299 }
300
301 inline _Fcomplex __CRTDECL asinh(_In_ _Fcomplex _X) throw()
302 {
303 return casinhf(_X);
304 }
305
306 inline _Fcomplex __CRTDECL atan(_In_ _Fcomplex _X) throw()
307 {
308 return catanf(_X);
309 }
310
311 inline _Fcomplex __CRTDECL atanh(_In_ _Fcomplex _X) throw()
312 {
313 return catanhf(_X);
314 }
315
316 inline _Fcomplex __CRTDECL conj(_In_ _Fcomplex _X) throw()
317 {
318 return conjf(_X);
319 }
320
321 inline _Fcomplex __CRTDECL cos(_In_ _Fcomplex _X) throw()
322 {
323 return ccosf(_X);
324 }
325
326 inline _Fcomplex __CRTDECL cosh(_In_ _Fcomplex _X) throw()
327 {
328 return ccoshf(_X);
329 }
330
331 inline _Fcomplex __CRTDECL cproj(_In_ _Fcomplex _X) throw()
332 {
333 return cprojf(_X);
334 }
335
336 inline _Fcomplex __CRTDECL proj(_In_ _Fcomplex _X) throw()
337 {
338 return cprojf(_X);
339 }
340
341 inline _Fcomplex __CRTDECL exp(_In_ _Fcomplex _X) throw()
342 {
343 return cexpf(_X);
344 }
345
346 inline _Fcomplex __CRTDECL log(_In_ _Fcomplex _X) throw()
347 {
348 return clogf(_X);
349 }
350
351 inline _Fcomplex __CRTDECL log10(_In_ _Fcomplex _X) throw()
352 {
353 return clog10f(_X);
354 }
355
356 inline float __CRTDECL norm(_In_ _Fcomplex _X) throw()
357 {
358 return normf(_X);
359 }
360
362 {
363 return cpowf(_X, _Y);
364 }
365
366 inline _Fcomplex __CRTDECL sin(_In_ _Fcomplex _X) throw()
367 {
368 return csinf(_X);
369 }
370
371 inline _Fcomplex __CRTDECL sinh(_In_ _Fcomplex _X) throw()
372 {
373 return csinhf(_X);
374 }
375
376 inline _Fcomplex __CRTDECL sqrt(_In_ _Fcomplex _X) throw()
377 {
378 return csqrtf(_X);
379 }
380
381 inline _Fcomplex __CRTDECL tan(_In_ _Fcomplex _X) throw()
382 {
383 return ctanf(_X);
384 }
385
386 inline _Fcomplex __CRTDECL tanh(_In_ _Fcomplex _X) throw()
387 {
388 return ctanhf(_X);
389 }
390
391 inline float __CRTDECL abs(_In_ _Fcomplex _X) throw()
392 {
393 return cabsf(_X);
394 }
395
396 inline float __CRTDECL arg(_In_ _Fcomplex _X) throw()
397 {
398 return cargf(_X);
399 }
400
401 inline float __CRTDECL carg(_In_ _Fcomplex _X) throw()
402 {
403 return cargf(_X);
404 }
405
406 inline float __CRTDECL cimag(_In_ _Fcomplex _X) throw()
407 {
408 return cimagf(_X);
409 }
410
411 inline float __CRTDECL creal(_In_ _Fcomplex _X) throw()
412 {
413 return crealf(_X);
414 }
415
416 inline float __CRTDECL imag(_In_ _Fcomplex _X) throw()
417 {
418 return cimagf(_X);
419 }
420
421 inline float __CRTDECL real(_In_ _Fcomplex _X) throw()
422 {
423 return crealf(_X);
424 }
425
426
427
428 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
429 //
430 // long double complex overloads
431 //
432 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
433 inline _Lcomplex __CRTDECL acos(_In_ _Lcomplex _X) throw()
434 {
435 return cacosl(_X);
436 }
437
438 inline _Lcomplex __CRTDECL acosh(_In_ _Lcomplex _X) throw()
439 {
440 return cacoshl(_X);
441 }
442
443 inline _Lcomplex __CRTDECL asin(_In_ _Lcomplex _X) throw()
444 {
445 return casinl(_X);
446 }
447
448 inline _Lcomplex __CRTDECL asinh(_In_ _Lcomplex _X) throw()
449 {
450 return casinhl(_X);
451 }
452
453 inline _Lcomplex __CRTDECL atan(_In_ _Lcomplex _X) throw()
454 {
455 return catanl(_X);
456 }
457
458 inline _Lcomplex __CRTDECL atanh(_In_ _Lcomplex _X) throw()
459 {
460 return catanhl(_X);
461 }
462
463 inline _Lcomplex __CRTDECL conj(_In_ _Lcomplex _X) throw()
464 {
465 return conjl(_X);
466 }
467
468 inline _Lcomplex __CRTDECL cos(_In_ _Lcomplex _X) throw()
469 {
470 return ccosl(_X);
471 }
472
473 inline _Lcomplex __CRTDECL cosh(_In_ _Lcomplex _X) throw()
474 {
475 return ccoshl(_X);
476 }
477
478 inline _Lcomplex __CRTDECL cproj(_In_ _Lcomplex _X) throw()
479 {
480 return cprojl(_X);
481 }
482
483 inline _Lcomplex __CRTDECL proj(_In_ _Lcomplex _X) throw()
484 {
485 return cprojl(_X);
486 }
487
488 inline _Lcomplex __CRTDECL exp(_In_ _Lcomplex _X) throw()
489 {
490 return cexpl(_X);
491 }
492
493 inline _Lcomplex __CRTDECL log(_In_ _Lcomplex _X) throw()
494 {
495 return clogl(_X);
496 }
497
498 inline _Lcomplex __CRTDECL log10(_In_ _Lcomplex _X) throw()
499 {
500 return clog10l(_X);
501 }
502
503 inline long double __CRTDECL norm(_In_ _Lcomplex _X) throw()
504 {
505 return norml(_X);
506 }
507
509 {
510 return cpowl(_X, _Y);
511 }
512
513 inline _Lcomplex __CRTDECL sin(_In_ _Lcomplex _X) throw()
514 {
515 return csinl(_X);
516 }
517
518 inline _Lcomplex __CRTDECL sinh(_In_ _Lcomplex _X) throw()
519 {
520 return csinhl(_X);
521 }
522
523 inline _Lcomplex __CRTDECL sqrt(_In_ _Lcomplex _X) throw()
524 {
525 return csqrtl(_X);
526 }
527
528 inline _Lcomplex __CRTDECL tan(_In_ _Lcomplex _X) throw()
529 {
530 return ctanl(_X);
531 }
532
533 inline _Lcomplex __CRTDECL tanh(_In_ _Lcomplex _X) throw()
534 {
535 return ctanhl(_X);
536 }
537
538 inline long double __CRTDECL abs(_In_ _Lcomplex _X) throw()
539 {
540 return cabsl(_X);
541 }
542
543 inline long double __CRTDECL arg(_In_ _Lcomplex _X) throw()
544 {
545 return cargl(_X);
546 }
547
548 inline long double __CRTDECL carg(_In_ _Lcomplex _X) throw()
549 {
550 return cargl(_X);
551 }
552
553 inline long double __CRTDECL cimag(_In_ _Lcomplex _X) throw()
554 {
555 return cimagl(_X);
556 }
557
558 inline long double __CRTDECL creal(_In_ _Lcomplex _X) throw()
559 {
560 return creall(_X);
561 }
562
563 inline long double __CRTDECL imag(_In_ _Lcomplex _X) throw()
564 {
565 return cimagl(_X);
566 }
567
568 inline long double __CRTDECL real(_In_ _Lcomplex _X) throw()
569 {
570 return creall(_X);
571 }
572
573} // extern "C++"
574#endif // __cplusplus
575
578#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
579#endif // (_CRT_HAS_CXX17 == 1) && !defined(_CRT_USE_C_COMPLEX_H)
580#endif // _COMPLEX
#define _X(x)
Definition: CPath.cpp:42
_STLP_DECLSPEC complex< float > _STLP_CALL sinh(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL tan(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL cosh(const complex< float > &)
_Tp _STLP_CALL imag(const complex< _Tp > &__z)
Definition: _complex.h:731
_STLP_DECLSPEC complex< float > _STLP_CALL sin(const complex< float > &)
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
_STLP_DECLSPEC complex< float > _STLP_CALL tanh(const complex< float > &)
valarray< _Tp > acos(const valarray< _Tp > &__x)
Definition: _valarray.h:901
valarray< _Tp > atan(const valarray< _Tp > &__x)
Definition: _valarray.h:919
valarray< _Tp > asin(const valarray< _Tp > &__x)
Definition: _valarray.h:910
#define __cdecl
Definition: accygwin.h:79
float _Complex conjf(float _Complex)
long double _Complex casinhl(long double _Complex)
double _Complex ccos(double _Complex)
float _Complex ccoshf(float _Complex)
float crealf(float _Complex)
double _Complex cacos(double _Complex)
double cimag(double _Complex)
float _Complex ctanhf(float _Complex)
float _Complex clogf(float _Complex)
double _Complex cpow(double _Complex, double _Complex)
double creal(double _Complex)
float _Complex csinf(float _Complex)
float _Complex ctanf(float _Complex)
long double _Complex clogl(long double _Complex)
long double _Complex catanl(long double _Complex)
double _Complex catan(double _Complex)
double _Complex cproj(double _Complex)
long double _Complex csqrtl(long double _Complex)
long double cargl(long double _Complex)
double _Complex cacosh(double _Complex)
float _Complex catanf(float _Complex)
long double _Complex cprojl(long double _Complex)
double carg(double _Complex)
float _Complex catanhf(float _Complex)
long double _Complex casinl(long double _Complex)
double _Complex conj(double _Complex)
float _Complex cexpf(float _Complex)
long double _Complex ctanhl(long double _Complex)
double _Complex casinh(double _Complex)
float cabsf(float _Complex)
long double _Complex cacoshl(long double _Complex)
double _Complex catanh(double _Complex)
double _Complex csqrt(double _Complex)
long double creall(long double _Complex)
long double _Complex ctanl(long double _Complex)
long double _Complex csinl(long double _Complex)
float _Complex cacosf(float _Complex)
float _Complex cprojf(float _Complex)
float _Complex casinf(float _Complex)
float _Complex cpowf(float _Complex, float _Complex)
long double _Complex cacosl(long double _Complex)
float cargf(float _Complex)
long double cabsl(long double _Complex)
double _Complex ctanh(double _Complex)
long double _Complex csinhl(long double _Complex)
double _Complex ctan(double _Complex)
long double _Complex ccosl(long double _Complex)
long double _Complex ccoshl(long double _Complex)
double _Complex ccosh(double _Complex)
float _Complex ccosf(float _Complex)
float cimagf(float _Complex)
double _Complex cexp(double _Complex)
long double _Complex cpowl(long double _Complex, long double _Complex)
long double cimagl(long double _Complex)
float _Complex csqrtf(float _Complex)
double _Complex csinh(double _Complex)
float _Complex cacoshf(float _Complex)
long double _Complex cexpl(long double _Complex)
long double _Complex catanhl(long double _Complex)
double _Complex casin(double _Complex)
long double _Complex conjl(long double _Complex)
double _Complex csin(double _Complex)
float _Complex casinhf(float _Complex)
float _Complex csinhf(float _Complex)
#define abs(i)
Definition: fconv.c:206
double log10(double x)
Definition: freeldr.c:190
double pow(double x, double y)
Definition: freeldr.c:178
double asinh(double x)
Definition: fun_ieee.c:49
double atanh(double x)
Definition: fun_ieee.c:63
double acosh(double x)
Definition: fun_ieee.c:54
#define cabs
Definition: math.h:330
#define clog
Definition: iostream.cpp:40
DWORD exp
Definition: msg.c:16058
#define real
#define _In_
Definition: no_sal2.h:158
#define log(outFile, fmt,...)
Definition: util.h:15
double _Val[2]
Definition: complex.h:33
float _Val[2]
Definition: complex.h:38
long double _Val[2]
Definition: complex.h:43
_ACRTIMP _Fcomplex __cdecl _FCmulcc(_In_ _Fcomplex _X, _In_ _Fcomplex _Y)
_ACRTIMP double __cdecl norm(_In_ _Dcomplex _Z)
_ACRTIMP _Dcomplex __cdecl _Cmulcc(_In_ _Dcomplex _X, _In_ _Dcomplex _Y)
_C_float_complex _Fcomplex
Definition: complex.h:48
_ACRTIMP _Fcomplex __cdecl clog10f(_In_ _Fcomplex _Z)
_ACRTIMP long double __cdecl norml(_In_ _Lcomplex _Z)
_ACRTIMP _Lcomplex __cdecl _LCmulcc(_In_ _Lcomplex _X, _In_ _Lcomplex _Y)
_ACRTIMP _Fcomplex __cdecl _FCmulcr(_In_ _Fcomplex _X, _In_ float _Y)
_C_ldouble_complex _Lcomplex
Definition: complex.h:49
_ACRTIMP _Lcomplex __cdecl _LCbuild(_In_ long double _Re, _In_ long double _Im)
_ACRTIMP _Dcomplex __cdecl clog10(_In_ _Dcomplex _Z)
_C_double_complex _Dcomplex
Definition: complex.h:47
_ACRTIMP float __cdecl normf(_In_ _Fcomplex _Z)
_ACRTIMP _Fcomplex __cdecl _FCbuild(_In_ float _Re, _In_ float _Im)
_ACRTIMP _Lcomplex __cdecl _LCmulcr(_In_ _Lcomplex _X, _In_ long double _Y)
_ACRTIMP _Lcomplex __cdecl clog10l(_In_ _Lcomplex _Z)
_ACRTIMP _Dcomplex __cdecl _Cmulcr(_In_ _Dcomplex _X, _In_ double _Y)
_ACRTIMP _Dcomplex __cdecl _Cbuild(_In_ double _Re, _In_ double _Im)
#define _ACRTIMP
Definition: corecrt.h:138
#define _UCRT_DISABLE_CLANG_WARNINGS
Definition: corecrt.h:109
#define _UCRT_RESTORE_CLANG_WARNINGS
Definition: corecrt.h:117
#define _CRT_END_C_HEADER
Definition: vcruntime.h:42
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:40
void * arg
Definition: msvc.h:10
#define __CRTDECL
Definition: yvals.h:17