| NFFT 3.5.0

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

fastsum.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2002, 2017 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
42 #ifndef fastsum_h_inc
43 #define fastsum_h_inc
44
45 #include "config.h"
46
48 #ifdef HAVE_COMPLEX_H
49 #include <complex.h>
50 #endif
51
53 #include "nfft3.h"
54 #include "infft.h"
55
56 #undef X
57 #define X(name) NFFT(name)
58
59 #if !(defined(NF_LIN) || defined(NF_QUADR) || defined(NF_KUB))
60 #define NF_KUB
61 #endif
62
63 #ifdef __cplusplus
64 extern "C"
65 {
66 #endif /* __cplusplus */
67
68 typedef C (*kernel)(R , int , const R *);
69
73 #define EXACT_NEARFIELD (1U<< 0)
74
75 #define NEARFIELD_BOXES (1U<< 1)
76
79 #define STORE_PERMUTATION_X_ALPHA (1U<< 2)
80
82 typedef struct fastsum_plan_
83 {
86 int d;
88 int N_total;
89 int M_total;
91 C *alpha;
92 C *f;
94 R *x;
95 R *y;
97 kernel k;
98 R *kernel_param;
100 unsigned flags;
105 C *pre_K;
108 int n;
109 C *b;
110 C *f_hat;
112 int p;
113 R eps_I; /* fixed to p/n so far */
114 R eps_B; /* fixed to 1/16 so far */
115
116 X(plan) mv1;
117 X(plan) mv2;
120 int Ad;
121 C *Add;
123 /* things for computing *b - are they used only once?? */
124 FFTW(plan) fft_plan;
125
126 int box_count;
127 int box_count_per_dim;
128 int *box_offset;
129 R *box_x;
130 C *box_alpha;
131
132 int *permutation_x_alpha;
134 R MEASURE_TIME_t[8];
136 } fastsum_plan;
137
154 void fastsum_init_guru(fastsum_plan *ths, int d, int N_total, int M_total, kernel k, R *param, unsigned flags, int nn, int m, int p, R eps_I, R eps_B);
155
169 void fastsum_init_guru_kernel(fastsum_plan *ths, int d, kernel k, R *param,
170 unsigned flags, int nn, int p, R eps_I, R eps_B);
171
180 void fastsum_init_guru_source_nodes(fastsum_plan *ths, int N_total, int nn_oversampled, int m);
181
190 void fastsum_init_guru_target_nodes(fastsum_plan *ths, int M_total, int nn_oversampled, int m);
191
196 void fastsum_finalize(fastsum_plan *ths);
197
202 void fastsum_finalize_source_nodes(fastsum_plan *ths);
203
208 void fastsum_finalize_target_nodes(fastsum_plan *ths);
209
214 void fastsum_finalize_kernel(fastsum_plan *ths);
215
220 void fastsum_exact(fastsum_plan *ths);
221
226 void fastsum_precompute_source_nodes(fastsum_plan *ths);
227
232 void fastsum_precompute_target_nodes(fastsum_plan *ths);
233
238 void fastsum_precompute(fastsum_plan *ths);
239
244 void fastsum_trafo(fastsum_plan *ths);
245 /* \} */
246
247 C regkern(kernel k, R xx, int p, const R *param, R a, R b);
248
250 C kubintkern(const R x, const C *Add,
251 const int Ad, const R a);
252
253 #ifdef __cplusplus
254 } /* extern "C" */
255 #endif /* __cplusplus */
256
257 #endif
258 /* fastsum.h */
fastsum_plan_::M_total
int M_total
number of target knots
Definition: fastsum.h:89
regkern
C regkern(kernel k, R xx, int p, const R *param, R a, R b)
regularized kernel with K_I arbitrary and K_B smooth to zero
Definition: fastsum.c:81
fastsum_plan_::permutation_x_alpha
int * permutation_x_alpha
permutation vector of source nodes if STORE_PERMUTATION_X_ALPHA is set
Definition: fastsum.h:132
fastsum_plan_::eps_B
R eps_B
outer boundary
Definition: fastsum.h:114
fastsum_plan_::kernel_param
R * kernel_param
parameters for kernel function
Definition: fastsum.h:98
fastsum_init_guru_source_nodes
void fastsum_init_guru_source_nodes(fastsum_plan *ths, int N_total, int nn_oversampled, int m)
initialize source nodes dependent part of fast summation plan
Definition: fastsum.c:887
fastsum_plan_::Add
C * Add
spline values
Definition: fastsum.h:121
fastsum_plan_::f_hat
C * f_hat
Fourier coefficients of nfft plans.
Definition: fastsum.h:110
fastsum_plan_::pre_K
C * pre_K
internal
Definition: fastsum.h:105
fastsum_finalize_kernel
void fastsum_finalize_kernel(fastsum_plan *ths)
finalization of fastsum plan
Definition: fastsum.c:1029
fastsum_plan_::Ad
int Ad
near field
Definition: fastsum.h:120
fastsum_plan_
plan for fast summation algorithm
Definition: fastsum.h:82
fastsum_plan_::b
C * b
expansion coefficients
Definition: fastsum.h:109
fastsum_precompute_source_nodes
void fastsum_precompute_source_nodes(fastsum_plan *ths)
precomputation for fastsum
Definition: fastsum.c:1086
fastsum_plan_::alpha
C * alpha
source coefficients
Definition: fastsum.h:91
fastsum_plan_::flags
unsigned flags
flags precomp.
Definition: fastsum.h:100
fastsum_trafo
void fastsum_trafo(fastsum_plan *ths)
fast NFFT-based summation
Definition: fastsum.c:1180
fastsum_plan_::d
int d
api
Definition: fastsum.h:86
fastsum_precompute
void fastsum_precompute(fastsum_plan *ths)
precomputation for fastsum
Definition: fastsum.c:1173
fastsum_plan_::N_total
int N_total
number of source knots
Definition: fastsum.h:88
X
#define X(name)
Include header for C99 complex datatype.
Definition: fastsum.h:57
fastsum_finalize_target_nodes
void fastsum_finalize_target_nodes(fastsum_plan *ths)
finalization of fastsum plan
Definition: fastsum.c:1020
fastsum_plan_::MEASURE_TIME_t
R MEASURE_TIME_t[8]
Measured time for each step if MEASURE_TIME is set.
Definition: fastsum.h:134
fastsum_init_guru
void fastsum_init_guru(fastsum_plan *ths, int d, int N_total, int M_total, kernel k, R *param, unsigned flags, int nn, int m, int p, R eps_I, R eps_B)
initialization of fastsum plan
Definition: fastsum.c:987
fastsum_plan_::f
C * f
target evaluations
Definition: fastsum.h:92
fastsum_precompute_target_nodes
void fastsum_precompute_target_nodes(fastsum_plan *ths)
precomputation for fastsum
Definition: fastsum.c:1141
fastsum_finalize_source_nodes
void fastsum_finalize_source_nodes(fastsum_plan *ths)
finalization of fastsum plan
Definition: fastsum.c:996
fastsum_plan_::k
kernel k
kernel function
Definition: fastsum.h:97
fastsum_plan_::y
R * y
target knots in d-ball with radius 1/4-eps_b/2
Definition: fastsum.h:95
kubintkern
C kubintkern(const R x, const C *Add, const int Ad, const R a)
cubic spline interpolation in near field with even kernels
Definition: fastsum.c:318
fastsum_plan_::n
int n
FS__ - fast summation.
Definition: fastsum.h:108
fastsum_init_guru_kernel
void fastsum_init_guru_kernel(fastsum_plan *ths, int d, kernel k, R *param, unsigned flags, int nn, int p, R eps_I, R eps_B)
initialize node independent part of fast summation plan
Definition: fastsum.c:779
fastsum_init_guru_target_nodes
void fastsum_init_guru_target_nodes(fastsum_plan *ths, int M_total, int nn_oversampled, int m)
initialize target nodes dependent part of fast summation plan
Definition: fastsum.c:955
nfft3.h
Header file for the nfft3 library.
fastsum_plan_::p
int p
degree of smoothness of regularization
Definition: fastsum.h:112
fastsum_plan_::eps_I
R eps_I
inner boundary
Definition: fastsum.h:113
fastsum_finalize
void fastsum_finalize(fastsum_plan *ths)
finalization of fastsum plan
Definition: fastsum.c:1048
fastsum_exact
void fastsum_exact(fastsum_plan *ths)
direct computation of sums
Definition: fastsum.c:1056
fastsum_plan_::x
R * x
source knots in d-ball with radius 1/4-eps_b/2
Definition: fastsum.h:94