NFFT Logo 3.2.2
nfft3util.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2002, 2012 Jens Keiner, Stefan Kunis, Daniel Potts
00003  *
00004  * This program is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU General Public License as published by the Free Software
00006  * Foundation; either version 2 of the License, or (at your option) any later
00007  * version.
00008  *
00009  * This program is distributed in the hope that it will be useful, but WITHOUT
00010  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00011  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00012  * details.
00013  *
00014  * You should have received a copy of the GNU General Public License along with
00015  * this program; if not, write to the Free Software Foundation, Inc., 51
00016  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 /* $Id: nfft3util.h 3896 2012-10-10 12:19:26Z tovo $ */
00020 
00024 #ifndef __UTIL_H__
00025 #define __UTIL_H__
00026 
00028 #include <fftw3.h>
00029 
00030 #ifdef __cplusplus
00031 extern "C"
00032 {
00033 #endif /* __cplusplus */
00034 
00035 /*###########################################################################*/
00036 /*###########################################################################*/
00037 /*###########################################################################*/
00038 
00052 #define NFFT_SWAP_complex(x,y) {fftw_complex* NFFT_SWAP_temp__; \
00053   NFFT_SWAP_temp__=(x); (x)=(y); (y)=NFFT_SWAP_temp__;}
00054 
00057 #define NFFT_SWAP_double(x,y) {double* NFFT_SWAP_temp__; NFFT_SWAP_temp__=(x); \
00058   (x)=(y); (y)=NFFT_SWAP_temp__;}
00059 
00062 #define PI 3.141592653589793238462643383279502884197169399375105820974944592
00063 #define PI2 6.283185307179586476925286766559005768394338798750211641949889185
00064 #define PI4 12.56637061435917295385057353311801153678867759750042328389977837
00065 
00068 #define NFFT_MAX(a,b) ((a)>(b)? (a) : (b))
00069 
00072 #define NFFT_MIN(a,b) ((a)<(b)? (a) : (b))
00073 
00074 /* ######################################################################### */
00075 /* ########## Window function related ###################################### */
00076 /* ######################################################################### */
00077 
00080 double nfft_bspline_old(int k,double x,double *A);
00081 
00085 double nfft_bspline(int k, double x, double *scratch);
00086 
00087 /* ######################################################################### */
00088 /* ########## Vector routines ############################################## */
00089 /* ######################################################################### */
00090 
00093 int nfft_prod_int(int *vec, int d);
00094 
00097 int nfst_prod_minus_a_int(int *vec, int a, int d);
00098 
00101 int nfft_plain_loop(int *idx,int *N,int d);
00102 
00105 double nfft_prod_real(double *vec,int d);
00106 
00109 double nfft_dot_complex(fftw_complex* x, int n);
00110 
00113 double nfft_dot_double( double*  x, int n);
00114 
00117 double nfft_dot_w_complex(fftw_complex* x, double* w, int n);
00118 
00121 double nfft_dot_w_double( double*  x, double* w, int n);
00122 
00126 double nfft_dot_w_w2_complex(fftw_complex* x, double* w, double* w2, int n);
00127 
00131 double nfft_dot_w2_complex(fftw_complex* x, double* w2, int n);
00132 
00135 void nfft_cp_complex(fftw_complex* x, fftw_complex* y, int n);
00136 
00139 void nfft_cp_double( double*  x, double*  y, int n);
00140 
00143 void nfft_cp_a_complex(fftw_complex* x, double a, fftw_complex* y, int n);
00144 
00147 void nfft_cp_a_double(double *x, double a, double *y, int n);
00148 
00151 void nfft_cp_w_complex(fftw_complex* x, double* w, fftw_complex* y, int n);
00152 
00155 void nfft_cp_w_double( double*  x, double* w, double*  y, int n);
00156 
00159 void nfft_upd_axpy_complex(fftw_complex* x, double a, fftw_complex* y, int n);
00160 
00163 void nfft_upd_axpy_double( double*  x, double a, double*  y, int n);
00164 
00167 void nfft_upd_xpay_complex(fftw_complex* x, double a, fftw_complex* y, int n);
00168 
00171 void nfft_upd_xpay_double( double*  x, double a, double*  y, int n);
00172 
00175 void nfft_upd_axpby_complex(fftw_complex* x, double a, fftw_complex* y, double b, int n);
00176 
00179 void nfft_upd_axpby_double(  double* x, double a, double*  y, double b, int n);
00180 
00183 void nfft_upd_xpawy_complex(fftw_complex* x, double a, double* w, fftw_complex* y, int n);
00184 
00187 void nfft_upd_xpawy_double( double*  x, double a, double* w, double*  y, int n);
00188 
00191 void nfft_upd_axpwy_complex(fftw_complex* x, double a, double* w, fftw_complex* y, int n);
00192 
00195 void nfft_upd_axpwy_double( double*  x, double a, double* w, double*  y, int n);
00196 
00199 void nfft_fftshift_complex(fftw_complex *x, int d, int* N);
00200 
00203 void nfft_vpr_int(int *x, int n, char *text);
00204 
00207 void nfft_vpr_double(double *x, int n, const char *text);
00208 
00211 void nfft_vpr_complex(fftw_complex *x, int n, const char *text);
00212 
00215 void nfft_vrand_unit_complex(fftw_complex *x, int n);
00216 
00219 void nfft_vrand_shifted_unit_double(double *x, int n);
00220 
00221 /* ######################################################################### */
00222 /* ########## Helpers for inverse transforms ############################### */
00223 /* ######################################################################### */
00224 
00226 void nfft_voronoi_weights_1d(double *w, double *x, int M);
00227 
00229 void nfft_voronoi_weights_S2(double *w, double *xi, int M);
00230 
00234 double nfft_modified_fejer(int N,int kk);
00235 
00238 double nfft_modified_jackson2(int N,int kk);
00239 
00242 double nfft_modified_jackson4(int N,int kk);
00243 
00246 double nfft_modified_sobolev(double mu,int kk);
00247 
00250 double nfft_modified_multiquadric(double mu,double c,int kk);
00251 
00252 int nfft_smbi(const double x, const double alpha, const int nb, const int ize,
00253   double *b);
00254 
00255 double nfft_drand48(void);
00256 
00257 void nfft_srand48(long int seed);
00258 
00261 void nfft_sort_node_indices_radix_lsdf(int n, int *keys0, int *keys1, int rhigh);
00262 
00265 void nfft_sort_node_indices_radix_msdf(int n, int *keys0, int *keys1, int rhigh);
00266 
00267 int nfft_get_num_threads(void);
00268 
00269 #ifdef _OPENMP
00270 int nfft_get_omp_num_threads(void);
00271 #endif
00272 
00273 #ifdef __cplusplus
00274 }  /* extern "C" */
00275 #endif /* __cplusplus */
00276 
00279 #endif

Generated on Fri Oct 12 2012 by Doxygen 1.8.0-20120409