4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Good ROcking Metal Altar for Chronical Sinners
33 static char *SRCID_complex_h
= "$Id$";
42 typedef t_complex cvec
[DIM
];
44 static t_complex cnul
= { 0.0, 0.0 };
46 static t_complex
rcmul(real r
,t_complex c
)
56 static t_complex
rcexp(real r
)
67 static t_complex
cadd(t_complex a
,t_complex b
)
77 static t_complex
csub(t_complex a
,t_complex b
)
87 static t_complex
cmul(t_complex a
,t_complex b
)
91 c
.re
= a
.re
*b
.re
- a
.im
*b
.im
;
92 c
.im
= a
.re
*b
.im
+ a
.im
*b
.re
;
97 static t_complex
conjugate(t_complex c
)
107 static t_complex
cdiv(t_complex teller
,t_complex noemer
)
109 t_complex res
,anoemer
;
111 anoemer
= cmul(conjugate(noemer
),noemer
);
112 res
= cmul(teller
,conjugate(noemer
));
114 return rcmul(1.0/anoemer
.re
,res
);