|
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_nfst_1d() 00010 { 00011 int j,k; 00012 nfst_plan p; 00013 00014 int N=14; 00015 int M=19; 00016 00018 nfst_init_1d(&p,N,M); 00019 00021 for(j = 0; j < p.d*p.M_total; j++) 00022 p.x[j] = 0.5 * ((double)rand()) / RAND_MAX; 00023 00025 if( p.nfst_flags & PRE_PSI) 00026 nfst_precompute_psi( &p); 00027 00029 for(k = 0; k < p.N_total; k++) 00030 p.f_hat[k] = (double)rand() / RAND_MAX; 00031 00032 nfft_vpr_double(p.f_hat,p.N_total,"given Fourier coefficients, vector f_hat"); 00033 00035 ndst_trafo(&p); 00036 nfft_vpr_double(p.f,p.M_total,"ndst, vector f"); 00037 00039 nfst_trafo(&p); 00040 nfft_vpr_double(p.f,p.M_total,"nfst, vector f"); 00041 00043 ndst_adjoint(&p); 00044 nfft_vpr_double(p.f_hat,p.N_total,"adjoint ndst, vector f_hat"); 00045 00047 nfst_adjoint(&p); 00048 nfft_vpr_double(p.f_hat,p.N_total,"adjoint nfst, vector f_hat"); 00049 00051 nfst_finalize(&p); 00052 } 00053 00054 int main() 00055 { 00056 system("clear"); 00057 printf("computing one dimensional ndst, nfst and adjoint ndst, nfst\n\n"); 00058 simple_test_nfst_1d(); 00059 printf("\n\n"); 00060 00061 return 1; 00062 }