NFFT Logo 3.2.4
fastsum.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002, 2012 Jens Keiner, Stefan Kunis, Daniel Potts
3  *
4  * This program is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU General Public License as published by the Free Software
6  * Foundation; either version 2 of the License, or (at your option) any later
7  * version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc., 51
16  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 /* $Id: fastsum.h 3896 2012-10-10 12:19:26Z tovo $ */
20 
38 #ifndef fastsum_h_inc
39 #define fastsum_h_inc
40 
41 #include "config.h"
42 
44 #ifdef HAVE_COMPLEX_H
45 #include <complex.h>
46 #endif
47 
48 #include "nfft3util.h"
50 #include "nfft3.h"
51 
52 #if !(defined(NF_LIN) || defined(NF_QUADR) || defined(NF_KUB))
53  #define NF_KUB
54 #endif
55 
56 #ifdef __cplusplus
57 extern "C"
58 {
59 #endif /* __cplusplus */
60 
61 typedef double _Complex (*kernel)(double , int , const double *);
62 
66 #define EXACT_NEARFIELD (1U<< 0)
67 
68 #define NEARFIELD_BOXES (1U<< 1)
69 
71 typedef struct fastsum_plan_
72 {
75  int d;
77  int N_total;
78  int M_total;
80  double _Complex *alpha;
81  double _Complex *f;
83  double *x;
84  double *y;
86  kernel k;
87  double *kernel_param;
89  unsigned flags;
94  double _Complex *pre_K;
97  int n;
98  fftw_complex *b;
100  int p;
101  double eps_I; /* fixed to p/n so far */
102  double eps_B; /* fixed to 1/16 so far */
103 
108  int Ad;
109  double _Complex *Add;
111  /* things for computing *b - are they used only once?? */
112  fftw_plan fft_plan;
113 
114  int box_count;
115  int box_count_per_dim;
116  int *box_offset;
117  double *box_x;
118  double _Complex *box_alpha;
119 
120  double MEASURE_TIME_t[8];
121 } fastsum_plan;
122 
139 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);
140 
145 void fastsum_finalize(fastsum_plan *ths);
146 
151 void fastsum_exact(fastsum_plan *ths);
152 
158 
163 void fastsum_trafo(fastsum_plan *ths);
164 /* \} */
165 
166 double _Complex regkern(kernel k, double xx, int p, const double *param, double a, double b);
167 
169 double _Complex kubintkern(const double x, const double _Complex *Add,
170  const int Ad, const double a);
171 
172 #ifdef __cplusplus
173 } /* extern "C" */
174 #endif /* __cplusplus */
175 
176 #endif
177 /* fastsum.h */
int M_total
number of target knots
Definition: fastsum.h:78
double * y
target knots in d-ball with radius 1/4-eps_b/2
Definition: fastsum.h:84
double eps_B
outer boundary
Definition: fastsum.h:102
struct fastsum_plan_ fastsum_plan
plan for fast summation algorithm
double * kernel_param
parameters for kernel function
Definition: fastsum.h:87
nfft_plan mv2
target nfft plan
Definition: fastsum.h:105
double _Complex * Add
spline values
Definition: fastsum.h:109
double _Complex regkern(kernel k, double xx, int p, const double *param, double a, double b)
regularized kernel with K_I arbitrary and K_B smooth to zero
Definition: fastsum.c:80
nfft_plan mv1
source nfft plan
Definition: fastsum.h:104
int Ad
near field
Definition: fastsum.h:108
plan for fast summation algorithm
Definition: fastsum.h:71
double eps_I
inner boundary
Definition: fastsum.h:101
Header file for utility functions used by the nfft3 library.
double * x
source knots in d-ball with radius 1/4-eps_b/2
Definition: fastsum.h:83
double _Complex * f
target evaluations
Definition: fastsum.h:81
unsigned flags
flags precomp.
Definition: fastsum.h:89
double _Complex * alpha
source coefficients
Definition: fastsum.h:80
void fastsum_trafo(fastsum_plan *ths)
fast NFFT-based summation
Definition: fastsum.c:940
int d
api
Definition: fastsum.h:75
void fastsum_precompute(fastsum_plan *ths)
precomputation for fastsum
Definition: fastsum.c:802
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)
initialization of fastsum plan
Definition: fastsum.c:600
int N_total
number of source knots
Definition: fastsum.h:77
fftw_complex * b
expansion coefficients
Definition: fastsum.h:98
double MEASURE_TIME_t[8]
Measured time for each step if MEASURE_TIME is set.
Definition: fastsum.h:120
kernel k
kernel function
Definition: fastsum.h:86
int n
FS__ - fast summation.
Definition: fastsum.h:97
int p
degree of smoothness of regularization
Definition: fastsum.h:100
void fastsum_finalize(fastsum_plan *ths)
finalization of fastsum plan
Definition: fastsum.c:742
void fastsum_exact(fastsum_plan *ths)
direct computation of sums
Definition: fastsum.c:775
double _Complex * pre_K
internal
Definition: fastsum.h:94
double _Complex kubintkern(const double x, const double _Complex *Add, const int Ad, const double a)
cubic spline interpolation in near field with even kernels
Definition: fastsum.c:279

Generated on Thu May 7 2015 by Doxygen 1.8.5