#include #include #include #ifndef SINGLE #include #else #include #endif /* FFTW_MEASURE: find the optimal plan by actually computing several FFTs FFTW_ESTIMATE: do not run any FFT and provide a "reasonable" plan FFTW_OUT_OF_PLACE: a plan assumes that the in and out are distinct FFTW_IN_PLACE: a plan assumes that the in and out are same */ int main(int argc, char *argv[]) { int N=0,nthreads=1,i,j; fftw_complex *in,*out; fftw_plan fwd_plan, bck_plan; double err=0.0; if(argc>2) { nthreads = atoi(argv[1]); N = atoi(argv[2]); } else { printf("usage: %s nthreads N\n\t nthreads = number of threads\n\t N = length of vector\n",argv[0]); exit; } if(nthreads<1) { } if(N<1) { printf("\tN = %d ... exiting\n",N); exit(1); } in = (fftw_complex *)malloc(N*sizeof(fftw_complex)); out = (fftw_complex *)malloc(N*sizeof(fftw_complex)); for (i=0; i 0.0) printf("ERROR:: index=%d err=%.3e \n", i,err); } fftw_destroy_plan(fwd_plan); fftw_destroy_plan(bck_plan); return 0; }