NFFT Logo 3.2.3
infft.h
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: infft.h 3896 2012-10-10 12:19:26Z tovo $ */
20 
21 /* NFFT internal header file */
22 #ifndef __INFFT_H__
23 #define __INFFT_H__
24 
25 #include "config.h"
26 
27 #include <math.h>
28 #include <float.h>
29 #ifdef HAVE_COMPLEX_H
30 #include <complex.h>
31 #endif
32 #include <stdio.h>
33 #include <string.h>
34 
35 #include <stdlib.h> /* size_t */
36 #include <stdarg.h> /* va_list */
37 #include <stddef.h> /* ptrdiff_t */
38 
39 #if HAVE_SYS_TYPES_H
40 #include <sys/types.h>
41 #endif
42 
43 #if HAVE_STDINT_H
44 #include <stdint.h> /* uintptr_t, maybe */
45 #endif
46 
47 #if HAVE_INTTYPES_H
48 #include <inttypes.h> /* uintptr_t, maybe */
49 #endif
50 
51 #include <fftw3.h>
52 
53 #include "ticks.h"
54 
55 /* Determine precision and name-mangling scheme. */
56 #define CONCAT(prefix, name) prefix ## name
57 #if defined(NFFT_SINGLE)
58 typedef float R;
59 typedef float _Complex C;
60 #define Y(name) CONCAT(nfftf_,name)
61 #define Z(name) CONCAT(fftwf_,name)
62 #define NFSFT(name) CONCAT(nfsftf_,name)
63 #elif defined(NFFT_LDOUBLE)
64 typedef long double R;
65 typedef long double _Complex C;
66 #define Y(name) CONCAT(nfftl_,name)
67 #define Z(name) CONCAT(fftwl_,name)
68 #define NFSFT(name) CONCAT(nfsftl_,name)
69 #else
70 typedef double R;
71 typedef double _Complex C;
72 #define Y(name) CONCAT(nfft_,name)
73 #define Z(name) CONCAT(fftw_,name)
74 #define NFSFT(name) CONCAT(nfsft_,name)
75 #endif
76 #define X(name) Y(name)
77 
78 #define STRINGIZEx(x) #x
79 #define STRINGIZE(x) STRINGIZEx(x)
80 
81 #ifdef NFFT_LDOUBLE
82 # define K(x) ((R) x##L)
83 #else
84 # define K(x) ((R) x)
85 #endif
86 #define DK(name, value) const R name = K(value)
87 
88 /* Integral type large enough to contain a stride (what ``int'' should have been
89  * in the first place) */
90 typedef ptrdiff_t INT;
91 
92 #define KPI K(3.1415926535897932384626433832795028841971693993751)
93 #define K2PI K(6.2831853071795864769252867665590057683943387987502)
94 #define KE K(2.7182818284590452353602874713526624977572470937000)
95 
96 #define IF(x,a,b) ((x)?(a):(b))
97 #define MIN(a,b) (((a)<(b))?(a):(b))
98 #define MAX(a,b) (((a)>(b))?(a):(b))
99 #define ABS(x) (((x)>K(0.0))?(x):(-(x)))
100 #define SIGN(a) (((a)>=0)?1:-1)
101 #define SIGN(a) (((a)>=0)?1:-1)
102 #define SIGNF(a) IF((a)<K(0.0),K(-1.0),K(1.0))
103 
104 /* macros for window functions */
105 
106 #if defined(DIRAC_DELTA)
107  #define PHI_HUT(k,d) K(1.0)
108  #define PHI(x,d) IF(FABS((x)) < K(10E-8),K(1.0),K(0.0))
109  #define WINDOW_HELP_INIT(d)
110  #define WINDOW_HELP_FINALIZE
111  #define WINDOW_HELP_ESTIMATE_m 0
112 #elif defined(GAUSSIAN)
113  #define PHI_HUT(k,d) ((R)EXP(-(POW(KPI*(k)/ths->n[d],K(2.0))*ths->b[d])))
114  #define PHI(x,d) ((R)EXP(-POW((x)*((R)ths->n[d]),K(2.0)) / \
115  ths->b[d])/SQRT(KPI*ths->b[d]))
116  #define WINDOW_HELP_INIT \
117  { \
118  int WINDOW_idx; \
119  ths->b = (R*) Y(malloc)(ths->d*sizeof(R)); \
120  for (WINDOW_idx = 0; WINDOW_idx < ths->d; WINDOW_idx++) \
121  ths->b[WINDOW_idx]=(K(2.0)*ths->sigma[WINDOW_idx]) / \
122  (K(2.0)*ths->sigma[WINDOW_idx] - K(1.0)) * (((R)ths->m) / KPI); \
123  }
124  #define WINDOW_HELP_FINALIZE {Y(free)(ths->b);}
125  #define WINDOW_HELP_ESTIMATE_m 12
126 #elif defined(B_SPLINE)
127  #define PHI_HUT(k,d) ((R)(((k) == 0) ? K(1.0) / ths->n[(d)] : \
128  POW(SIN((k) * KPI / ths->n[(d)]) / ((k) * KPI / ths->n[(d)]), \
129  K(2.0) * ths->m)/ths->n[(d)]))
130  #define PHI(x,d) (Y(bspline)(2*ths->m,((x)*ths->n[(d)]) + \
131  (R)ths->m,ths->spline_coeffs) / ths->n[(d)])
132  #define WINDOW_HELP_INIT \
133  { \
134  ths->spline_coeffs= (R*)Y(malloc)(2*ths->m*sizeof(R)); \
135  }
136  #define WINDOW_HELP_FINALIZE {Y(free)(ths->spline_coeffs);}
137  #define WINDOW_HELP_ESTIMATE_m 11
138 #elif defined(SINC_POWER)
139  #define PHI_HUT(k,d) (Y(bspline)(2 * ths->m, (K(2.0) * ths->m*(k)) / \
140  ((K(2.0) * ths->sigma[(d)] - 1) * ths->n[(d)] / \
141  ths->sigma[(d)]) + (R)ths->m, ths->spline_coeffs))
142  #define PHI(x,d) ((R)(ths->n[(d)] / ths->sigma[(d)] * \
143  (K(2.0) * ths->sigma[(d)] - K(1.0))/ (K(2.0)*ths->m) * \
144  POW(Y(sinc)(KPI * ths->n[(d)] / ths->sigma[(d)] * (x) * \
145  (K(2.0) * ths->sigma[(d)] - K(1.0)) / (K(2.0)*ths->m)) , 2*ths->m) / \
146  ths->n[(d)]))
147  #define WINDOW_HELP_INIT \
148  { \
149  ths->spline_coeffs= (R*)Y(malloc)(2 * ths->m * sizeof(R)); \
150  }
151  #define WINDOW_HELP_FINALIZE {Y(free)(ths->spline_coeffs);}
152  #define WINDOW_HELP_ESTIMATE_m 9
153 #else /* Kaiser-Bessel is the default. */
154  #define PHI_HUT(k,d) ((R)Y(bessel_i0)(ths->m * SQRT(\
155  POW((R)(ths->b[d]), K(2.0)) - POW(K(2.0) * KPI * (k) / ths->n[d], K(2.0)))))
156  #define PHI(x,d) ((R)((POW((R)(ths->m), K(2.0))\
157  -POW((x)*ths->n[d],K(2.0))) > 0)? \
158  SINH(ths->b[d] * SQRT(POW((R)(ths->m),K(2.0)) - \
159  POW((x)*ths->n[d],K(2.0))))/(KPI*SQRT(POW((R)(ths->m),K(2.0)) - \
160  POW((x)*ths->n[d],K(2.0)))) : (((POW((R)(ths->m),K(2.0)) - \
161  POW((x)*ths->n[d],K(2.0))) < 0)? SIN(ths->b[d] * \
162  SQRT(POW(ths->n[d]*(x),K(2.0)) - POW((R)(ths->m), K(2.0)))) / \
163  (KPI*SQRT(POW(ths->n[d]*(x),K(2.0)) - POW((R)(ths->m),K(2.0)))):K(1.0)))
164  #define WINDOW_HELP_INIT \
165  { \
166  int WINDOW_idx; \
167  ths->b = (R*) Y(malloc)(ths->d*sizeof(R)); \
168  for (WINDOW_idx = 0; WINDOW_idx < ths->d; WINDOW_idx++) \
169  ths->b[WINDOW_idx] = ((R)KPI*(K(2.0)-K(1.0) / ths->sigma[WINDOW_idx])); \
170  }
171  #define WINDOW_HELP_FINALIZE {Y(free)(ths->b);}
172  #define WINDOW_HELP_ESTIMATE_m 6
173 #endif
174 
175 #if defined(NFFT_LDOUBLE)
176 #if HAVE_DECL_COPYSIGNL == 0
177 extern long double copysignl(long double, long double);
178 #endif
179 #if HAVE_DECL_NEXTAFTERL == 0
180 extern long double nextafterl(long double, long double);
181 #endif
182 #if HAVE_DECL_NANL == 0
183 extern long double nanl(const char *tag);
184 #endif
185 #if HAVE_DECL_CEILL == 0
186 extern long double ceill(long double);
187 #endif
188 #if HAVE_DECL_FLOORL == 0
189 extern long double floorl(long double);
190 #endif
191 #if HAVE_DECL_NEARBYINTL == 0
192 extern long double nearbyintl(long double);
193 #endif
194 #if HAVE_DECL_RINTL == 0
195 extern long double rintl(long double);
196 #endif
197 #if HAVE_DECL_ROUNDL == 0
198 extern long double roundl(long double);
199 #endif
200 #if HAVE_DECL_LRINTL == 0
201 extern long int lrintl(long double);
202 #endif
203 #if HAVE_DECL_LROUNDL == 0
204 extern long int lroundl(long double);
205 #endif
206 #if HAVE_DECL_LLRINTL == 0
207 extern long long int llrintl(long double);
208 #endif
209 #if HAVE_DECL_LLROUNDL == 0
210 extern long long int llroundl(long double);
211 #endif
212 #if HAVE_DECL_TRUNCL == 0
213 extern long double truncl(long double);
214 #endif
215 #if HAVE_DECL_FMODL == 0
216 extern long double fmodl(long double, long double);
217 #endif
218 #if HAVE_DECL_REMAINDERL == 0
219 extern long double remainderl(long double, long double);
220 #endif
221 #if HAVE_DECL_REMQUOL == 0
222 extern long double remquol(long double x, long double y, int *);
223 #endif
224 #if HAVE_DECL_FDIML == 0
225 extern long double fdiml(long double, long double);
226 #endif
227 #if HAVE_DECL_FMAXL == 0
228 extern long double fmaxl(long double, long double);
229 #endif
230 #if HAVE_DECL_FMINL == 0
231 extern long double fminl(long double, long double);
232 #endif
233 #if HAVE_DECL_FMAL == 0
234 extern long double fmal(long double x, long double y, long double z);
235 #endif
236 #if HAVE_DECL_FABSL == 0
237 extern long double fabsl(long double);
238 #endif
239 #if HAVE_DECL_SQRTL == 0
240 extern long double sqrtl(long double);
241 #endif
242 #if HAVE_DECL_CBRTL == 0
243 extern long double cbrtl(long double);
244 #endif
245 #if HAVE_DECL_HYPOTL == 0
246 extern long double hypotl(long double, long double);
247 #endif
248 #if HAVE_DECL_EXPL == 0
249 extern long double expl(long double);
250 #endif
251 #if HAVE_DECL_EXP2L == 0
252 extern long double exp2l(long double);
253 #endif
254 #if HAVE_DECL_EXPM1L == 0
255 extern long double expm1l(long double);
256 #endif
257 #if HAVE_DECL_LOGL == 0
258 extern long double logl(long double);
259 #endif
260 #if HAVE_DECL_LOG2L == 0
261 extern long double log2l(long double);
262 #endif
263 #if HAVE_DECL_LOG10L == 0
264 extern long double log10l(long double);
265 #endif
266 #if HAVE_DECL_LOG1PL == 0
267 extern long double log1pl(long double);
268 #endif
269 #if HAVE_DECL_LOGBL == 0
270 extern long double logbl(long double);
271 #endif
272 #if HAVE_DECL_ILOGBL == 0
273 extern int ilogbl(long double);
274 #endif
275 #if HAVE_DECL_MODFL == 0
276 extern long double modfl(long double, long double *);
277 #endif
278 #if HAVE_DECL_FREXPL == 0
279 extern long double frexpl(long double, int *);
280 #endif
281 #if HAVE_DECL_LDEXPL == 0
282 extern long double ldexpl(long double, int);
283 #endif
284 #if HAVE_DECL_SCALBNL == 0
285 extern long double scalbnl(long double, int);
286 #endif
287 #if HAVE_DECL_SCALBLNL == 0
288 extern long double scalblnl(long double, long int);
289 #endif
290 #if HAVE_DECL_POWL == 0
291 extern long double powl(long double, long double);
292 #endif
293 #if HAVE_DECL_COSL == 0
294 extern long double cosl(long double);
295 #endif
296 #if HAVE_DECL_SINL == 0
297 extern long double sinl(long double);
298 #endif
299 #if HAVE_DECL_TANL == 0
300 extern long double tanl(long double);
301 #endif
302 #if HAVE_DECL_COSHL == 0
303 extern long double coshl(long double);
304 #endif
305 #if HAVE_DECL_SINHL == 0
306 extern long double sinhl(long double);
307 #endif
308 #if HAVE_DECL_TANHL == 0
309 extern long double tanhl(long double);
310 #endif
311 #if HAVE_DECL_ACOSL == 0
312 extern long double acosl(long double);
313 #endif
314 #if HAVE_DECL_ASINL == 0
315 extern long double asinl(long double);
316 #endif
317 #if HAVE_DECL_ATANL == 0
318 extern long double atanl(long double);
319 #endif
320 #if HAVE_DECL_ATAN2L == 0
321 extern long double atan2l(long double, long double);
322 #endif
323 #if HAVE_DECL_ACOSHL == 0
324 extern long double acoshl(long double);
325 #endif
326 #if HAVE_DECL_ASINHL == 0
327 extern long double asinhl(long double);
328 #endif
329 #if HAVE_DECL_ATANHL == 0
330 extern long double atanhl(long double);
331 #endif
332 #if HAVE_DECL_TGAMMAL == 0
333 extern long double tgammal(long double);
334 #endif
335 #if HAVE_DECL_LGAMMAL == 0
336 extern long double lgammal(long double);
337 #endif
338 #if HAVE_DECL_J0L == 0
339 extern long double j0l(long double);
340 #endif
341 #if HAVE_DECL_J1L == 0
342 extern long double j1l(long double);
343 #endif
344 #if HAVE_DECL_JNL == 0
345 extern long double jnl(int, long double);
346 #endif
347 #if HAVE_DECL_Y0L == 0
348 extern long double y0l(long double);
349 #endif
350 #if HAVE_DECL_Y1L == 0
351 extern long double y1l(long double);
352 #endif
353 #if HAVE_DECL_YNL == 0
354 extern long double ynl(int, long double);
355 #endif
356 #if HAVE_DECL_ERFL == 0
357 extern long double erfl(long double);
358 #endif
359 #if HAVE_DECL_ERFCL == 0
360 extern long double erfcl(long double);
361 #endif
362 #if HAVE_DECL_CREALL == 0
363 extern long double creall(long double _Complex z);
364 #endif
365 #if HAVE_DECL_CIMAGL == 0
366 extern long double cimagl(long double _Complex z);
367 #endif
368 #if HAVE_DECL_CABSL == 0
369 extern long double cabsl(long double _Complex z);
370 #endif
371 #if HAVE_DECL_CARGL == 0
372 extern long double cargl(long double _Complex z);
373 #endif
374 #if HAVE_DECL_CONJL == 0
375 extern long double _Complex conjl(long double _Complex z);
376 #endif
377 #if HAVE_DECL_CPROJL == 0
378 extern long double _Complex cprojl(long double _Complex z);
379 #endif
380 #if HAVE_DECL_CSQRTL == 0
381 extern long double _Complex csqrtl(long double _Complex z);
382 #endif
383 #if HAVE_DECL_CEXPL == 0
384 extern long double _Complex cexpl(long double _Complex z);
385 #endif
386 #if HAVE_DECL_CLOGL == 0
387 extern long double _Complex clogl(long double _Complex z);
388 #endif
389 #if HAVE_DECL_CPOWL == 0
390 extern long double _Complex cpowl(long double _Complex z, long double _Complex w);
391 #endif
392 #if HAVE_DECL_CSINL == 0
393 extern long double _Complex csinl(long double _Complex z);
394 #endif
395 #if HAVE_DECL_CCOSL == 0
396 extern long double _Complex ccosl(long double _Complex z);
397 #endif
398 #if HAVE_DECL_CTANL == 0
399 extern long double _Complex ctanl(long double _Complex z);
400 #endif
401 #if HAVE_DECL_CASINL == 0
402 extern long double _Complex casinl(long double _Complex z);
403 #endif
404 #if HAVE_DECL_CACOSL == 0
405 extern long double _Complex cacosl(long double _Complex z);
406 #endif
407 #if HAVE_DECL_CATANL == 0
408 extern long double _Complex catanl(long double _Complex z);
409 #endif
410 #if HAVE_DECL_CSINHL == 0
411 extern long double _Complex csinhl(long double _Complex z);
412 #endif
413 #if HAVE_DECL_CCOSHL == 0
414 extern long double _Complex ccoshl(long double _Complex z);
415 #endif
416 #if HAVE_DECL_CTANHL == 0
417 extern long double _Complex ctanhl(long double _Complex z);
418 #endif
419 #if HAVE_DECL_CASINHL == 0
420 extern long double _Complex casinhl(long double _Complex z);
421 #endif
422 #if HAVE_DECL_CACOSHL == 0
423 extern long double _Complex cacoshl(long double _Complex z);
424 #endif
425 #if HAVE_DECL_CATANHL == 0
426 extern long double _Complex catanhl(long double _Complex z);
427 #endif
428 #define COPYSIGN copysignl
429 #define NEXTAFTER nextafterl
430 #define MKNAN nanl
431 #define CEIL ceill
432 #define FLOOR floorl
433 #define NEARBYINT nearbyintl
434 #define RINT rintl
435 #define ROUND roundl
436 #define LRINT lrintl
437 #define LROUND lroundl
438 #define LLRINT llrintl
439 #define LLROUND llroundl
440 #define TRUNC truncl
441 #define FMOD fmodl
442 #define REMAINDER remainderl
443 #define REMQUO remquol
444 #define FDIM fdiml
445 #define FMAX fmaxl
446 #define FMIN fminl
447 #define FFMA fmal
448 #define FABS fabsl
449 #define SQRT sqrtl
450 #define CBRT cbrtl
451 #define HYPOT hypotl
452 #define EXP expl
453 #define EXP2 exp2l
454 #define EXPM1 expm1l
455 #define LOG logl
456 #define LOG2 log2l
457 #define LOG10 log10l
458 #define LOG1P log1pl
459 #define LOGB logbl
460 #define ILOGB ilogbl
461 #define MODF modfl
462 #define FREXP frexpl
463 #define LDEXP ldexpl
464 #define SCALBN scalbnl
465 #define SCALBLN scalblnl
466 #define POW powl
467 #define COS cosl
468 #define SIN sinl
469 #define TAN tanl
470 #define COSH coshl
471 #define SINH sinhl
472 #define TANH tanhl
473 #define ACOS acosl
474 #define ASIN asinl
475 #define ATAN atanl
476 #define ATAN2 atan2l
477 #define ACOSH acoshl
478 #define ASINH asinhl
479 #define ATANH atanhl
480 #define TGAMMA tgammal
481 #define LGAMMA lgammal
482 #define J0 j0l
483 #define J1 j1l
484 #define JN jnl
485 #define Y0 y0l
486 #define Y1 y1l
487 #define YN ynl
488 #define ERF erfl
489 #define ERFC erfcl
490 #define CREAL creall
491 #define CIMAG cimagl
492 #define CABS cabsl
493 #define CARG cargl
494 #define CONJ conjl
495 #define CPROJ cprojl
496 #define CSQRT csqrtl
497 #define CEXP cexpl
498 #define CLOG clogl
499 #define CPOW cpowl
500 #define CSIN csinl
501 #define CCOS ccosl
502 #define CTAN ctanl
503 #define CASIN casinl
504 #define CACOS cacosl
505 #define CATAN catanl
506 #define CSINH csinhl
507 #define CCOSH ccoshl
508 #define CTANH ctanhl
509 #define CASINH casinhl
510 #define CACOSH cacoshl
511 #define CATANH catanhl
512 #elif defined(NFFT_SINGLE)
513 #if HAVE_DECL_COPYSIGNF == 0
514 extern float copysignf(float, float);
515 #endif
516 #if HAVE_DECL_NEXTAFTERF == 0
517 extern float nextafterf(float, float);
518 #endif
519 #if HAVE_DECL_NANF == 0
520 extern float nanf(const char *tag);
521 #endif
522 #if HAVE_DECL_CEILF == 0
523 extern float ceilf(float);
524 #endif
525 #if HAVE_DECL_FLOORF == 0
526 extern float floorf(float);
527 #endif
528 #if HAVE_DECL_NEARBYINTF == 0
529 extern float nearbyintf(float);
530 #endif
531 #if HAVE_DECL_RINTF == 0
532 extern float rintf(float);
533 #endif
534 #if HAVE_DECL_ROUNDF == 0
535 extern float roundf(float);
536 #endif
537 #if HAVE_DECL_LRINTF == 0
538 extern long int lrintf(float);
539 #endif
540 #if HAVE_DECL_LROUNDF == 0
541 extern long int lroundf(float);
542 #endif
543 #if HAVE_DECL_LLRINTF == 0
544 extern long long int llrintf(float);
545 #endif
546 #if HAVE_DECL_LLROUNDF == 0
547 extern long long int llroundf(float);
548 #endif
549 #if HAVE_DECL_TRUNCF == 0
550 extern float truncf(float);
551 #endif
552 #if HAVE_DECL_FMODF == 0
553 extern float fmodf(float, float);
554 #endif
555 #if HAVE_DECL_REMAINDERF == 0
556 extern float remainderf(float, float);
557 #endif
558 #if HAVE_DECL_REMQUOF == 0
559 extern float remquof(float x, float y, int *);
560 #endif
561 #if HAVE_DECL_FDIMF == 0
562 extern float fdimf(float, float);
563 #endif
564 #if HAVE_DECL_FMAXF == 0
565 extern float fmaxf(float, float);
566 #endif
567 #if HAVE_DECL_FMINF == 0
568 extern float fminf(float, float);
569 #endif
570 #if HAVE_DECL_FMAF == 0
571 extern float fmaf(float x, float y, float z);
572 #endif
573 #if HAVE_DECL_FABSF == 0
574 extern float fabsf(float);
575 #endif
576 #if HAVE_DECL_SQRTF == 0
577 extern float sqrtf(float);
578 #endif
579 #if HAVE_DECL_CBRTF == 0
580 extern float cbrtf(float);
581 #endif
582 #if HAVE_DECL_HYPOTF == 0
583 extern float hypotf(float, float);
584 #endif
585 #if HAVE_DECL_EXPF == 0
586 extern float expf(float);
587 #endif
588 #if HAVE_DECL_EXP2F == 0
589 extern float exp2f(float);
590 #endif
591 #if HAVE_DECL_EXPM1F == 0
592 extern float expm1f(float);
593 #endif
594 #if HAVE_DECL_LOGF == 0
595 extern float logf(float);
596 #endif
597 #if HAVE_DECL_LOG2F == 0
598 extern float log2f(float);
599 #endif
600 #if HAVE_DECL_LOG10F == 0
601 extern float log10f(float);
602 #endif
603 #if HAVE_DECL_LOG1PF == 0
604 extern float log1pf(float);
605 #endif
606 #if HAVE_DECL_LOGBF == 0
607 extern float logbf(float);
608 #endif
609 #if HAVE_DECL_ILOGBF == 0
610 extern int ilogbf(float);
611 #endif
612 #if HAVE_DECL_MODFF == 0
613 extern float modff(float, float *);
614 #endif
615 #if HAVE_DECL_FREXPF == 0
616 extern float frexpf(float, int *);
617 #endif
618 #if HAVE_DECL_LDEXPF == 0
619 extern float ldexpf(float, int);
620 #endif
621 #if HAVE_DECL_SCALBNF == 0
622 extern float scalbnf(float, int);
623 #endif
624 #if HAVE_DECL_SCALBLNF == 0
625 extern float scalblnf(float, long int);
626 #endif
627 #if HAVE_DECL_POWF == 0
628 extern float powf(float, float);
629 #endif
630 #if HAVE_DECL_COSF == 0
631 extern float cosf(float);
632 #endif
633 #if HAVE_DECL_SINF == 0
634 extern float sinf(float);
635 #endif
636 #if HAVE_DECL_TANF == 0
637 extern float tanf(float);
638 #endif
639 #if HAVE_DECL_COSHF == 0
640 extern float coshf(float);
641 #endif
642 #if HAVE_DECL_SINHF == 0
643 extern float sinhf(float);
644 #endif
645 #if HAVE_DECL_TANHF == 0
646 extern float tanhf(float);
647 #endif
648 #if HAVE_DECL_ACOSF == 0
649 extern float acosf(float);
650 #endif
651 #if HAVE_DECL_ASINF == 0
652 extern float asinf(float);
653 #endif
654 #if HAVE_DECL_ATANF == 0
655 extern float atanf(float);
656 #endif
657 #if HAVE_DECL_ATAN2F == 0
658 extern float atan2f(float, float);
659 #endif
660 #if HAVE_DECL_ACOSHF == 0
661 extern float acoshf(float);
662 #endif
663 #if HAVE_DECL_ASINHF == 0
664 extern float asinhf(float);
665 #endif
666 #if HAVE_DECL_ATANHF == 0
667 extern float atanhf(float);
668 #endif
669 #if HAVE_DECL_TGAMMAF == 0
670 extern float tgammaf(float);
671 #endif
672 #if HAVE_DECL_LGAMMAF == 0
673 extern float lgammaf(float);
674 #endif
675 #if HAVE_DECL_J0F == 0
676 extern float j0f(float);
677 #endif
678 #if HAVE_DECL_J1F == 0
679 extern float j1f(float);
680 #endif
681 #if HAVE_DECL_JNF == 0
682 extern float jnf(int, float);
683 #endif
684 #if HAVE_DECL_Y0F == 0
685 extern float y0f(float);
686 #endif
687 #if HAVE_DECL_Y1F == 0
688 extern float y1f(float);
689 #endif
690 #if HAVE_DECL_YNF == 0
691 extern float ynf(int, float);
692 #endif
693 #if HAVE_DECL_ERFF == 0
694 extern float erff(float);
695 #endif
696 #if HAVE_DECL_ERFCF == 0
697 extern float erfcf(float);
698 #endif
699 #if HAVE_DECL_CREALF == 0
700 extern float crealf(float _Complex z);
701 #endif
702 #if HAVE_DECL_CIMAGF == 0
703 extern float cimagf(float _Complex z);
704 #endif
705 #if HAVE_DECL_CABSF == 0
706 extern float cabsf(float _Complex z);
707 #endif
708 #if HAVE_DECL_CARGF == 0
709 extern float cargf(float _Complex z);
710 #endif
711 #if HAVE_DECL_CONJF == 0
712 extern float _Complex conjf(float _Complex z);
713 #endif
714 #if HAVE_DECL_CPROJF == 0
715 extern float _Complex cprojf(float _Complex z);
716 #endif
717 #if HAVE_DECL_CSQRTF == 0
718 extern float _Complex csqrtf(float _Complex z);
719 #endif
720 #if HAVE_DECL_CEXPF == 0
721 extern float _Complex cexpf(float _Complex z);
722 #endif
723 #if HAVE_DECL_CLOGF == 0
724 extern float _Complex clogf(float _Complex z);
725 #endif
726 #if HAVE_DECL_CPOWF == 0
727 extern float _Complex cpowf(float _Complex z, float _Complex w);
728 #endif
729 #if HAVE_DECL_CSINF == 0
730 extern float _Complex csinf(float _Complex z);
731 #endif
732 #if HAVE_DECL_CCOSF == 0
733 extern float _Complex ccosf(float _Complex z);
734 #endif
735 #if HAVE_DECL_CTANF == 0
736 extern float _Complex ctanf(float _Complex z);
737 #endif
738 #if HAVE_DECL_CASINF == 0
739 extern float _Complex casinf(float _Complex z);
740 #endif
741 #if HAVE_DECL_CACOSF == 0
742 extern float _Complex cacosf(float _Complex z);
743 #endif
744 #if HAVE_DECL_CATANF == 0
745 extern float _Complex catanf(float _Complex z);
746 #endif
747 #if HAVE_DECL_CSINHF == 0
748 extern float _Complex csinhf(float _Complex z);
749 #endif
750 #if HAVE_DECL_CCOSHF == 0
751 extern float _Complex ccoshf(float _Complex z);
752 #endif
753 #if HAVE_DECL_CTANHF == 0
754 extern float _Complex ctanhf(float _Complex z);
755 #endif
756 #if HAVE_DECL_CASINHF == 0
757 extern float _Complex casinhf(float _Complex z);
758 #endif
759 #if HAVE_DECL_CACOSHF == 0
760 extern float _Complex cacoshf(float _Complex z);
761 #endif
762 #if HAVE_DECL_CATANHF == 0
763 extern float _Complex catanhf(float _Complex z);
764 #endif
765 #define COPYSIGN copysignf
766 #define NEXTAFTER nextafterf
767 #define MKNAN nanf
768 #define CEIL ceilf
769 #define FLOOR floorf
770 #define NEARBYINT nearbyintf
771 #define RINT rintf
772 #define ROUND roundf
773 #define LRINT lrintf
774 #define LROUND lroundf
775 #define LLRINT llrintf
776 #define LLROUND llroundf
777 #define TRUNC truncf
778 #define FMOD fmodf
779 #define REMAINDER remainderf
780 #define REMQUO remquof
781 #define FDIM fdimf
782 #define FMAX fmaxf
783 #define FMIN fminf
784 #define FFMA fmaf
785 #define FABS fabsf
786 #define SQRT sqrtf
787 #define CBRT cbrtf
788 #define HYPOT hypotf
789 #define EXP expf
790 #define EXP2 exp2f
791 #define EXPM1 expm1f
792 #define LOG logf
793 #define LOG2 log2f
794 #define LOG10 log10f
795 #define LOG1P log1pf
796 #define LOGB logbf
797 #define ILOGB ilogbf
798 #define MODF modff
799 #define FREXP frexpf
800 #define LDEXP ldexpf
801 #define SCALBN scalbnf
802 #define SCALBLN scalblnf
803 #define POW powf
804 #define COS cosf
805 #define SIN sinf
806 #define TAN tanf
807 #define COSH coshf
808 #define SINH sinhf
809 #define TANH tanhf
810 #define ACOS acosf
811 #define ASIN asinf
812 #define ATAN atanf
813 #define ATAN2 atan2f
814 #define ACOSH acoshf
815 #define ASINH asinhf
816 #define ATANH atanhf
817 #define TGAMMA tgammaf
818 #define LGAMMA lgammaf
819 #define J0 j0f
820 #define J1 j1f
821 #define JN jnf
822 #define Y0 y0f
823 #define Y1 y1f
824 #define YN ynf
825 #define ERF erff
826 #define ERFC erfcf
827 #define CREAL crealf
828 #define CIMAG cimagf
829 #define CABS cabsf
830 #define CARG cargf
831 #define CONJ conjf
832 #define CPROJ cprojf
833 #define CSQRT csqrtf
834 #define CEXP cexpf
835 #define CLOG clogf
836 #define CPOW cpowf
837 #define CSIN csinf
838 #define CCOS ccosf
839 #define CTAN ctanf
840 #define CASIN casinf
841 #define CACOS cacosf
842 #define CATAN catanf
843 #define CSINH csinhf
844 #define CCOSH ccoshf
845 #define CTANH ctanhf
846 #define CASINH casinhf
847 #define CACOSH cacoshf
848 #define CATANH catanhf
849 #else
850 #if HAVE_DECL_COPYSIGN == 0
851 extern double copysign(double, double);
852 #endif
853 #if HAVE_DECL_NEXTAFTER == 0
854 extern double nextafter(double, double);
855 #endif
856 #if HAVE_DECL_NAN == 0
857 extern double nan(const char *tag);
858 #endif
859 #if HAVE_DECL_CEIL == 0
860 extern double ceil(double);
861 #endif
862 #if HAVE_DECL_FLOOR == 0
863 extern double floor(double);
864 #endif
865 #if HAVE_DECL_NEARBYINT == 0
866 extern double nearbyint(double);
867 #endif
868 #if HAVE_DECL_RINT == 0
869 extern double rint(double);
870 #endif
871 #if HAVE_DECL_ROUND == 0
872 extern double round(double);
873 #endif
874 #if HAVE_DECL_LRINT == 0
875 extern long int lrint(double);
876 #endif
877 #if HAVE_DECL_LROUND == 0
878 extern long int lround(double);
879 #endif
880 #if HAVE_DECL_LLRINT == 0
881 extern long long int llrint(double);
882 #endif
883 #if HAVE_DECL_LLROUND == 0
884 extern long long int llround(double);
885 #endif
886 #if HAVE_DECL_TRUNC == 0
887 extern double trunc(double);
888 #endif
889 #if HAVE_DECL_FMOD == 0
890 extern double fmod(double, double);
891 #endif
892 #if HAVE_DECL_REMAINDER == 0
893 extern double remainder(double, double);
894 #endif
895 #if HAVE_DECL_REMQUO == 0
896 extern double remquo(double x, double y, int *);
897 #endif
898 #if HAVE_DECL_FDIM == 0
899 extern double fdim(double, double);
900 #endif
901 #if HAVE_DECL_FMAX == 0
902 extern double fmax(double, double);
903 #endif
904 #if HAVE_DECL_FMIN == 0
905 extern double fmin(double, double);
906 #endif
907 #if HAVE_DECL_FMA == 0
908 extern double fma(double x, double y, double z);
909 #endif
910 #if HAVE_DECL_FABS == 0
911 extern double fabs(double);
912 #endif
913 #if HAVE_DECL_SQRT == 0
914 extern double sqrt(double);
915 #endif
916 #if HAVE_DECL_CBRT == 0
917 extern double cbrt(double);
918 #endif
919 #if HAVE_DECL_HYPOT == 0
920 extern double hypot(double, double);
921 #endif
922 #if HAVE_DECL_EXP == 0
923 extern double exp(double);
924 #endif
925 #if HAVE_DECL_EXP2 == 0
926 extern double exp2(double);
927 #endif
928 #if HAVE_DECL_EXPM1 == 0
929 extern double expm1(double);
930 #endif
931 #if HAVE_DECL_LOG == 0
932 extern double log(double);
933 #endif
934 #if HAVE_DECL_LOG2 == 0
935 extern double log2(double);
936 #endif
937 #if HAVE_DECL_LOG10 == 0
938 extern double log10(double);
939 #endif
940 #if HAVE_DECL_LOG1P == 0
941 extern double log1p(double);
942 #endif
943 #if HAVE_DECL_LOGB == 0
944 extern double logb(double);
945 #endif
946 #if HAVE_DECL_ILOGB == 0
947 extern int ilogb(double);
948 #endif
949 #if HAVE_DECL_MODF == 0
950 extern double modf(double, double *);
951 #endif
952 #if HAVE_DECL_FREXP == 0
953 extern double frexp(double, int *);
954 #endif
955 #if HAVE_DECL_LDEXP == 0
956 extern double ldexp(double, int);
957 #endif
958 #if HAVE_DECL_SCALBN == 0
959 extern double scalbn(double, int);
960 #endif
961 #if HAVE_DECL_SCALBLN == 0
962 extern double scalbln(double, long int);
963 #endif
964 #if HAVE_DECL_POW == 0
965 extern double pow(double, double);
966 #endif
967 #if HAVE_DECL_COS == 0
968 extern double cos(double);
969 #endif
970 #if HAVE_DECL_SIN == 0
971 extern double sin(double);
972 #endif
973 #if HAVE_DECL_TAN == 0
974 extern double tan(double);
975 #endif
976 #if HAVE_DECL_COSH == 0
977 extern double cosh(double);
978 #endif
979 #if HAVE_DECL_SINH == 0
980 extern double sinh(double);
981 #endif
982 #if HAVE_DECL_TANH == 0
983 extern double tanh(double);
984 #endif
985 #if HAVE_DECL_ACOS == 0
986 extern double acos(double);
987 #endif
988 #if HAVE_DECL_ASIN == 0
989 extern double asin(double);
990 #endif
991 #if HAVE_DECL_ATAN == 0
992 extern double atan(double);
993 #endif
994 #if HAVE_DECL_ATAN2 == 0
995 extern double atan2(double, double);
996 #endif
997 #if HAVE_DECL_ACOSH == 0
998 extern double acosh(double);
999 #endif
1000 #if HAVE_DECL_ASINH == 0
1001 extern double asinh(double);
1002 #endif
1003 #if HAVE_DECL_ATANH == 0
1004 extern double atanh(double);
1005 #endif
1006 #if HAVE_DECL_TGAMMA == 0
1007 extern double tgamma(double);
1008 #endif
1009 #if HAVE_DECL_LGAMMA == 0
1010 extern double lgamma(double);
1011 #endif
1012 #if HAVE_DECL_J0 == 0
1013 extern double j0(double);
1014 #endif
1015 #if HAVE_DECL_J1 == 0
1016 extern double j1(double);
1017 #endif
1018 #if HAVE_DECL_JN == 0
1019 extern double jn(int, double);
1020 #endif
1021 #if HAVE_DECL_Y0 == 0
1022 extern double y0(double);
1023 #endif
1024 #if HAVE_DECL_Y1 == 0
1025 extern double y1(double);
1026 #endif
1027 #if HAVE_DECL_YN == 0
1028 extern double yn(int, double);
1029 #endif
1030 #if HAVE_DECL_ERF == 0
1031 extern double erf(double);
1032 #endif
1033 #if HAVE_DECL_ERFC == 0
1034 extern double erfc(double);
1035 #endif
1036 #if HAVE_DECL_CREAL == 0
1037 extern double creal(double _Complex z);
1038 #endif
1039 #if HAVE_DECL_CIMAG == 0
1040 extern double cimag(double _Complex z);
1041 #endif
1042 #if HAVE_DECL_CABS == 0
1043 extern double cabs(double _Complex z);
1044 #endif
1045 #if HAVE_DECL_CARG == 0
1046 extern double carg(double _Complex z);
1047 #endif
1048 #if HAVE_DECL_CONJ == 0
1049 extern double _Complex conj(double _Complex z);
1050 #endif
1051 #if HAVE_DECL_CPROJ == 0
1052 extern double _Complex cproj(double _Complex z);
1053 #endif
1054 #if HAVE_DECL_CSQRT == 0
1055 extern double _Complex csqrt(double _Complex z);
1056 #endif
1057 #if HAVE_DECL_CEXP == 0
1058 extern double _Complex cexp(double _Complex z);
1059 #endif
1060 #if HAVE_DECL_CLOG == 0
1061 extern double _Complex clog(double _Complex z);
1062 #endif
1063 #if HAVE_DECL_CPOW == 0
1064 extern double _Complex cpow(double _Complex z, double _Complex w);
1065 #endif
1066 #if HAVE_DECL_CSIN == 0
1067 extern double _Complex csin(double _Complex z);
1068 #endif
1069 #if HAVE_DECL_CCOS == 0
1070 extern double _Complex ccos(double _Complex z);
1071 #endif
1072 #if HAVE_DECL_CTAN == 0
1073 extern double _Complex ctan(double _Complex z);
1074 #endif
1075 #if HAVE_DECL_CASIN == 0
1076 extern double _Complex casin(double _Complex z);
1077 #endif
1078 #if HAVE_DECL_CACOS == 0
1079 extern double _Complex cacos(double _Complex z);
1080 #endif
1081 #if HAVE_DECL_CATAN == 0
1082 extern double _Complex catan(double _Complex z);
1083 #endif
1084 #if HAVE_DECL_CSINH == 0
1085 extern double _Complex csinh(double _Complex z);
1086 #endif
1087 #if HAVE_DECL_CCOSH == 0
1088 extern double _Complex ccosh(double _Complex z);
1089 #endif
1090 #if HAVE_DECL_CTANH == 0
1091 extern double _Complex ctanh(double _Complex z);
1092 #endif
1093 #if HAVE_DECL_CASINH == 0
1094 extern double _Complex casinh(double _Complex z);
1095 #endif
1096 #if HAVE_DECL_CACOSH == 0
1097 extern double _Complex cacosh(double _Complex z);
1098 #endif
1099 #if HAVE_DECL_CATANH == 0
1100 extern double _Complex catanh(double _Complex z);
1101 #endif
1102 #define COPYSIGN copysign
1103 #define NEXTAFTER nextafter
1104 #define MKNAN nan
1105 #define CEIL ceil
1106 #define FLOOR floor
1107 #define NEARBYINT nearbyint
1108 #define RINT rint
1109 #define ROUND round
1110 #define LRINT lrint
1111 #define LROUND lround
1112 #define LLRINT llrint
1113 #define LLROUND llround
1114 #define TRUNC trunc
1115 #define FMOD fmod
1116 #define REMAINDER remainder
1117 #define REMQUO remquo
1118 #define FDIM fdim
1119 #define FMAX fmax
1120 #define FMIN fmin
1121 #define FFMA fma
1122 #define FABS fabs
1123 #define SQRT sqrt
1124 #define CBRT cbrt
1125 #define HYPOT hypot
1126 #define EXP exp
1127 #define EXP2 exp2
1128 #define EXPM1 expm1
1129 #define LOG log
1130 #define LOG2 log2
1131 #define LOG10 log10
1132 #define LOG1P log1p
1133 #define LOGB logb
1134 #define ILOGB ilogb
1135 #define MODF modf
1136 #define FREXP frexp
1137 #define LDEXP ldexp
1138 #define SCALBN scalbn
1139 #define SCALBLN scalbln
1140 #define POW pow
1141 #define COS cos
1142 #define SIN sin
1143 #define TAN tan
1144 #define COSH cosh
1145 #define SINH sinh
1146 #define TANH tanh
1147 #define ACOS acos
1148 #define ASIN asin
1149 #define ATAN atan
1150 #define ATAN2 atan2
1151 #define ACOSH acosh
1152 #define ASINH asinh
1153 #define ATANH atanh
1154 #define TGAMMA tgamma
1155 #define LGAMMA lgamma
1156 #define J0 j0
1157 #define J1 j1
1158 #define JN jn
1159 #define Y0 y0
1160 #define Y1 y1
1161 #define YN yn
1162 #define ERF erf
1163 #define ERFC erfc
1164 #define CREAL creal
1165 #define CIMAG cimag
1166 #define CABS cabs
1167 #define CARG carg
1168 #define CONJ conj
1169 #define CPROJ cproj
1170 #define CSQRT csqrt
1171 #define CEXP cexp
1172 #define CLOG clog
1173 #define CPOW cpow
1174 #define CSIN csin
1175 #define CCOS ccos
1176 #define CTAN ctan
1177 #define CASIN casin
1178 #define CACOS cacos
1179 #define CATAN catan
1180 #define CSINH csinh
1181 #define CCOSH ccosh
1182 #define CTANH ctanh
1183 #define CASINH casinh
1184 #define CACOSH cacosh
1185 #define CATANH catanh
1186 #endif
1187 
1188 #if defined(NFFT_LDOUBLE)
1189  #define EPSILON LDBL_EPSILON//4.0E-31L
1190  #define MANT_DIG LDBL_MANT_DIG
1191  #define MIN_EXP LDBL_MIN_EXP
1192  #define MAX_EXP LDBL_MAX_EXP
1193 #elif defined(NFFT_SINGLE)
1194  #define EPSILON FLT_EPSILON
1195  #define MANT_DIG FLT_MANT_DIG
1196  #define MIN_EXP FLT_MIN_EXP
1197  #define MAX_EXP FLT_MAX_EXP
1198 #else
1199  #define EPSILON DBL_EPSILON
1200  #define MANT_DIG DBL_MANT_DIG
1201  #define MIN_EXP DBL_MIN_EXP
1202  #define MAX_EXP DBL_MAX_EXP
1203 #endif
1204 
1205 #if defined(FLT_ROUND)
1206  #if FLT_ROUND != -1
1207  #define FLTROUND 1.0
1208  #else
1209  #define FLTROUND 0.0
1210  #endif
1211 #else
1212  #define FLTROUND 0.0
1213 #endif
1214 
1215 #if HAVE_DECL_DRAND48 == 0
1216  extern double drand48(void);
1217 #endif
1218 #if HAVE_DECL_SRAND48 == 0
1219  extern void srand48(long int);
1220 #endif
1221 #define R_RADIX FLT_RADIX
1222 #define II _Complex_I
1223 
1224 /* format strings */
1225 #if defined(NFFT_LDOUBLE)
1226 # define FE "LE"
1227 # define FE_ "% 36.32LE"
1228 # define FFI "%Lf"
1229 #elif defined(NFFT_SINGLE)
1230 # define FE "E"
1231 # define FE_ "% 12.8E"
1232 # define FFI "%f"
1233 #else
1234 # define FE "lE"
1235 # define FE_ "% 20.16lE"
1236 # define FFI "%lf"
1237 #endif
1238 
1239 #define TRUE 1
1240 #define FALSE 0
1241 
1243 #define UNUSED(x) (void)x
1244 
1245 extern void nfft_assertion_failed(const char *s, int line, const char *file);
1246 
1247 /* always check */
1248 #define CK(ex) \
1249  (void)((ex) || (nfft_assertion_failed(#ex, __LINE__, __FILE__), 0))
1250 
1251 #ifdef NFFT_DEBUG
1252  /* check only if debug enabled */
1253  #define A(ex) \
1254  (void)((ex) || (nfft_assertion_failed(#ex, __LINE__, __FILE__), 0))
1255 #else
1256  #define A(ex) /* nothing */
1257 #endif
1258 
1259 #ifdef HAVE_ALLOCA
1260  /* Use alloca if available. */
1261  #ifndef alloca
1262  #ifdef __GNUC__
1263  /* No alloca defined but can use GCC's builtin version. */
1264  #define alloca __builtin_alloca
1265  #else
1266  /* No alloca defined and not using GCC. */
1267  #ifdef _MSC_VER
1268  /* Using Microsoft's C compiler. Include header file and use _alloca
1269  * defined therein. */
1270  #include <malloc.h>
1271  #define alloca _alloca
1272  #else
1273  /* Also not using Microsoft's C compiler. */
1274  #if HAVE_ALLOCA_H
1275  /* Alloca header is available. */
1276  #include <alloca.h>
1277  #else
1278  /* No alloca header available. */
1279  #ifdef _AIX
1280  /* We're using the AIX C compiler. Use pragma. */
1281  #pragma alloca
1282  #else
1283  /* Not using AIX compiler. */
1284  #ifndef alloca /* HP's cc +Olibcalls predefines alloca. */
1285  void *alloca(size_t);
1286  #endif
1287  #endif
1288  #endif
1289  #endif
1290  #endif
1291  #endif
1292  /* So we have alloca. */
1293  #define STACK_MALLOC(T, p, x) p = (T)alloca(x)
1294  #define STACK_FREE(x) /* Nothing. Cleanup done automatically. */
1295 #else /* ! HAVE_ALLOCA */
1296  /* Use malloc instead of alloca. So we allocate memory on the heap instead of
1297  * on the stack which is slower. */
1298  #define STACK_MALLOC(T, p, x) p = (T)nfft_malloc(x)
1299  #define STACK_FREE(x) nfft_free(x)
1300 #endif /* ! HAVE_ALLOCA */
1301 
1303 double nfft_elapsed_seconds(ticks t1, ticks t0);
1304 
1306 #define UNUSED(x) (void)x
1307 
1314 #ifdef MEASURE_TIME
1315  int MEASURE_TIME_r;
1316  double MEASURE_TIME_tt;
1317  ticks MEASURE_TIME_t0, MEASURE_TIME_t1;
1318 
1319 #define TIC(a) \
1320  ths->MEASURE_TIME_t[(a)]=0; \
1321  MEASURE_TIME_r=0; \
1322  /* DISABLED LOOP due to code blocks causing segfault when repeatedly run */ \
1323  /*while(ths->MEASURE_TIME_t[(a)]<0.01)*/ \
1324  { \
1325  MEASURE_TIME_r++; \
1326  MEASURE_TIME_t0 = getticks(); \
1327 
1328 /* THE MEASURED FUNCTION IS CALLED REPEATEDLY */
1329 
1330 #define TOC(a) \
1331  MEASURE_TIME_t1 = getticks(); \
1332  MEASURE_TIME_tt = nfft_elapsed_seconds(MEASURE_TIME_t1,MEASURE_TIME_t0);\
1333  ths->MEASURE_TIME_t[(a)]+=MEASURE_TIME_tt; \
1334  } \
1335  ths->MEASURE_TIME_t[(a)]/=MEASURE_TIME_r; \
1336 
1337 #else
1338 #define TIC(a)
1339 #define TOC(a)
1340 #endif
1341 
1342 #ifdef MEASURE_TIME_FFTW
1343 #define TIC_FFTW(a) TIC(a)
1344 #define TOC_FFTW(a) TOC(a)
1345 #else
1346 #define TIC_FFTW(a)
1347 #define TOC_FFTW(a)
1348 #endif
1349 
1350 /* sinc.c: */
1351 
1352 /* Sinus cardinalis. */
1353 R X(sinc)(R x);
1354 
1355 /* lambda.c: */
1356 
1357 /* lambda(z, eps) = gamma(z + eps) / gamma(z + 1) */
1358 R X(lambda)(R z, R eps);
1359 
1360 /* lambda2(mu, nu) = sqrt(gamma(mu + nu + 1) / (gamma(mu + 1) * gamma(nu + 1))) */
1361 R X(lambda2)(R mu, R nu);
1362 
1363 /* bessel_i0.c: */
1364 R X(bessel_i0)(R x);
1365 
1366 /* float.c: */
1367 typedef enum {NFFT_EPSILON = 0, NFFT_SAFE_MIN = 1, NFFT_BASE = 2,
1368  NFFT_PRECISION = 3, NFFT_MANT_DIG = 4, NFFT_FLTROUND = 5, NFFT_E_MIN = 6,
1369  NFFT_R_MIN = 7, NFFT_E_MAX = 8, NFFT_R_MAX = 9} float_property;
1370 
1371 R X(float_property)(float_property);
1372 
1373 /* int.c: */
1374 int X(exp2i)(const int a);
1375 int X(log2i)(const int m);
1376 int X(next_power_of_2)(const int N);
1377 void X(next_power_of_2_exp)(const int N, int *N2, int *t);
1378 
1379 /* error.c: */
1380 R X(error_l_infty_complex)(const C *x, const C *y, const INT n);
1381 /* not used */ R X(error_l_infty_double)(const R *x, const R *y, const INT n);
1382 R X(error_l_infty_1_complex)(const C *x, const C *y, const INT n,
1383  const C *z, const INT m);
1384 /* not used */ R X(error_l_infty_1_double)(const R *x, const R *y, const INT n, const R *z,
1385  const INT m);
1386 R X(error_l_2_complex)(const C *x, const C *y, const INT n);
1387 /* not used */ R X(error_l_2_double)(const R *x, const R *y, const INT n);
1388 
1389 #endif

Generated on Tue Apr 30 2013 by Doxygen 1.8.1