00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <stdio.h>
00022 #include <math.h>
00023 #include <string.h>
00024 #include <stdlib.h>
00025 #include <complex.h>
00026
00027 #include "nfft3util.h"
00028 #include "nfft3.h"
00029
00030 void simple_test_nsfft(int d, int J, int M)
00031 {
00032 int K=12;
00033 nsfft_plan p;
00034
00035 nsfft_init(&p, d, J, M, 6, NSDFT);
00036
00037 nsfft_init_random_nodes_coeffs(&p);
00038
00039 nfft_vpr_complex(p.f_hat, K, "frequencies, vector f_hat (first few entries)");
00040
00042 nsdft_trafo(&p);
00043 nfft_vpr_complex(p.f, K, "nsdft, vector f (first few entries)");
00044
00046 nsfft_trafo(&p);
00047 nfft_vpr_complex(p.f, K, "nsfft, vector f (first few entries)");
00048
00050 nsdft_adjoint(&p);
00051 nfft_vpr_complex(p.f_hat, K, "adjoint nsdft, vector f_hat, (first few entries)");
00052
00054 nsfft_adjoint(&p);
00055 nfft_vpr_complex(p.f_hat, K, "adjoint nsfft, vector f_hat, (first few entries)");
00056
00058 nsfft_finalize(&p);
00059 }
00060
00061 int main(int argc,char **argv)
00062 {
00063 int d, J, M;
00064
00065 system("clear");
00066 printf("1) computing a two dimensional nsdft, nsfft and adjoints\n\n");
00067 d=2;
00068 J=5;
00069 M=(J+4)*nfft_int_2_pow(J+1);
00070 simple_test_nsfft(d,J,M);
00071 getc(stdin);
00072
00073 system("clear");
00074 printf("2) computing a three dimensional nsdft, nsfft and adjoints\n\n");
00075 d=3;
00076 J=5;
00077 M=6*nfft_int_2_pow(J)*(nfft_int_2_pow((J+1)/2+1)-1)+nfft_int_2_pow(3*(J/2+1));
00078 simple_test_nsfft(d,J,M);
00079
00080 return 1;
00081 }