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