NFFT Logo 3.0 API Reference
Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

nfct/simple_test.c

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_nfct_1d()
00010 {
00011   int j,k;
00012   nfct_plan p;
00013 
00014   int N=14;
00015   int M=19;
00016 
00018   nfct_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.nfct_flags & PRE_PSI)
00026     nfct_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   ndct_trafo(&p);
00036   nfft_vpr_double(p.f,p.M_total,"ndct, vector f"); 
00037 
00039   nfct_trafo(&p);
00040   nfft_vpr_double(p.f,p.M_total,"nfct, vector f");
00041   
00043   nfct_adjoint(&p);
00044   nfft_vpr_double(p.f_hat,p.N_total,"adjoint ndct, vector f_hat");
00045 
00047   ndct_adjoint(&p);
00048   nfft_vpr_double(p.f_hat,p.N_total,"adjoint nfct, vector f_hat");
00049 
00051   nfct_finalize(&p);
00052 }
00053 
00054 int main()
00055 {
00056   system("clear");
00057   printf("computing one dimensional ndct, nfct and adjoint ndct, nfct\n\n");
00058   simple_test_nfct_1d();
00059   printf("\n\n");
00060 
00061   return 1;
00062 }

Generated on 1 Nov 2006 by Doxygen 1.4.4