[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] GSL and FFTW
From: |
James Bergstra |
Subject: |
Re: [Help-gsl] GSL and FFTW |
Date: |
Wed, 14 Dec 2005 18:26:52 -0500 |
User-agent: |
Mutt/1.4.2.1i |
For real-valued inputs or outputs, the gsl_matrix type works.
GSL, C99 and FFTW all store complex double values as two adjacent doubles: the
first is the real, the second is the imaginary.
For double complex i/o, the gsl_matrix_complex_double data type might not be
compatible
according to gcc, but the type is compatible. Therefore a static cast of the
data-pointer is safe. In any case, you should be able to consult the various
header files and figure it out.
For the same reason, you can cast a gsl_matrix as a complex one if it has the
appropriate size. You need twice as many columns to store all the imaginary
parts, but it's all just memory :)
James
Caveat: I only used FFTW for 1D-FFT, but I ran into similar troubles.
On Wed, Dec 14, 2005 at 06:15:46PM +0100, Thomas Weber wrote:
> Hi,
>
> is there any "simple" way to use FFTW from GSL for 2D-FFT? By simple I
> mean that I don't want to copy everything to an fftw_complex array, make
> the transform and copy everything back into a gsl_matrix structure,
> using for-loops for the copying.
>
> I don't think it's possible to use the C99 complex data type for complex
> gsl_matrices, is it (which would probably solve my above problem)?
>
> Regards
> Thomas
>
>
>
>
> _______________________________________________
> Help-gsl mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-gsl
--
james bergstra
http://www-etud.iro.umontreal.ca/~bergstrj