32 #define NSFTT_DISABLE_TEST
45 plan_1d->
x[j] = ths->
x[ths->
d * j + 1];
48 for(k0=0;k0<ths->
N[0];k0++)
56 omega = ((double)(k0 - ths->
N[0]/2)) * ths->
x[ths->
d * j + 0];
57 ths->
f[j] += plan_1d->
f[j] * cexp( - I*2*KPI*omega);
68 plan_1d->
x[j] = ths->
x[ths->
d * j + 1];
70 for(k0=0;k0<ths->N[0];k0++)
74 omega = ((double)(k0 - ths->
N[0]/2)) * ths->
x[ths->
d * j + 0];
75 plan_1d->
f[j] = ths->
f[j] * cexp( + _Complex_I*2*KPI*omega);
80 nfft_adjoint(plan_1d);
95 plan_1d->
x[j] = ths->
x[ths->
d * j + 2];
98 for(k0=0;k0<ths->
N[0];k0++)
99 for(k1=0;k1<ths->
N[1];k1++)
101 plan_1d->
f_hat = ths->
f_hat + (k0*ths->
N[1]+k1)*ths->
N[2];
107 omega = ((double)(k0 - ths->
N[0]/2)) * ths->
x[ths->
d * j + 0]
108 + ((
double)(k1 - ths->
N[1]/2)) * ths->
x[ths->
d * j + 1];
109 ths->
f[j] += plan_1d->
f[j] * cexp( - I*2*KPI*omega);
120 plan_1d->
x[j] = ths->
x[ths->
d * j + 2];
122 for(k0=0;k0<ths->N[0];k0++)
123 for(k1=0;k1<ths->
N[1];k1++)
127 omega = ((double)(k0 - ths->
N[0]/2)) * ths->
x[ths->
d * j + 0]
128 + ((
double)(k1 - ths->
N[1]/2)) * ths->
x[ths->
d * j + 1];
129 plan_1d->
f[j] = ths->
f[j] * cexp( + _Complex_I*2*KPI*omega);
132 plan_1d->
f_hat = ths->
f_hat + (k0*ths->
N[1]+k1)*ths->
N[2];
134 nfft_adjoint(plan_1d);
149 plan_2d->
x[2*j+0] = ths->
x[ths->
d * j + 1];
150 plan_2d->
x[2*j+1] = ths->
x[ths->
d * j + 2];
153 for(k0=0;k0<ths->
N[0];k0++)
161 omega = ((double)(k0 - ths->
N[0]/2)) * ths->
x[ths->
d * j + 0];
162 ths->
f[j] += plan_2d->
f[j] * cexp( - I*2*KPI*omega);
174 plan_2d->
x[2*j+0] = ths->
x[ths->
d * j + 1];
175 plan_2d->
x[2*j+1] = ths->
x[ths->
d * j + 2];
178 for(k0=0;k0<ths->
N[0];k0++)
182 omega = ((double)(k0 - ths->
N[0]/2)) * ths->
x[ths->
d * j + 0];
183 plan_2d->
f[j] = ths->
f[j] * cexp( + _Complex_I*2*KPI*omega);
188 nfft_adjoint(plan_2d);
195 static int index_sparse_to_full_direct_2d(
int J,
int k)
203 int i, o, a, b,s,l,m1,m2;
206 if (k>=(J+4)*
X(exp2i)(J+1))
215 i=k-4*((J+1)/2+1)*N_B;
316 static inline int index_sparse_to_full_2d(
nsfft_plan *ths,
int k)
319 if( k < ths->N_total)
325 #ifndef NSFTT_DISABLE_TEST
326 static int index_full_to_sparse_2d(
int J,
int k)
338 if ( (k1>=-(a/2)) && (k1<a/2) && (k2>=(-a/2)) && (k2<a/2) )
340 return(4*((J+1)/2+1)*N_B+(k1+a/2)*a+(k2+a/2));
343 for (r=0; r<=(J+1)/2; r++)
347 if ( (k1>=-(b/2)) && (k1<(b+1)/2) && (k2>=a) && (k2<2*a) )
350 return((4*r+0)*N_B+(k1+b/2)*a+(k2-a));
352 return((4*r+0)*N_B+(k2-a)*b+(k1+b/2));
354 else if ( (k1>=a) && (k1<2*a) && (k2>=-(b/2)) && (k2<(b+1)/2) )
357 return((4*r+1)*N_B+(k2+b/2)*a+(k1-a));
359 return((4*r+1)*N_B+(k1-a)*b+(k2+b/2));
361 else if ( (k1>=-(b/2)) && (k1<(b+1)/2) && (k2>=-2*a) && (k2<-a) )
364 return((4*r+2)*N_B+(k1+b/2)*a+(k2+2*a));
366 return((4*r+2)*N_B+(k2+2*a)*b+(k1+b/2));
368 else if ( (k1>=-2*a) && (k1<-a) && (k2>=-(b/2)) && (k2<(b+1)/2) )
371 return((4*r+3)*N_B+(k2+b/2)*a+(k1+2*a));
373 return((4*r+3)*N_B+(k1+2*a)*b+(k2+b/2));
382 static void init_index_sparse_to_full_2d(
nsfft_plan *ths)
386 for (k_S=0; k_S<ths->
N_total; k_S++)
392 static inline int index_sparse_to_full_3d(
nsfft_plan *ths,
int k)
395 if( k < ths->N_total)
402 #ifndef NSFTT_DISABLE_TEST
403 static int index_full_to_sparse_3d(
int J,
int k)
412 int k2=((k/N)%N)-N/2;
417 if((k1>=-(a/2)) && (k1<a/2) && (k2>=(-a/2)) && (k2<a/2) && (k3>=(-a/2)) &&
420 return(6*
X(exp2i)(J)*(
X(exp2i)((J+1)/2+1)-1)+((k1+a/2)*a+(k2+a/2))*a+
425 for (r=0; r<=(J+1)/2; r++)
433 if ((k1>=a) && (k1<2*a) && (k2>=-(b/2)) && (k2<(b+1)/2) &&
434 (k3>=-(b/2)) && (k3<(b+1)/2))
437 return sum_N_B_less_r+N_B_r*0 + ((k2+b/2)*b+k3+b/2)*a + (k1-a);
439 return sum_N_B_less_r+N_B_r*0 + ((k1-a)*b+(k2+b/2))*b + (k3+b/2);
441 else if ((k2>=a) && (k2<2*a) && (k1>=-(b/2)) && (k1<(b+1)/2) &&
442 (k3>=-(b/2)) && (k3<(b+1)/2))
445 return sum_N_B_less_r+N_B_r*1 + ((k1+b/2)*b+k3+b/2)*a + (k2-a);
447 return sum_N_B_less_r+N_B_r*1 + ((k1+b/2)*b+(k2-a))*a + (k3+b/2);
449 return sum_N_B_less_r+N_B_r*1 + ((k2-a)*b+(k1+b/2))*b + (k3+b/2);
451 else if ((k3>=a) && (k3<2*a) && (k1>=-(b/2)) && (k1<(b+1)/2) &&
452 (k2>=-(b/2)) && (k2<(b+1)/2))
455 return sum_N_B_less_r+N_B_r*2 + ((k1+b/2)*b+k2+b/2)*a + (k3-a);
457 return sum_N_B_less_r+N_B_r*2 + ((k3-a)*b+(k1+b/2))*b + (k2+b/2);
460 else if ((k1>=-2*a) && (k1<-a) && (k2>=-(b/2)) && (k2<(b+1)/2) &&
461 (k3>=-(b/2)) && (k3<(b+1)/2))
464 return sum_N_B_less_r+N_B_r*3 + ((k2+b/2)*b+k3+b/2)*a + (k1+2*a);
466 return sum_N_B_less_r+N_B_r*3 + ((k1+2*a)*b+(k2+b/2))*b + (k3+b/2);
468 else if ((k2>=-2*a) && (k2<-a) && (k1>=-(b/2)) && (k1<(b+1)/2) &&
469 (k3>=-(b/2)) && (k3<(b+1)/2))
472 return sum_N_B_less_r+N_B_r*4 + ((k1+b/2)*b+k3+b/2)*a + (k2+2*a);
474 return sum_N_B_less_r+N_B_r*4 + ((k1+b/2)*b+(k2+2*a))*a + (k3+b/2);
476 return sum_N_B_less_r+N_B_r*4 + ((k2+2*a)*b+(k1+b/2))*b + (k3+b/2);
478 else if ((k3>=-2*a) && (k3<-a) && (k1>=-(b/2)) && (k1<(b+1)/2) &&
479 (k2>=-(b/2)) && (k2<(b+1)/2))
482 return sum_N_B_less_r+N_B_r*5 + ((k1+b/2)*b+k2+b/2)*a + (k3+2*a);
484 return sum_N_B_less_r+N_B_r*5 + ((k3+2*a)*b+(k1+b/2))*b + (k2+b/2);
487 sum_N_B_less_r+=6*N_B_r;
495 static void init_index_sparse_to_full_3d(
nsfft_plan *ths)
499 int N=
X(exp2i)(ths->
J+2);
502 for (k_s=0, r=0; r<=(ths->
J+1)/2; r++)
504 a=
X(exp2i)(ths->
J-r);
511 for(k2=-b/2;k2<(b+1)/2;k2++)
512 for(k3=-b/2;k3<(b+1)/2;k3++)
513 for(k1=a; k1<2*a; k1++,k_s++)
516 for(k1=a; k1<2*a; k1++)
517 for(k2=-b/2;k2<(b+1)/2;k2++)
518 for(k3=-b/2;k3<(b+1)/2;k3++,k_s++)
523 for(k1=-b/2;k1<(b+1)/2;k1++)
524 for(k3=-b/2;k3<(b+1)/2;k3++)
525 for(k2=a; k2<2*a; k2++,k_s++)
528 for(k1=-b/2;k1<(b+1)/2;k1++)
529 for(k2=a; k2<2*a; k2++)
530 for(k3=-b/2;k3<(b+1)/2;k3++,k_s++)
533 for(k2=a; k2<2*a; k2++)
534 for(k1=-b/2;k1<(b+1)/2;k1++)
535 for(k3=-b/2;k3<(b+1)/2;k3++,k_s++)
540 for(k1=-b/2;k1<(b+1)/2;k1++)
541 for(k2=-b/2;k2<(b+1)/2;k2++)
542 for(k3=a; k3<2*a; k3++,k_s++)
545 for(k3=a; k3<2*a; k3++)
546 for(k1=-b/2;k1<(b+1)/2;k1++)
547 for(k2=-b/2;k2<(b+1)/2;k2++,k_s++)
552 for(k2=-b/2;k2<(b+1)/2;k2++)
553 for(k3=-b/2;k3<(b+1)/2;k3++)
554 for(k1=-2*a; k1<-a; k1++,k_s++)
557 for(k1=-2*a; k1<-a; k1++)
558 for(k2=-b/2;k2<(b+1)/2;k2++)
559 for(k3=-b/2;k3<(b+1)/2;k3++,k_s++)
564 for(k1=-b/2;k1<(b+1)/2;k1++)
565 for(k3=-b/2;k3<(b+1)/2;k3++)
566 for(k2=-2*a; k2<-a; k2++,k_s++)
569 for(k1=-b/2;k1<(b+1)/2;k1++)
570 for(k2=-2*a; k2<-a; k2++)
571 for(k3=-b/2;k3<(b+1)/2;k3++,k_s++)
574 for(k2=-2*a; k2<-a; k2++)
575 for(k1=-b/2;k1<(b+1)/2;k1++)
576 for(k3=-b/2;k3<(b+1)/2;k3++,k_s++)
581 for(k1=-b/2;k1<(b+1)/2;k1++)
582 for(k2=-b/2;k2<(b+1)/2;k2++)
583 for(k3=-2*a; k3<-a; k3++,k_s++)
586 for(k3=-2*a; k3<-a; k3++)
587 for(k1=-b/2;k1<(b+1)/2;k1++)
588 for(k2=-b/2;k2<(b+1)/2;k2++,k_s++)
593 for(k1=-Nc/2;k1<Nc/2;k1++)
594 for(k2=-Nc/2;k2<Nc/2;k2++)
595 for(k3=-Nc/2; k3<Nc/2; k3++,k_s++)
606 memset(ths_full_plan->
f_hat, 0, ths_full_plan->
N_total*
sizeof(
double _Complex));
616 #ifndef NSFTT_DISABLE_TEST
624 const int N=ths_full_plan->
N[0];
625 const int N_B=
X(exp2i)(J);
628 nsfft_cp(ths, ths_full_plan);
631 printf(
"f_hat blockwise\n");
632 for (r=0; r<=(J+1)/2; r++){
633 a=
X(exp2i)(J-r); b=
X(exp2i)(r);
636 for (k1=0; k1<a; k1++){
637 for (k2=0; k2<b; k2++){
638 printf(
"(%1.1f,%1.1f) ", creal(ths->
f_hat[(4*r+1)*N_B+ k1*b+k2]),
639 cimag(ths->
f_hat[(4*r+1)*N_B+ k1*b+k2]));
645 for (k1=0; k1<a; k1++){
646 for (k2=0; k2<b; k2++){
647 printf(
"(%1.1f,%1.1f) ", creal(ths->
f_hat[(4*r+3)*N_B+ k1*b+k2]),
648 cimag(ths->
f_hat[(4*r+3)*N_B+ k1*b+k2]));
654 for (k2=0; k2<b; k2++){
655 for (k1=0; k1<a; k1++){
656 printf(
"(%1.1f,%1.1f) ", creal(ths->
f_hat[(4*r+0)*N_B+ k2*a+k1]),
657 cimag(ths->
f_hat[(4*r+0)*N_B+ k2*a+k1]));
663 for (k2=0; k2<b; k2++){
664 for (k1=0; k1<a; k1++){
665 printf(
"(%1.1f,%1.1f) ", creal(ths->
f_hat[(4*r+2)*N_B+ k2*a+k1]),
666 cimag(ths->
f_hat[(4*r+2)*N_B+ k2*a+k1]));
674 printf(
"full f_hat\n");
675 for (k1=0;k1<N;k1++){
676 for (k2=0;k2<N;k2++){
677 printf(
"(%1.1f,%1.1f) ", creal(ths_full_plan->
f_hat[k1*N+k2]),
678 cimag(ths_full_plan->
f_hat[k1*N+k2]));
685 #ifndef NSFTT_DISABLE_TEST
686 static void test_sparse_to_full_2d(
nsfft_plan* ths)
689 int N=
X(exp2i)(ths->
J+2);
691 printf(
"N=%d\n\n",N);
696 k_S=index_full_to_sparse_2d(ths->
J, k1*N+k2);
698 printf(
"(%+d, %+d)\t= %+d \t= %+d = %+d \n",k1-N/2,k2-N/2,
704 #ifndef NSFTT_DISABLE_TEST
705 static void test_sparse_to_full_3d(
nsfft_plan* ths)
708 int N=
X(exp2i)(ths->
J+2);
710 printf(
"N=%d\n\n",N);
716 k_S=index_full_to_sparse_3d(ths->
J, (k1*N+k2)*N+k3);
718 printf(
"(%d, %d, %d)\t= %d \t= %d = %d \n",k1-N/2,k2-N/2,k3-N/2,
725 void nsfft_init_random_nodes_coeffs(
nsfft_plan *ths)
766 int N=
X(exp2i)(ths->
J+2);
768 memset(ths->
f,0,ths->
M_total*
sizeof(
double _Complex));
770 for(k_S=0;k_S<ths->
N_total;k_S++)
781 ths->
f[j] += ths->
f_hat[k_S] * cexp( - I*2*KPI*omega);
790 int N=
X(exp2i)(ths->
J+2);
793 memset(ths->
f,0,ths->
M_total*
sizeof(
double _Complex));
795 for(k_S=0;k_S<ths->
N_total;k_S++)
809 ths->
f[j] += ths->
f_hat[k_S] * cexp( - I*2*KPI*omega);
826 int N=
X(exp2i)(ths->
J+2);
828 memset(ths->
f_hat,0,ths->
N_total*
sizeof(
double _Complex));
830 for(k_S=0;k_S<ths->
N_total;k_S++)
841 ths->
f_hat[k_S] += ths->
f[j] * cexp( + _Complex_I*2*KPI*omega);
850 int N=
X(exp2i)(ths->
J+2);
853 memset(ths->
f_hat,0,ths->
N_total*
sizeof(
double _Complex));
855 for(k_S=0;k_S<ths->
N_total;k_S++)
869 ths->
f_hat[k_S] += ths->
f[j] * cexp( + _Complex_I*2*KPI*omega);
877 nsdft_adjoint_2d(ths);
879 nsdft_adjoint_3d(ths);
901 for(rr=0;rr<=(J+1)/2;rr++)
910 temp=-3.0*KPI*
X(exp2i)(J-rr);
936 if((r==rr)&&(J-rr!=rr))
947 if((r==rr)&&(J-rr!=rr))
978 if((r==rr)&&(J-rr!=rr))
989 if((r==rr)&&(J-rr!=rr))
1017 for(rr=0;rr<=(J+1)/2;rr++)
1026 temp=-3.0*KPI*
X(exp2i)(J-rr);
1056 if((r==rr)&&(J-rr!=rr))
1067 if((r==rr)&&(J-rr!=rr))
1098 if((r==rr)&&(J-rr!=rr))
1109 if((r==rr)&&(J-rr!=rr))
1118 int sum_N_B_less_r,N_B_r,a,b;
1135 for(rr=0;rr<=(J+1)/2;rr++)
1143 ths->
act_nfft_plan->my_fftw_plan1 = ths->set_fftw_plan1[rr];
1161 if((J==0)||((J==1)&&(rr==1)))
1164 temp=-3.0*KPI*
X(exp2i)(J-rr);
1243 if((J==0)||((J==1)&&(rr==1)))
1246 temp=-3.0*KPI*
X(exp2i)(J-rr);
1324 sum_N_B_less_r+=6*N_B_r;
1328 static void nsfft_adjoint_3d(
nsfft_plan *ths)
1332 int sum_N_B_less_r,N_B_r,a,b;
1349 for(rr=0;rr<=(J+1)/2;rr++)
1357 ths->
act_nfft_plan->my_fftw_plan1 = ths->set_fftw_plan1[rr];
1358 ths->
act_nfft_plan->my_fftw_plan2 = ths->set_fftw_plan2[rr];
1376 if((J==0)||((J==1)&&(rr==1)))
1379 temp=-3.0*KPI*
X(exp2i)(J-rr);
1458 if((J==0)||((J==1)&&(rr==1)))
1461 temp=-3.0*KPI*
X(exp2i)(J-rr);
1539 sum_N_B_less_r+=6*N_B_r;
1546 nsfft_trafo_2d(ths);
1548 nsfft_trafo_3d(ths);
1554 nsfft_adjoint_2d(ths);
1556 nsfft_adjoint_3d(ths);
1563 static void nsfft_init_2d(
nsfft_plan *ths,
int J,
int M,
int m,
unsigned snfft_flags)
1569 ths->
flags=snfft_flags;
1576 ths->
f = (
double _Complex *)
nfft_malloc(M*
sizeof(
double _Complex));
1583 ths->set_fftw_plan1=(fftw_plan*)
nfft_malloc((J/2+1)*
sizeof(fftw_plan));
1584 ths->set_fftw_plan2=(fftw_plan*)
nfft_malloc((J/2+1)*
sizeof(fftw_plan));
1590 N[0]=1; n[0]=ths->
sigma*N[0];
1591 N[1]=
X(exp2i)(J); n[1]=ths->
sigma*N[1];
1593 nfft_init_guru(ths->
act_nfft_plan,2,N,M,n,m, FG_PSI| MALLOC_X| MALLOC_F| FFTW_INIT, FFTW_MEASURE);
1603 N[0]=
X(exp2i)(r); n[0]=ths->
sigma*N[0];
1604 N[1]=
X(exp2i)(J-r); n[1]=ths->
sigma*N[1];
1605 ths->set_fftw_plan1[r] =
1609 ths->set_fftw_plan2[r] =
1615 for(r=0;r<=
X(log2i)(m);r++)
1617 N[0]=
X(exp2i)(J-r); n[0]=ths->
sigma*N[0];
1619 nfft_init_guru(&(ths->
set_nfft_plan_1d[r]),1,N,M,n,m, MALLOC_X| MALLOC_F| FFTW_INIT, FFTW_MEASURE);
1627 N[0]=
X(exp2i)(J/2+1); n[0]=ths->
sigma*N[0];
1628 N[1]=
X(exp2i)(J/2+1); n[1]=ths->
sigma*N[1];
1637 if(ths->
flags & NSDFT)
1640 init_index_sparse_to_full_2d(ths);
1648 static void nsfft_init_3d(
nsfft_plan *ths,
int J,
int M,
int m,
unsigned snfft_flags)
1654 ths->
flags=snfft_flags;
1658 ths->
N_total=6*
X(exp2i)(J)*(
X(exp2i)((J+1)/2+1)-1)+
X(exp2i)(3*(J/2+1));
1661 ths->
f = (
double _Complex *)
nfft_malloc(M*
sizeof(
double _Complex));
1664 ths->x_102= (
double*)
nfft_malloc(3*M*
sizeof(
double));
1665 ths->x_201= (
double*)
nfft_malloc(3*M*
sizeof(
double));
1666 ths->x_120= (
double*)
nfft_malloc(3*M*
sizeof(
double));
1672 ths->set_fftw_plan1=(fftw_plan*)
nfft_malloc(((J+1)/2+1)*
sizeof(fftw_plan));
1673 ths->set_fftw_plan2=(fftw_plan*)
nfft_malloc(((J+1)/2+1)*
sizeof(fftw_plan));
1680 N[0]=1; n[0]=ths->
sigma*N[0];
1681 N[1]=1; n[1]=ths->
sigma*N[1];
1682 N[2]=
X(exp2i)(J); n[2]=ths->
sigma*N[2];
1684 nfft_init_guru(ths->
act_nfft_plan,3,N,M,n,m, FG_PSI| MALLOC_X| MALLOC_F, FFTW_MEASURE);
1703 for(rr=1;rr<=(J+1)/2;rr++)
1710 n[0]=ths->
sigma*
X(exp2i)(r);
1712 n[1]=ths->
sigma*
X(exp2i)(J-r);
1714 n[1]=ths->
sigma*
X(exp2i)(r);
1715 n[2]=ths->
sigma*
X(exp2i)(J-r);
1717 ths->set_fftw_plan1[rr] =
1720 ths->set_fftw_plan2[rr] =
1726 for(r=0;r<=
X(log2i)(m);r++)
1728 N[0]=
X(exp2i)(J-r); n[0]=ths->
sigma*N[0];
1729 N[1]=
X(exp2i)(J-r); n[1]=ths->
sigma*N[1];
1733 nfft_init_guru(&(ths->
set_nfft_plan_1d[r]),1,N,M,n,m, MALLOC_X| MALLOC_F| FFTW_INIT, FFTW_MEASURE);
1737 nfft_init_guru(&(ths->
set_nfft_plan_2d[r]),2,N,M,n,m, MALLOC_X| MALLOC_F| FFTW_INIT, FFTW_MEASURE);
1746 N[0]=
X(exp2i)(J/2+1); n[0]=ths->
sigma*N[0];
1747 N[1]=
X(exp2i)(J/2+1); n[1]=ths->
sigma*N[1];
1748 N[2]=
X(exp2i)(J/2+1); n[2]=ths->
sigma*N[2];
1757 if(ths->
flags & NSDFT)
1760 init_index_sparse_to_full_3d(ths);
1766 void nsfft_init(
nsfft_plan *ths,
int d,
int J,
int M,
int m,
unsigned flags)
1771 nsfft_init_2d(ths, J, M, m, flags);
1773 nsfft_init_3d(ths, J, M, m, flags);
1776 ths->
mv_trafo = (void (*) (
void* ))nsfft_trafo;
1777 ths->
mv_adjoint = (void (*) (
void* ))nsfft_adjoint;
1780 void nsfft_init(
nsfft_plan *ths,
int d,
int J,
int M,
int m,
unsigned flags)
1789 "\nError in kernel/nsfft_init: require GAUSSIAN window function\n");
1793 static void nsfft_finalize_2d(
nsfft_plan *ths)
1797 if(ths->
flags & NSDFT)
1816 for(r=1;r<=ths->
J/2;r++)
1818 fftw_destroy_plan(ths->set_fftw_plan2[r]);
1819 fftw_destroy_plan(ths->set_fftw_plan1[r]);
1836 static void nsfft_finalize_3d(
nsfft_plan *ths)
1840 if(ths->
flags & NSDFT)
1863 for(r=1;r<=(ths->
J+1)/2;r++)
1865 fftw_destroy_plan(ths->set_fftw_plan2[r]);
1866 fftw_destroy_plan(ths->set_fftw_plan1[r]);
1890 nsfft_finalize_2d(ths);
1892 nsfft_finalize_3d(ths);
void(* mv_adjoint)(void *)
Adjoint transform.
fftw_complex * f_hat
Fourier coefficients.
NFFT_INT d
Dimension (rank).
int d
dimension, rank; d = 2, 3
unsigned flags
flags for precomputation, malloc
NFFT_INT * n
Length of FFTW transforms.
int sigma
oversampling-factor
NFFT_INT N_total
Total number of Fourier coefficients.
double * x_021
coordinate exchanged nodes, d=3
void nfft_vrand_shifted_unit_double(double *x, const NFFT_INT n)
Inits a vector of random double numbers in .
nfft_plan * set_nfft_plan_2d
nfft plans for short nffts
fftw_complex * g1
Input of fftw.
nfft_plan * center_nfft_plan
central nfft block
NFFT_INT M_total
Total number of samples.
data structure for an NFFT (nonequispaced fast Fourier transform) plan with double precision ...
void nfft_vrand_unit_complex(fftw_complex *x, const NFFT_INT n)
Inits a vector of random complex numbers in .
nfft_plan * set_nfft_plan_1d
nfft plans for short nffts
NFFT_INT N_total
Total number of Fourier coefficients.
void(* mv_trafo)(void *)
Transform.
int * index_sparse_to_full
index conversation, overflow for d=3, J=9!
NFFT_INT M_total
Total number of samples.
#define X(name)
Include header for C99 complex datatype.
#define RSWAP(x, y)
Swap two vectors.
#define UNUSED(x)
Dummy use of unused parameters to silence compiler warnings.
NFFT_INT n_total
Combined total length of FFTW transforms.
NFFT_INT K
Number of equispaced samples of window function.
void * nfft_malloc(size_t n)
double * x_transposed
coordinate exchanged nodes, d = 2
int J
problem size, i.e., d=2: N_total=(J+4) 2^(J+1) d=3: N_total=2^J 6(2^((J+1)/2+1)-1)+2^(3(J/2+1)) ...
double * psi
Precomputed data for the sparse matrix , size depends on precomputation scheme.
double * x
Nodes in time/spatial domain, size is doubles.
NFFT_INT * N
Multi-bandwidth.
unsigned flags
Flags for precomputation, (de)allocation, and FFTW usage, default setting is PRE_PHI_HUT | PRE_PSI | ...
fftw_complex * g2
Output of fftw.
unsigned fftw_flags
Flags for the FFTW, default is FFTW_ESTIMATE | FFTW_DESTROY_INPUT.
data structure for an NSFFT (nonequispaced sparse fast Fourier transform) plan with double precision ...
nfft_plan * act_nfft_plan
current nfft block
fftw_complex * f_hat
Fourier coefficients.
NFFT_INT m
Cut-off parameter for window function.