34 static void construct(
char * file,
int N,
int M,
int Z)
45 my_N[0]=Z; my_n[0]=ceil(Z*1.2);
46 my_N[1]=N; my_n[1]=ceil(N*1.2);
47 my_N[2]=N; my_n[2]=ceil(N*1.2);
48 nfft_init_guru(&my_plan, 3, my_N, M, my_n, 6,
49 PRE_PHI_HUT| PRE_PSI |MALLOC_X| MALLOC_F_HAT|
50 MALLOC_F| FFTW_INIT| FFT_OUT_OF_PLACE,
51 FFTW_MEASURE| FFTW_DESTROY_INPUT);
53 fp=fopen(
"knots.dat",
"r");
56 fscanf(fp,
"%le %le %le",&my_plan.
x[3*(j)+1],
57 &my_plan.
x[3*(j)+2],&my_plan.
x[3*(j)+0]);
61 fp=fopen(
"input_f.dat",
"r");
70 fscanf(fp,
"%le ",&real);
71 my_plan.
f_hat[(N*N*l+N*j+k)] = real;
76 if(my_plan.
flags & PRE_PSI)
77 nfft_precompute_psi(&my_plan);
83 fprintf(fk,
"%le %le %le %le %le\n",my_plan.
x[3*j+1],
84 my_plan.
x[3*j+2],my_plan.
x[3*j+0],creal(my_plan.
f[j]),cimag(my_plan.
f[j]));
91 nfft_finalize(&my_plan);
94 int main(
int argc,
char **argv)
97 printf(
"usage: ./construct_data FILENAME N M Z\n");
101 construct(argv[1], atoi(argv[2]),atoi(argv[3]),atoi(argv[4]));
fftw_complex * f_hat
Fourier coefficients.
static void construct(char *file, int N, int M)
construct makes an 2d-nfft
data structure for an NFFT (nonequispaced fast Fourier transform) plan with double precision ...
NFFT_INT M_total
Total number of samples.
double * x
Nodes in time/spatial domain, size is doubles.
unsigned flags
Flags for precomputation, (de)allocation, and FFTW usage, default setting is PRE_PHI_HUT | PRE_PSI | ...