NFFT Logo 3.2.2
fastsum.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: fastsum.h 3896 2012-10-10 12:19:26Z tovo $ */
00020 
00038 #ifndef fastsum_h_inc
00039 #define fastsum_h_inc
00040 
00041 #include "config.h"
00042 
00044 #ifdef HAVE_COMPLEX_H
00045 #include <complex.h>
00046 #endif
00047 
00048 #include "nfft3util.h"
00050 #include "nfft3.h"
00051 
00052 #if !(defined(NF_LIN) || defined(NF_QUADR) || defined(NF_KUB))
00053   #define NF_KUB
00054 #endif
00055 
00056 #ifdef __cplusplus
00057 extern "C"
00058 {
00059 #endif /* __cplusplus */
00060 
00061 typedef double _Complex (*kernel)(double , int , const double *);
00062 
00066 #define EXACT_NEARFIELD  (1U<< 0)
00067 
00068 #define NEARFIELD_BOXES (1U<< 1)
00069 
00071 typedef struct fastsum_plan_
00072 {
00075   int d;                                
00077   int N_total;                          
00078   int M_total;                          
00080   double _Complex *alpha;                       
00081   double _Complex *f;                           
00083   double *x;                            
00084   double *y;                            
00086   kernel k;  
00087   double *kernel_param;                 
00089   unsigned flags;                       
00094   double _Complex *pre_K;                       
00097   int n;                                
00098   fftw_complex *b;                      
00100   int p;                                
00101   double eps_I;                           /* fixed to p/n so far  */
00102   double eps_B;                           /* fixed to 1/16 so far */
00103 
00104   nfft_plan mv1;                        
00105   nfft_plan mv2;                        
00108   int Ad;                               
00109   double _Complex *Add;                 
00111   /* things for computing *b - are they used only once?? */
00112   fftw_plan fft_plan;
00113 
00114   int box_count;
00115   int box_count_per_dim;
00116   int *box_offset;
00117   double *box_x;
00118   double _Complex *box_alpha;
00119 
00120   double MEASURE_TIME_t[8]; 
00121 } fastsum_plan;
00122 
00139 void fastsum_init_guru(fastsum_plan *ths, int d, int N_total, int M_total, kernel k, double *param, unsigned flags, int nn, int m, int p, double eps_I, double eps_B);
00140 
00145 void fastsum_finalize(fastsum_plan *ths);
00146 
00151 void fastsum_exact(fastsum_plan *ths);
00152 
00157 void fastsum_precompute(fastsum_plan *ths);
00158 
00163 void fastsum_trafo(fastsum_plan *ths);
00164 /* \} */
00165 
00166 double _Complex regkern(kernel k, double xx, int p, const double *param, double a, double b);
00167 
00169 double _Complex kubintkern(const double x, const double _Complex *Add,
00170   const int Ad, const double a);
00171 
00172 #ifdef __cplusplus
00173 }  /* extern "C" */
00174 #endif /* __cplusplus */
00175 
00176 #endif
00177 /* fastsum.h */

Generated on Fri Oct 12 2012 by Doxygen 1.8.0-20120409