New patches: [unrevert anonymous**20050129003240] < > { hunk ./FFTW3.hsc 52 use_flags :: CInt use_flags = fftw_estimate .|. fftw_destroy_input +-- Management functions foreign import ccall safe fftw_execute :: Plan -> IO () foreign import ccall unsafe fftw_destroy_plan :: Plan -> IO () foreign import ccall unsafe fftw_cleanup :: IO () hunk ./FFTW3.hsc 57 --- Basic interface, complex double -> complex double +-- memory management. It's generally easier to use Haskell's, but +-- FFTW allocates plans that we must free +foreign import ccall unsafe fftw_malloc :: CInt -> IO () +foreign import ccall unsafe fftw_free :: Plan -> IO () + +-| Basic interface +-- complex double -> complex double foreign import ccall unsafe fftw_plan_dft_1d :: CInt -> Ptr FFTWComplex -> Ptr FFTWComplex -> Sign -> Flags -> IO Plan; hunk ./FFTW3.hsc 66 +-- double -> complex double +foreign import ccall unsafe fftw_plan_dft_r2c_1d :: CInt -> Ptr CDouble -> Ptr FFTWComplex -> Flags -> IO Plan; + +-- complex double hermitian -> double +foreign import ccall unsafe fftw_plan_dft_r2c_1d :: CInt -> Ptr FFTWComplex -> Ptr CDouble -> Flags -> IO Plan; fft :: RealFloat a => [Complex a] -> [Complex a] fft = map c2c . unsafePerformIO . fft_dir (-1) . map c2c hunk ./FFTW3.hsc 89 plan <- withArray x (fft_wrap (fromIntegral l) dir out) fftw_execute plan fftw_destroy_plan plan + fftw_free ret <- peekArray l out free out return ret } Context: [Licensing information. Aaron Denney **20050122234434] [FFTW 3 basic interface Aaron Denney **20050122234352] [Licensing Information Aaron Denney **20050122234318] [initial CComplex check-in. Aaron Denney **20050121234010] Patch bundle hash: 1a4c34f198262528168910a5d9721b64dbb022c9