c@409: #include c@409: #include c@409: #include c@409: #include c@409: #include "pstats.h" c@409: c@409: #ifdef DATATYPEdouble c@409: c@409: #define CPXTYPE fftw_complex c@409: #define PLAN fftw_plan c@409: #define FFTMALLOC fftw_malloc c@409: #define MAKEPLAN fftw_plan_dft_1d c@409: #define DOFFT fftw_execute c@409: #define DESTROYPLAN fftw_destroy_plan c@409: #define FFTFREE fftw_free c@409: c@409: #elif defined(DATATYPEfloat) c@409: c@409: #define CPXTYPE fftwf_complex c@409: #define PLAN fftwf_plan c@409: #define FFTMALLOC fftwf_malloc c@409: #define MAKEPLAN fftwf_plan_dft_1d c@409: #define DOFFT fftwf_execute c@409: #define DESTROYPLAN fftwf_destroy_plan c@409: #define FFTFREE fftwf_free c@409: c@409: #endif c@409: c@409: #ifndef CPXTYPE c@409: int main(void) c@409: { c@409: fprintf(stderr,"Datatype not available in FFTW\n" ); c@409: return 0; c@409: } c@409: #else c@409: int main(int argc,char ** argv) c@409: { c@409: int nfft=1024; c@409: int isinverse=0; c@409: int numffts=1000,i; c@409: c@409: CPXTYPE * in=NULL; c@409: CPXTYPE * out=NULL; c@409: PLAN p; c@409: c@409: pstats_init(); c@409: c@409: while (1) { c@409: int c = getopt (argc, argv, "n:ix:h"); c@409: if (c == -1) c@409: break; c@409: switch (c) { c@409: case 'n': c@409: nfft = atoi (optarg); c@409: break; c@409: case 'x': c@409: numffts = atoi (optarg); c@409: break; c@409: case 'i': c@409: isinverse = 1; c@409: break; c@409: case 'h': c@409: case '?': c@409: default: c@409: fprintf(stderr,"options:\n-n N: complex fft length\n-i: inverse\n-x N: number of ffts to compute\n" c@409: ""); c@409: } c@409: } c@409: c@409: in=FFTMALLOC(sizeof(CPXTYPE) * nfft); c@409: out=FFTMALLOC(sizeof(CPXTYPE) * nfft); c@409: for (i=0;i