21 #ifndef QUEST_COMPLEX_H
22 #define QUEST_COMPLEX_H
40 typedef complex<float> float_complex;
41 typedef complex<double> double_complex;
42 typedef complex<long double> long_double_complex;
45 #define creal(x) real(x)
46 #define cimag(x) imag(x)
47 #define carg(x) arg(x)
48 #define cabs(x) abs(x)
55 typedef float complex float_complex;
56 typedef double complex double_complex;
57 typedef long double complex long_double_complex;
59 #define float_complex(r,i) ((float)(r) + ((float)(i))*I)
60 #define double_complex(r,i) ((double)(r) + ((double)(i))*I)
61 #define long_double_complex(r,i) ((long double)(r) + ((long double)(i))*I)
63 #endif // #ifdef __cplusplus
77 #define qcomp float_complex
79 #define qcomp double_complex
81 #define qcomp long_double_complex
89 #define toComplex(scalar) ((Complex) {.real = creal(scalar), .imag = cimag(scalar)})
90 #define fromComplex(comp) qcomp(comp.real, comp.imag)
144 #endif // #ifndef QUEST_COMPLEX_H