29 static void simple_test_nfsoft(
int bw,
int M)
60 for (j = 0; j < plan_nfsoft.
M_total; j++)
62 d1 = ((double) rand()) / RAND_MAX - 0.5;
63 d2 = 0.5 * ((double) rand()) / RAND_MAX;
64 d3 = ((double) rand()) / RAND_MAX - 0.5;
66 plan_nfsoft.
x[3* j ] = d1;
67 plan_nfsoft.
x[3* j + 1] = d2;
68 plan_nfsoft.
x[3* j + 2] = d3;
70 plan_ndsoft.
x[3* j ] = d1;
71 plan_ndsoft.
x[3* j + 1] = d2;
72 plan_ndsoft.
x[3* j + 2] = d3;
76 for (j = 0; j < (bw + 1) * (4* (bw +1)*(bw+1)-1)/3;j++)
78 d1=((double)rand())/RAND_MAX - 0.5;
79 d2=((double)rand())/RAND_MAX - 0.5;
80 plan_nfsoft.
f_hat[j]=d1 + I*d2;
81 plan_ndsoft.
f_hat[j]=d1 + I*d2;
84 if ((bw+1)*(4*(bw+1)*(bw+1)-1)/3<=20)
85 nfft_vpr_complex(plan_nfsoft.
f_hat,(bw+1)*(4*(bw+1)*(bw+1)-1)/3,
"randomly generated SO(3) Fourier coefficients");
89 printf(
"\n---------------------------------------------\n");
97 t0 = nfft_clock_gettime_seconds();
99 t1 = nfft_clock_gettime_seconds();
105 printf(
" computed in %11le seconds\n",time);
108 t0 = nfft_clock_gettime_seconds();
110 t1 = nfft_clock_gettime_seconds();
116 printf(
" computed in %11le seconds\n",time);
119 error= nfft_error_l_infty_complex(plan_ndsoft.
f,plan_nfsoft.
f, plan_nfsoft.
M_total);
120 printf(
"\n The NFSOFT of bandwidth=%d for %d rotations has infty-error %11le \n",bw, M,error);
122 printf(
"\n---------------------------------------------\n");
124 plan_nfsoft.
f[0]=1.0;
125 plan_ndsoft.
f[0]=1.0;
129 t0 = nfft_clock_gettime_seconds();
131 t1 = nfft_clock_gettime_seconds();
133 if ((bw+1)*(4*(bw+1)*(bw+1)-1)/3<=20)
137 printf(
" computed in %11le seconds\n",time);
140 t0 = nfft_clock_gettime_seconds();
142 t1 = nfft_clock_gettime_seconds();
144 if ((bw+1)*(4*(bw+1)*(bw+1)-1)/3<=20)
148 printf(
" computed in %11le seconds\n",time);
152 error=nfft_error_l_infty_complex(plan_ndsoft.
f_hat,plan_nfsoft.
f_hat, (bw+1)*(4*(bw+1)*(bw+1)-1)/3);
153 printf(
"\n The adjoint NFSOFT of bandwidth=%d for %d rotations has infty-error %11le \n",bw, M,error);
155 printf(
"\n---------------------------------------------\n");
178 int main(
int argc,
char **argv)
186 "This test programm computes the NFSOFT with maximum polynomial degree N at M input rotations\n");
187 printf(
"Usage: simple_test N M \n");
188 printf(
"e.g.: simple_test 8 64\n");
197 "computing an NDSOFT, an NFSOFT, an adjoint NDSOFT, and an adjoint NFSOFT\n\n");
199 simple_test_nfsoft(N, M);
fftw_complex * f_hat
Fourier coefficients.
#define NFSOFT_MALLOC_F_HAT
NFFT_INT M_total
Total number of samples.
void nfsoft_precompute(nfsoft_plan *plan)
void nfft_vpr_complex(fftw_complex *x, const NFFT_INT n, const char *text)
Print complex vector to standard output.
void nfsoft_finalize(nfsoft_plan *plan)
void nfsoft_trafo(nfsoft_plan *plan_nfsoft)
void nfsoft_init_guru(nfsoft_plan *plan, int N, int M, unsigned int nfsoft_flags, unsigned int nfft_flags, int nfft_cutoff, int fpt_kappa)
void nfsoft_adjoint(nfsoft_plan *plan_nfsoft)
Header file for the nfft3 library.