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
00026 #include "nfft3util.h"
00027 #include "nfft3.h"
00028
00029 void simple_test_nfct_1d(void)
00030 {
00031 int j,k;
00032 nfct_plan p;
00033
00034 int N=14;
00035 int M=19;
00036
00038 nfct_init_1d(&p,N,M);
00039
00041 for(j = 0; j < p.d*p.M_total; j++)
00042 p.x[j] = 0.5 * ((double)rand()) / RAND_MAX;
00043
00045 if( p.nfct_flags & PRE_PSI)
00046 nfct_precompute_psi( &p);
00047
00049 for(k = 0; k < p.N_total; k++)
00050 p.f_hat[k] = (double)rand() / RAND_MAX;
00051
00052 nfft_vpr_double(p.f_hat,p.N_total,"given Fourier coefficients, vector f_hat");
00053
00055 ndct_trafo(&p);
00056 nfft_vpr_double(p.f,p.M_total,"ndct, vector f");
00057
00059 nfct_trafo(&p);
00060 nfft_vpr_double(p.f,p.M_total,"nfct, vector f");
00061
00063 nfct_adjoint(&p);
00064 nfft_vpr_double(p.f_hat,p.N_total,"adjoint ndct, vector f_hat");
00065
00067 ndct_adjoint(&p);
00068 nfft_vpr_double(p.f_hat,p.N_total,"adjoint nfct, vector f_hat");
00069
00071 nfct_finalize(&p);
00072 }
00073
00074 int main(void)
00075 {
00076 system("clear");
00077 printf("computing one dimensional ndct, nfct and adjoint ndct, nfct\n\n");
00078 simple_test_nfct_1d();
00079 printf("\n\n");
00080
00081 return 1;
00082 }