Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
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;
00102 double eps_B;
00103
00104 nfft_plan mv1;
00105 nfft_plan mv2;
00108 int Ad;
00109 double _Complex *Add;
00111
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 }
00174 #endif
00175
00176 #endif
00177