36 static void construct(
char * file,
int N,
int M,
int Z)
47 my_N[0]=Z; my_n[0]=ceil(Z*1.2);
48 my_N[1]=N; my_n[1]=ceil(N*1.2);
49 my_N[2]=N; my_n[2]=ceil(N*1.2);
50 nfft_init_guru(&my_plan, 3, my_N, M, my_n, 6,
51 PRE_PHI_HUT| PRE_PSI |MALLOC_X| MALLOC_F_HAT|
52 MALLOC_F| FFTW_INIT| FFT_OUT_OF_PLACE,
53 FFTW_MEASURE| FFTW_DESTROY_INPUT);
55 fp=fopen(
"knots.dat",
"r");
58 fscanf(fp,
"%le %le %le",&my_plan.
x[3*(j)+1],
59 &my_plan.
x[3*(j)+2],&my_plan.
x[3*(j)+0]);
63 fp=fopen(
"input_f.dat",
"r");
72 fscanf(fp,
"%le ",&real);
73 my_plan.
f_hat[(N*N*l+N*j+k)] = real;
78 if(my_plan.
flags & PRE_PSI)
79 nfft_precompute_psi(&my_plan);
85 fprintf(fk,
"%le %le %le %le %le\n",my_plan.
x[3*j+1],
86 my_plan.
x[3*j+2],my_plan.
x[3*j+0],creal(my_plan.
f[j]),cimag(my_plan.
f[j]));
93 nfft_finalize(&my_plan);
96 int main(
int argc,
char **argv)
99 printf(
"usage: ./construct_data FILENAME N M Z\n");
103 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 | ...