|
00001 #include <stdio.h> 00002 #include <math.h> 00003 #include <string.h> 00004 #include <stdlib.h> 00005 00006 #include "util.h" 00007 #include "nfft3.h" 00008 00009 void simple_test_nsfft(int d, int J, int M) 00010 { 00011 int K=12; 00012 nsfft_plan p; 00013 00014 nsfft_init(&p, d, J, M, 6, NSDFT); 00015 00016 nsfft_init_random_nodes_coeffs(&p); 00017 00018 nfft_vpr_complex(p.f_hat, K, "frequencies, vector f_hat (first few entries)"); 00019 00021 nsdft_trafo(&p); 00022 nfft_vpr_complex(p.f, K, "nsdft, vector f (first few entries)"); 00023 00025 nsfft_trafo(&p); 00026 nfft_vpr_complex(p.f, K, "nsfft, vector f (first few entries)"); 00027 00029 nsdft_adjoint(&p); 00030 nfft_vpr_complex(p.f_hat, K, "adjoint nsdft, vector f_hat, (first few entries)"); 00031 00033 nsfft_adjoint(&p); 00034 nfft_vpr_complex(p.f_hat, K, "adjoint nsfft, vector f_hat, (first few entries)"); 00035 00037 nsfft_finalize(&p); 00038 } 00039 00040 int main(int argc,char **argv) 00041 { 00042 int d, J, M; 00043 00044 system("clear"); 00045 printf("1) computing a two dimensional nsdft, nsfft and adjoints\n\n"); 00046 d=2; 00047 J=5; 00048 M=(J+4)*nfft_int_2_pow(J+1); 00049 simple_test_nsfft(d,J,M); 00050 getc(stdin); 00051 00052 system("clear"); 00053 printf("2) computing a three dimensional nsdft, nsfft and adjoints\n\n"); 00054 d=3; 00055 J=5; 00056 M=6*nfft_int_2_pow(J)*(nfft_int_2_pow((J+1)/2+1)-1)+nfft_int_2_pow(3*(J/2+1)); 00057 simple_test_nsfft(d,J,M); 00058 00059 return 1; 00060 }