1
/* Here are the prototypes of the complex routines that are in the book
2
'Numerical recipes in C' by Press et al, 2nd edition, 1992. All references to
3
'float' in that book have been changed to 'double' here. Hence the definitions
4
are not always the same.
7
fcomplex complex(float re, float im);
11
fcomplex complex(double re, double im);
13
Hence all the C routines used here *must* be converted to double. Please *dont*
14
use the numerical recipes header file 'complex.h', use my 'complex_hack.h'
18
typedef struct FCOMPLEX {double r, i;} fcomplex;
20
in the file complex_hack.c must be deleted, since its defined in this file.
21
Otherwise its defined twice, which will give a compiler error. */
23
typedef struct FCOMPLEX {double r, i;} fcomplex;
25
fcomplex Cadd(fcomplex a, fcomplex b); /* a+b */
26
fcomplex Csub(fcomplex a, fcomplex b); /* a-b */
27
fcomplex Cmul(fcomplex a, fcomplex b); /* a*b */
28
fcomplex Complex(double re, double im); /* Set an fcomplex number */
29
fcomplex Cdiv(fcomplex a, fcomplex b); /* a/b */
30
double Cabs(fcomplex z); /* absolute value of z */
32
fcomplex RCmul(double x, fcomplex a); /* real (x) times compelx (a) */