This is the mail archive of the
gsl-discuss@sourceware.cygnus.com
mailing list for the GSL project.
complex number API
- To: Brian Gough <bjg@netsci.freeserve.co.uk>
- Subject: complex number API
- From: Mark Galassi <rosalia@cygnus.com>
- Date: Mon, 8 Feb 1999 07:20:30 -0700 (MST)
- Cc: Mark Galassi <rosalia@cygnus.com>, GSL discussion list <gsl-discuss@sourceware.cygnus.com>
In writing up NEWS entries I noticed that the complex number API has
some problems.
First of all, there should be separate macros for setting and
retrieving the real and imaginary parts. Otherwise you end up using
GSL_REAL(z) as a left-hand-side, which is bad form and can hurt down
the line.
I would add GSL_SET_REAL(z, x) and GSL_SET_IMAG(z, y).
Second, GSL_COMPLEX_SET modifies its z argument, which makes the
interface "magic" and is bad form, and could cause problems down the
line. I would modify it to either return z or to take a zp (pointer
to z).
Does anyone have any thoughts on the subject? And Brian, how much are
these forms of the macros used in the FFT code?