30 #define K(x) ((double) x)
32 static void simple_test_nfsft(
void)
53 for (j = 0; j < plan.
M_total; j++)
55 plan.
x[2*j]= nfft_drand48() - K(0.5);
56 plan.
x[2*j+1]= K(0.5) * nfft_drand48();
60 nfsft_precompute_x(&plan);
63 for (k = 0; k <= plan.
N; k++)
64 for (n = -k; n <= k; n++)
66 nfft_drand48() - K(0.5) + _Complex_I*(nfft_drand48() - K(0.5));
69 nfsft_trafo_direct(&plan);
70 printf(
"Vector f (NDSFT):\n");
71 for (j = 0; j < plan.
M_total; j++)
72 printf(
"f[%+2d] = %+5.3" __FES__
" %+5.3" __FES__
"*I\n",j,
73 creal(plan.
f[j]), cimag(plan.
f[j]));
79 printf(
"Vector f (NFSFT):\n");
80 for (j = 0; j < plan.
M_total; j++)
81 printf(
"f[%+2d] = %+5.3" __FES__
" %+5.3" __FES__
"*I\n",j,
82 creal(plan.
f[j]), cimag(plan.
f[j]));
87 nfsft_adjoint_direct(&plan);
88 printf(
"Vector f_hat (NDSFT):\n");
89 for (k = 0; k <= plan.
N; k++)
90 for (n = -k; n <= k; n++)
91 fprintf(stdout,
"f_hat[%+2d,%+2d] = %+5.3" __FES__
" %+5.3" __FES__
"*I\n",k,n,
99 printf(
"Vector f_hat (NFSFT):\n");
100 for (k = 0; k <= plan.
N; k++)
102 for (n = -k; n <= k; n++)
104 fprintf(stdout,
"f_hat[%+2d,%+2d] = %+5.3" __FES__
" %+5.3" __FES__
"*I\n",k,n,
119 printf(
"Computing an NDSFT, an NFSFT, an adjoint NDSFT, and an adjoint NFSFT"
#define NFSFT_MALLOC_F_HAT
double * x
the nodes for ,
void nfsft_trafo(nfsft_plan *plan)
#define NFSFT_PRESERVE_F_HAT
void nfsft_adjoint(nfsft_plan *plan)
fftw_complex * f_hat
Fourier coefficients.
void nfsft_precompute(int N, double kappa, unsigned int nfsft_flags, unsigned int fpt_flags)
data structure for an NFSFT (nonequispaced fast spherical Fourier transform) plan with double precisi...
NFFT_INT M_total
Total number of samples.
void nfsft_finalize(nfsft_plan *plan)
Header file for the nfft3 library.
#define NFSFT_INDEX(k, n, plan)