Go to the documentation of this file. 5 #define CMPLX "complex.h $Revision: 1.5 $ on $Date: 88/11/22 02:51:07 $ " 18 #define DC_ABS(a,b) (FABS(a) + FABS(b)) 21 #define DC_DIV(a,b,c,d,x,y) { \ 23 if(FABS(c)>FABS(d)) { \ 37 #ifndef HAVE_SHORTMACRO 38 #define DC_DIVEQ(a,b,c,d) { \ 40 if(FABS(c)>FABS(d)) { \ 43 x=((*(a))+(*(b))*r)/s; \ 44 y=((*(b))-(*(a))*r)/s; \ 48 x=((*(a))*r+(*(b)))/s; \ 49 y=((*(b))*r-(*(a)))/s; \ 55 #define DC_DIVEQ DCdiveq 57 extern void DCdiveq(
double*,
double*,
double,
double);
59 extern void DCdiveq();
63 #ifndef HAVE_SHORTMACRO 64 #define DC_MULT(a,b,c,d,x,y) { \ 65 *(x) = (a) * (c) - (b) * (d) ; \ 66 *(y) = (a) * (d) + (b) * (c) ; \ 69 #define DC_MULT DCmult 71 extern void DCmult(
double,
double,
double,
double,
double*,
double*);
78 #define DC_MINUS(a,b,c,d,x,y) { \ 84 #ifndef HAVE_SHORTMACRO 85 #define DC_MINUSEQ(a,b,c,d) { \ 90 #define DC_MINUSEQ DCminusEq 92 extern void DCminusEq(
double*,
double*,
double,
double);
94 extern void DCminusEq();
100 if ((A).imag == 0.0) { \ 101 if ((A).real < 0.0) { \ 102 (A).imag = sqrt(-(A).real); \ 105 (A).real = sqrt((A).real); \ 109 _mag = sqrt((A).real * (A).real + (A).imag * (A).imag); \ 110 _a = (_mag - (A).real) / 2.0; \ 112 (A).real = sqrt(_mag); \ 113 (A).imag /= (2.0 * (A).real); \ 116 (A).real = (A).imag / (2.0 * _a); \ 122 #define C_MAG2(A) (((A).real = (A).real * (A).real + (A).imag * (A).imag), \ 125 #define C_CONJ(A) ((A).imag *= -1.0) 127 #define C_CONJEQ(A,B) { \ 128 (A).real = (B.real); \ 129 (A).imag = - (B.imag); \ 132 #define C_EQ(A,B) { \ 133 (A).real = (B.real); \ 134 (A).imag = (B.imag); \ 137 #define C_NORM(A,B) { \ 138 if ((A).real == 0.0 && (A).imag == 0.0) { \ 141 while (FABS((A).real) > 1.0 || FABS((A).imag) > 1.0) { \ 146 while (FABS((A).real) <= 0.5 && FABS((A).imag) <= 0.5) { \ 154 #define C_ABS(A) (sqrt((A).real * (A.real) + (A.imag * A.imag))) 156 #define C_MUL(A,B) { \ 160 (A).real = TMP1 * TMP2 - (A.imag) * (B.imag); \ 161 (A).imag = TMP1 * (B.imag) + (A.imag) * TMP2; \ 164 #define C_MULEQ(A,B,C) { \ 165 (A).real = (B.real) * (C.real) - (B.imag) * (C.imag); \ 166 (A).imag = (B.real) * (C.imag) + (B.imag) * (C.real); \ 169 #define C_DIV(A,B) { \ 172 (A).real = _tmp * (B.real) + (A).imag * (B.imag); \ 173 (A).imag = - _tmp * (B.imag) + (A.imag) * (B.real); \ 174 _mag = (B.real) * (B.real) + (B.imag) * (B.imag); \ 179 #define C_DIVEQ(A,B,C) { \ 181 (A).real = (B.real) * (C.real) + (B.imag) * (C.imag); \ 182 (A).imag = (B.imag) * (C.real) - (B.real) * (C.imag); \ 183 _mag = (C.real) * (C.real) + (C.imag) * (C.imag); \ 188 #define C_ADD(A,B) { \ 189 (A).real += (B.real); \ 190 (A).imag += (B.imag); \ 193 #define C_ADDEQ(A,B,C) { \ 194 (A).real = (B.real) + (C.real); \ 195 (A).imag = (B.imag) + (C.imag); \ 198 #define C_SUB(A,B) { \ 199 (A).real -= (B.real); \ 200 (A).imag -= (B.imag); \ 203 #define C_SUBEQ(A,B,C) { \ 204 (A).real = (B.real) - (C.real); \ 205 (A).imag = (B.imag) - (C.imag); \