00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "config.h"
00021
00022 #include <stdio.h>
00023 #include <math.h>
00024 #include <string.h>
00025 #include <stdlib.h>
00026 #ifdef HAVE_COMPLEX_H
00027 #include <complex.h>
00028 #endif
00029 #include <omp.h>
00030
00031 #include "nfft3util.h"
00032 #include "nfft3.h"
00033 #include "infft.h"
00034
00035
00036 int main(void)
00037 {
00038 nfft_plan p;
00039 const int N = 1000000;
00040 const int M = 1000000;
00041 ticks t0, t1;
00042 double t;
00043
00044 printf("nthreads = %d\n", nfft_get_num_threads());
00045
00046
00047 fftw_init_threads();
00048 nfft_init_1d(&p,N,M);
00049
00050
00051 nfft_vrand_shifted_unit_double(p.x,p.M_total);
00052
00053
00054 t0 = getticks();
00055 if(p.nfft_flags & PRE_ONE_PSI)
00056 nfft_precompute_one_psi(&p);
00057 t1 = getticks();
00058 t = nfft_elapsed_seconds(t1,t0);
00059 fprintf(stderr,"precompute elapsed time: %.3f seconds\n",t);
00060
00061
00062 nfft_vrand_unit_complex(p.f_hat,p.N_total);
00063
00064
00065 t0 = getticks();
00066 nfft_trafo(&p);
00067 t1 = getticks();
00068 t = nfft_elapsed_seconds(t1,t0);
00069 fprintf(stderr,"compute elapsed time: %.3f seconds\n",t);
00070 fflush(stderr);
00071
00072
00073
00074 nfft_finalize(&p);
00075 fftw_cleanup_threads();
00076
00077 return EXIT_SUCCESS;
00078 }