37 static void simple_test_nfsft(
void)
45 nfsft_precompute(N,1000.0,0U,0U);
53 nfsft_init_guru(&plan, N, M, NFSFT_MALLOC_X | NFSFT_MALLOC_F |
54 NFSFT_MALLOC_F_HAT | NFSFT_NORMALIZED | NFSFT_PRESERVE_F_HAT,
55 PRE_PHI_HUT | PRE_PSI | FFTW_INIT | FFT_OUT_OF_PLACE, 6);
58 for (j = 0; j < plan.
M_total; j++)
60 plan.
x[2*j]= nfft_drand48() - K(0.5);
61 plan.
x[2*j+1]= K(0.5) * nfft_drand48();
65 nfsft_precompute_x(&plan);
68 for (k = 0; k <= plan.
N; k++)
69 for (n = -k; n <= k; n++)
70 plan.
f_hat[NFSFT_INDEX(k,n,&plan)] =
71 nfft_drand48() - K(0.5) + _Complex_I*(nfft_drand48() - K(0.5));
74 nfsft_trafo_direct(&plan);
75 printf(
"Vector f (NDSFT):\n");
76 for (j = 0; j < plan.
M_total; j++)
77 printf(
"f[%+2d] = %+5.3" FE
" %+5.3" FE
"*I\n",j,
78 creal(plan.
f[j]), cimag(plan.
f[j]));
84 printf(
"Vector f (NFSFT):\n");
85 for (j = 0; j < plan.
M_total; j++)
86 printf(
"f[%+2d] = %+5.3" FE
" %+5.3" FE
"*I\n",j,
87 creal(plan.
f[j]), cimag(plan.
f[j]));
92 nfsft_adjoint_direct(&plan);
93 printf(
"Vector f_hat (NDSFT):\n");
94 for (k = 0; k <= plan.
N; k++)
95 for (n = -k; n <= k; n++)
96 fprintf(stdout,
"f_hat[%+2d,%+2d] = %+5.3" FE
" %+5.3" FE
"*I\n",k,n,
97 creal(plan.
f_hat[NFSFT_INDEX(k,n,&plan)]),
98 cimag(plan.
f_hat[NFSFT_INDEX(k,n,&plan)]));
103 nfsft_adjoint(&plan);
104 printf(
"Vector f_hat (NFSFT):\n");
105 for (k = 0; k <= plan.
N; k++)
107 for (n = -k; n <= k; n++)
109 fprintf(stdout,
"f_hat[%+2d,%+2d] = %+5.3" FE
" %+5.3" FE
"*I\n",k,n,
110 creal(plan.
f_hat[NFSFT_INDEX(k,n,&plan)]),
111 cimag(plan.
f_hat[NFSFT_INDEX(k,n,&plan)]));
116 nfsft_finalize(&plan);
124 printf(
"Computing an NDSFT, an NFSFT, an adjoint NDSFT, and an adjoint NFSFT"