help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] gsl_complex to fftw_complex type


From: Eric Germaneau
Subject: Re: [Help-gsl] gsl_complex to fftw_complex type
Date: Wed, 15 Aug 2007 15:25:38 +0200
User-agent: Thunderbird 2.0.0.4 (X11/20070604)

yes I did it as the following:

/*fftw_complex *Cfftw;
gsl_complex *Cgsl;

....

Cfftw = (fftw_complex*) fftw_malloc(.....);
Xgsl = (gsl_complex*) malloc(....);

for (j=0;j<n;j++)
{
 Cfftw[j][0] = GSL_REAL(Cgsl[j])
 Cfftw[j][1] = GSL_IMAG(Cgsl[j])
}
*/
 Eric.

Oliver Jennrich wrote:
On 8/15/07, Eric Germaneau <address@hidden> wrote:
Hello,

I wondering whether its possible to convert gsl_complex to fftw_complex
type.

Well, gsl_complex is defined as

typedef struct
  {
    double dat[2];
  }
gsl_complex;

whereas fftw_complex is either directly defined as _complex double or
as double[2].

In any event, fftw_complex should be bit compatible with gsl_complex,
so a simple typecasting should do it.



--
/ "Love, Gift from Life, is given naturally."
/
Eric Germaneau <http://lcr.epfl.ch/page37437.html>
Ecole polytechnique fédérale de Lausanne (EPFL)
FSB - IPMC
Laboratoire de Cristallographie(LCr) <http://lcr.epfl.ch>
BSP 518
CH-1015 Lausanne
Switzerland
address@hidden <mailto:address@hidden>
/Tel./: +41 (0)21 / 693 06 36
/Fax./: +41 (0)21 / 693 05 04
/msn/: address@hidden
/skype/: aihaike

/Please consider the environment before printing this email - Considérez svp l'environnement avant d'imprimer cet email/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]