NFFT  3.3.0
fastsum.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002, 2015 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$ */
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 
49 #include "nfft3.h"
50 #include "infft.h"
51 
52 #undef X
53 #define X(name) NFFT(name)
54 
55 #if !(defined(NF_LIN) || defined(NF_QUADR) || defined(NF_KUB))
56  #define NF_KUB
57 #endif
58 
59 #ifdef __cplusplus
60 extern "C"
61 {
62 #endif /* __cplusplus */
63 
64 typedef C (*kernel)(R , int , const R *);
65 
69 #define EXACT_NEARFIELD (1U<< 0)
70 
71 #define NEARFIELD_BOXES (1U<< 1)
72 
74 typedef struct fastsum_plan_
75 {
78  int d;
80  int N_total;
81  int M_total;
83  C *alpha;
84  C *f;
86  R *x;
87  R *y;
89  kernel k;
92  unsigned flags;
97  C *pre_K;
100  int n;
101  C *b;
103  int p;
104  R eps_I; /* fixed to p/n so far */
105  R eps_B; /* fixed to 1/16 so far */
106 
107  X(plan) mv1;
108  X(plan) mv2;
111  int Ad;
112  C *Add;
114  /* things for computing *b - are they used only once?? */
115  FFTW(plan) fft_plan;
116 
117  int box_count;
118  int box_count_per_dim;
119  int *box_offset;
120  R *box_x;
121  C *box_alpha;
122 
124 } fastsum_plan;
125 
142 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);
143 
148 void fastsum_finalize(fastsum_plan *ths);
149 
154 void fastsum_exact(fastsum_plan *ths);
155 
161 
166 void fastsum_trafo(fastsum_plan *ths);
167 /* \} */
168 
169 C regkern(kernel k, R xx, int p, const R *param, R a, R b);
170 
172 C kubintkern(const R x, const C *Add,
173  const int Ad, const R a);
174 
175 #ifdef __cplusplus
176 } /* extern "C" */
177 #endif /* __cplusplus */
178 
179 #endif
180 /* fastsum.h */
int M_total
number of target knots
Definition: fastsum.h:81
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:83
R eps_B
outer boundary
Definition: fastsum.h:105
R * kernel_param
parameters for kernel function
Definition: fastsum.h:90
C * Add
spline values
Definition: fastsum.h:112
C * pre_K
internal
Definition: fastsum.h:97
int Ad
near field
Definition: fastsum.h:111
plan for fast summation algorithm
Definition: fastsum.h:74
C * b
expansion coefficients
Definition: fastsum.h:101
C * alpha
source coefficients
Definition: fastsum.h:83
unsigned flags
flags precomp.
Definition: fastsum.h:92
void fastsum_trafo(fastsum_plan *ths)
fast NFFT-based summation
Definition: fastsum.c:1057
int d
api
Definition: fastsum.h:78
void fastsum_precompute(fastsum_plan *ths)
precomputation for fastsum
Definition: fastsum.c:909
int N_total
number of source knots
Definition: fastsum.h:80
#define X(name)
Include header for C99 complex datatype.
Definition: fastsum.h:53
R MEASURE_TIME_t[8]
Measured time for each step if MEASURE_TIME is set.
Definition: fastsum.h:123
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:693
C * f
target evaluations
Definition: fastsum.h:84
kernel k
kernel function
Definition: fastsum.h:89
R * y
target knots in d-ball with radius 1/4-eps_b/2
Definition: fastsum.h:87
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:320
int n
FS__ - fast summation.
Definition: fastsum.h:100
int p
degree of smoothness of regularization
Definition: fastsum.h:103
R eps_I
inner boundary
Definition: fastsum.h:104
void fastsum_finalize(fastsum_plan *ths)
finalization of fastsum plan
Definition: fastsum.c:846
void fastsum_exact(fastsum_plan *ths)
direct computation of sums
Definition: fastsum.c:879
R * x
source knots in d-ball with radius 1/4-eps_b/2
Definition: fastsum.h:86