40 #include <sys/types.h> 67 #define CONCAT(prefix, name) prefix ## name 68 #if defined(NFFT_SINGLE) 70 typedef float _Complex C;
71 #define Y(name) CONCAT(nfftf_,name) 72 #define FFTW(name) CONCAT(fftwf_,name) 73 #define NFFT(name) CONCAT(nfftf_,name) 74 #define NFCT(name) CONCAT(nfctf_,name) 75 #define NFST(name) CONCAT(nfstf_,name) 76 #define NFSFT(name) CONCAT(nfsftf_,name) 77 #define SOLVER(name) CONCAT(solverf_,name) 78 #elif defined(NFFT_LDOUBLE) 79 typedef long double R;
80 typedef long double _Complex C;
81 #define Y(name) CONCAT(nfftl_,name) 82 #define FFTW(name) CONCAT(fftwl_,name) 83 #define NFFT(name) CONCAT(nfftl_,name) 84 #define NFCT(name) CONCAT(nfctl_,name) 85 #define NFST(name) CONCAT(nfstl_,name) 86 #define NFSFT(name) CONCAT(nfsftl_,name) 87 #define SOLVER(name) CONCAT(solverl_,name) 90 typedef double _Complex C;
91 #define Y(name) CONCAT(nfft_,name) 92 #define FFTW(name) CONCAT(fftw_,name) 93 #define NFFT(name) CONCAT(nfft_,name) 94 #define NFCT(name) CONCAT(nfct_,name) 95 #define NFST(name) CONCAT(nfst_,name) 96 #define NFSFT(name) CONCAT(nfsft_,name) 97 #define SOLVER(name) CONCAT(solver_,name) 99 #define X(name) Y(name) 101 #define STRINGIZEx(x) #x 102 #define STRINGIZE(x) STRINGIZEx(x) 105 # define K(x) ((R) x##L) 107 # define K(x) ((R) x) 109 #define DK(name, value) const R name = K(value) 111 #if defined __CYGWIN32__ && !defined __CYGWIN__ 115 # define __CYGWIN__ __CYGWIN32__ 118 #if defined _WIN32 && !defined __CYGWIN__ 131 typedef ptrdiff_t INT;
133 #define KPI K(3.1415926535897932384626433832795028841971693993751) 134 #define K2PI K(6.2831853071795864769252867665590057683943387987502) 135 #define K4PI K(12.5663706143591729538505735331180115367886775975004) 136 #define KE K(2.7182818284590452353602874713526624977572470937000) 138 #define IF(x,a,b) ((x)?(a):(b)) 139 #define MIN(a,b) (((a)<(b))?(a):(b)) 140 #define MAX(a,b) (((a)>(b))?(a):(b)) 141 #define ABS(x) (((x)>K(0.0))?(x):(-(x))) 142 #define SIGN(a) (((a)>=0)?1:-1) 143 #define SIGN(a) (((a)>=0)?1:-1) 144 #define SIGNF(a) IF((a)<K(0.0),K(-1.0),K(1.0)) 147 #define SIZE(x) sizeof(x)/sizeof(x[0]) 150 #define CSWAP(x,y) {C* NFFT_SWAP_temp__; \ 151 NFFT_SWAP_temp__=(x); (x)=(y); (y)=NFFT_SWAP_temp__;} 154 #define RSWAP(x,y) {R* NFFT_SWAP_temp__; NFFT_SWAP_temp__=(x); \ 155 (x)=(y); (y)=NFFT_SWAP_temp__;} 159 #if defined(DIRAC_DELTA) 160 #define PHI_HUT(n,k,d) K(1.0) 161 #define PHI(n,x,d) IF(FABS((x)) < K(10E-8),K(1.0),K(0.0)) 162 #define WINDOW_HELP_INIT(d) 163 #define WINDOW_HELP_FINALIZE 164 #define WINDOW_HELP_ESTIMATE_m 0 165 #elif defined(GAUSSIAN) 166 #define PHI_HUT(n,k,d) ((R)EXP(-(POW(KPI*(k)/n,K(2.0))*ths->b[d]))) 167 #define PHI(n,x,d) ((R)EXP(-POW((x)*((R)n),K(2.0)) / \ 168 ths->b[d])/SQRT(KPI*ths->b[d])) 169 #define WINDOW_HELP_INIT \ 172 ths->b = (R*) Y(malloc)(ths->d*sizeof(R)); \ 173 for (WINDOW_idx = 0; WINDOW_idx < ths->d; WINDOW_idx++) \ 174 ths->b[WINDOW_idx]=(K(2.0)*ths->sigma[WINDOW_idx]) / \ 175 (K(2.0)*ths->sigma[WINDOW_idx] - K(1.0)) * (((R)ths->m) / KPI); \ 177 #define WINDOW_HELP_FINALIZE {Y(free)(ths->b);} 178 #if defined(NFFT_LDOUBLE) 179 #define WINDOW_HELP_ESTIMATE_m 17 180 #elif defined(NFFT_SINGLE) 181 #define WINDOW_HELP_ESTIMATE_m 5 183 #define WINDOW_HELP_ESTIMATE_m 13 185 #elif defined(B_SPLINE) 186 #define PHI_HUT(n,k,d) ((R)(((k) == 0) ? K(1.0) / n : \ 187 POW(SIN((k) * KPI / n) / ((k) * KPI / n), \ 189 #define PHI(n,x,d) (Y(bsplines)(2*ths->m,((x)*n) + \ 191 #define WINDOW_HELP_INIT 192 #define WINDOW_HELP_FINALIZE 193 #if defined(NFFT_LDOUBLE) 194 #define WINDOW_HELP_ESTIMATE_m 11 195 #elif defined(NFFT_SINGLE) 196 #define WINDOW_HELP_ESTIMATE_m 11 198 #define WINDOW_HELP_ESTIMATE_m 11 200 #elif defined(SINC_POWER) 201 #define PHI_HUT(n,k,d) (Y(bsplines)(2 * ths->m, (K(2.0) * ths->m*(k)) / \ 202 ((K(2.0) * ths->sigma[(d)] - 1) * n / \ 203 ths->sigma[(d)]) + (R)ths->m)) 204 #define PHI(n,x,d) ((R)(n / ths->sigma[(d)] * \ 205 (K(2.0) * ths->sigma[(d)] - K(1.0))/ (K(2.0)*ths->m) * \ 206 POW(Y(sinc)(KPI * n / ths->sigma[(d)] * (x) * \ 207 (K(2.0) * ths->sigma[(d)] - K(1.0)) / (K(2.0)*ths->m)) , 2*ths->m) / \ 209 #define WINDOW_HELP_INIT 210 #define WINDOW_HELP_FINALIZE 211 #if defined(NFFT_LDOUBLE) 212 #define WINDOW_HELP_ESTIMATE_m 13 213 #elif defined(NFFT_SINGLE) 214 #define WINDOW_HELP_ESTIMATE_m 11 216 #define WINDOW_HELP_ESTIMATE_m 11 219 #define PHI_HUT(n,k,d) (Y(bessel_i0)((R)(ths->m) * SQRT(ths->b[d] * ths->b[d] - (K(2.0) * KPI * (R)(k) / (R)(n)) * (K(2.0) * KPI * (R)(k) / (R)(n))))) 220 #define PHI(n,x,d) ( (((R)(ths->m) * (R)(ths->m) - (x) * (R)(n) * (x) * (R)(n)) > K(0.0)) \ 221 ? SINH(ths->b[d] * SQRT((R)(ths->m) * (R)(ths->m) - (x) * (R)(n) * (x) * (R)(n))) \ 222 / (KPI * SQRT((R)(ths->m) * (R)(ths->m) - (x) * (R)(n) * (x) * (R)(n))) \ 223 : ((((R)(ths->m) * (R)(ths->m) - (x) * (R)(n) * (x) * (R)(n)) < K(0.0)) \ 224 ? SIN(ths->b[d] * SQRT((x) * (R)(n) * (x) * (R)(n) - (R)(ths->m) * (R)(ths->m))) \ 225 / (KPI * SQRT((x) * (R)(n) * (x) * (R)(n) - (R)(ths->m) * (R)(ths->m))) \ 227 #define WINDOW_HELP_INIT \ 230 ths->b = (R*) Y(malloc)((size_t)(ths->d) * sizeof(R)); \ 231 for (WINDOW_idx = 0; WINDOW_idx < ths->d; WINDOW_idx++) \ 232 ths->b[WINDOW_idx] = (KPI * (K(2.0) - K(1.0) / ths->sigma[WINDOW_idx])); \ 234 #define WINDOW_HELP_FINALIZE {Y(free)(ths->b);} 235 #if defined(NFFT_LDOUBLE) 236 #define WINDOW_HELP_ESTIMATE_m 9 237 #elif defined(NFFT_SINGLE) 238 #define WINDOW_HELP_ESTIMATE_m 4 240 #define WINDOW_HELP_ESTIMATE_m 8 245 INT Y(m2K)(
const INT m);
247 #if defined(NFFT_LDOUBLE) 248 #if HAVE_DECL_COPYSIGNL == 0 249 extern long double copysignl(
long double,
long double);
251 #if HAVE_DECL_NEXTAFTERL == 0 252 extern long double nextafterl(
long double,
long double);
254 #if HAVE_DECL_NANL == 0 255 extern long double nanl(
const char *tag);
257 #if HAVE_DECL_CEILL == 0 258 extern long double ceill(
long double);
260 #if HAVE_DECL_FLOORL == 0 261 extern long double floorl(
long double);
263 #if HAVE_DECL_NEARBYINTL == 0 264 extern long double nearbyintl(
long double);
266 #if HAVE_DECL_RINTL == 0 267 extern long double rintl(
long double);
269 #if HAVE_DECL_ROUNDL == 0 270 extern long double roundl(
long double);
272 #if HAVE_DECL_LRINTL == 0 273 extern long int lrintl(
long double);
275 #if HAVE_DECL_LROUNDL == 0 276 extern long int lroundl(
long double);
278 #if HAVE_DECL_LLRINTL == 0 279 extern long long int llrintl(
long double);
281 #if HAVE_DECL_LLROUNDL == 0 282 extern long long int llroundl(
long double);
284 #if HAVE_DECL_TRUNCL == 0 285 extern long double truncl(
long double);
287 #if HAVE_DECL_FMODL == 0 288 extern long double fmodl(
long double,
long double);
290 #if HAVE_DECL_REMAINDERL == 0 291 extern long double remainderl(
long double,
long double);
293 #if HAVE_DECL_REMQUOL == 0 294 extern long double remquol(
long double x,
long double y,
int *);
296 #if HAVE_DECL_FDIML == 0 297 extern long double fdiml(
long double,
long double);
299 #if HAVE_DECL_FMAXL == 0 300 extern long double fmaxl(
long double,
long double);
302 #if HAVE_DECL_FMINL == 0 303 extern long double fminl(
long double,
long double);
305 #if HAVE_DECL_FMAL == 0 306 extern long double fmal(
long double x,
long double y,
long double z);
308 #if HAVE_DECL_FABSL == 0 309 extern long double fabsl(
long double);
311 #if HAVE_DECL_SQRTL == 0 312 extern long double sqrtl(
long double);
314 #if HAVE_DECL_CBRTL == 0 315 extern long double cbrtl(
long double);
317 #if HAVE_DECL_HYPOTL == 0 318 extern long double hypotl(
long double,
long double);
320 #if HAVE_DECL_EXPL == 0 321 extern long double expl(
long double);
323 #if HAVE_DECL_EXP2L == 0 324 extern long double exp2l(
long double);
326 #if HAVE_DECL_EXPM1L == 0 327 extern long double expm1l(
long double);
329 #if HAVE_DECL_LOGL == 0 330 extern long double logl(
long double);
332 #if HAVE_DECL_LOG2L == 0 333 extern long double log2l(
long double);
335 #if HAVE_DECL_LOG10L == 0 336 extern long double log10l(
long double);
338 #if HAVE_DECL_LOG1PL == 0 339 extern long double log1pl(
long double);
341 #if HAVE_DECL_LOGBL == 0 342 extern long double logbl(
long double);
344 #if HAVE_DECL_ILOGBL == 0 345 extern int ilogbl(
long double);
347 #if HAVE_DECL_MODFL == 0 348 extern long double modfl(
long double,
long double *);
350 #if HAVE_DECL_FREXPL == 0 351 extern long double frexpl(
long double,
int *);
353 #if HAVE_DECL_LDEXPL == 0 354 extern long double ldexpl(
long double,
int);
356 #if HAVE_DECL_SCALBNL == 0 357 extern long double scalbnl(
long double,
int);
359 #if HAVE_DECL_SCALBLNL == 0 360 extern long double scalblnl(
long double,
long int);
362 #if HAVE_DECL_POWL == 0 363 extern long double powl(
long double,
long double);
365 #if HAVE_DECL_COSL == 0 366 extern long double cosl(
long double);
368 #if HAVE_DECL_SINL == 0 369 extern long double sinl(
long double);
371 #if HAVE_DECL_TANL == 0 372 extern long double tanl(
long double);
374 #if HAVE_DECL_COSHL == 0 375 extern long double coshl(
long double);
377 #if HAVE_DECL_SINHL == 0 378 extern long double sinhl(
long double);
380 #if HAVE_DECL_TANHL == 0 381 extern long double tanhl(
long double);
383 #if HAVE_DECL_ACOSL == 0 384 extern long double acosl(
long double);
386 #if HAVE_DECL_ASINL == 0 387 extern long double asinl(
long double);
389 #if HAVE_DECL_ATANL == 0 390 extern long double atanl(
long double);
392 #if HAVE_DECL_ATAN2L == 0 393 extern long double atan2l(
long double,
long double);
395 #if HAVE_DECL_ACOSHL == 0 396 extern long double acoshl(
long double);
398 #if HAVE_DECL_ASINHL == 0 399 extern long double asinhl(
long double);
401 #if HAVE_DECL_ATANHL == 0 402 extern long double atanhl(
long double);
404 #if HAVE_DECL_TGAMMAL == 0 405 extern long double tgammal(
long double);
407 #if HAVE_DECL_LGAMMAL == 0 408 extern long double lgammal(
long double);
410 #if HAVE_DECL_J0L == 0 411 extern long double j0l(
long double);
413 #if HAVE_DECL_J1L == 0 414 extern long double j1l(
long double);
416 #if HAVE_DECL_JNL == 0 417 extern long double jnl(
int,
long double);
419 #if HAVE_DECL_Y0L == 0 420 extern long double y0l(
long double);
422 #if HAVE_DECL_Y1L == 0 423 extern long double y1l(
long double);
425 #if HAVE_DECL_YNL == 0 426 extern long double ynl(
int,
long double);
428 #if HAVE_DECL_ERFL == 0 429 extern long double erfl(
long double);
431 #if HAVE_DECL_ERFCL == 0 432 extern long double erfcl(
long double);
434 #if HAVE_DECL_CREALL == 0 435 extern long double creall(
long double _Complex z);
437 #if HAVE_DECL_CIMAGL == 0 438 extern long double cimagl(
long double _Complex z);
440 #if HAVE_DECL_CABSL == 0 441 extern long double cabsl(
long double _Complex z);
443 #if HAVE_DECL_CARGL == 0 444 extern long double cargl(
long double _Complex z);
446 #if HAVE_DECL_CONJL == 0 447 extern long double _Complex conjl(
long double _Complex z);
449 #if HAVE_DECL_CPROJL == 0 450 extern long double _Complex cprojl(
long double _Complex z);
452 #if HAVE_DECL_CSQRTL == 0 453 extern long double _Complex csqrtl(
long double _Complex z);
455 #if HAVE_DECL_CEXPL == 0 456 extern long double _Complex cexpl(
long double _Complex z);
458 #if HAVE_DECL_CLOGL == 0 459 extern long double _Complex clogl(
long double _Complex z);
461 #if HAVE_DECL_CPOWL == 0 462 extern long double _Complex cpowl(
long double _Complex z,
long double _Complex w);
464 #if HAVE_DECL_CSINL == 0 465 extern long double _Complex csinl(
long double _Complex z);
467 #if HAVE_DECL_CCOSL == 0 468 extern long double _Complex ccosl(
long double _Complex z);
470 #if HAVE_DECL_CTANL == 0 471 extern long double _Complex ctanl(
long double _Complex z);
473 #if HAVE_DECL_CASINL == 0 474 extern long double _Complex casinl(
long double _Complex z);
476 #if HAVE_DECL_CACOSL == 0 477 extern long double _Complex cacosl(
long double _Complex z);
479 #if HAVE_DECL_CATANL == 0 480 extern long double _Complex catanl(
long double _Complex z);
482 #if HAVE_DECL_CSINHL == 0 483 extern long double _Complex csinhl(
long double _Complex z);
485 #if HAVE_DECL_CCOSHL == 0 486 extern long double _Complex ccoshl(
long double _Complex z);
488 #if HAVE_DECL_CTANHL == 0 489 extern long double _Complex ctanhl(
long double _Complex z);
491 #if HAVE_DECL_CASINHL == 0 492 extern long double _Complex casinhl(
long double _Complex z);
494 #if HAVE_DECL_CACOSHL == 0 495 extern long double _Complex cacoshl(
long double _Complex z);
497 #if HAVE_DECL_CATANHL == 0 498 extern long double _Complex catanhl(
long double _Complex z);
500 #define COPYSIGN copysignl 501 #define NEXTAFTER nextafterl 505 #define NEARBYINT nearbyintl 509 #define LROUND lroundl 510 #define LLRINT llrintl 511 #define LLROUND llroundl 514 #define REMAINDER remainderl 515 #define REMQUO remquol 536 #define SCALBN scalbnl 537 #define SCALBLN scalblnl 552 #define TGAMMA tgammal 553 #define LGAMMA lgammal 581 #define CASINH casinhl 582 #define CACOSH cacoshl 583 #define CATANH catanhl 584 #elif defined(NFFT_SINGLE) 585 #if HAVE_DECL_COPYSIGNF == 0 586 extern float copysignf(
float,
float);
588 #if HAVE_DECL_NEXTAFTERF == 0 589 extern float nextafterf(
float,
float);
591 #if HAVE_DECL_NANF == 0 592 extern float nanf(
const char *tag);
594 #if HAVE_DECL_CEILF == 0 595 extern float ceilf(
float);
597 #if HAVE_DECL_FLOORF == 0 598 extern float floorf(
float);
600 #if HAVE_DECL_NEARBYINTF == 0 601 extern float nearbyintf(
float);
603 #if HAVE_DECL_RINTF == 0 604 extern float rintf(
float);
606 #if HAVE_DECL_ROUNDF == 0 607 extern float roundf(
float);
609 #if HAVE_DECL_LRINTF == 0 610 extern long int lrintf(
float);
612 #if HAVE_DECL_LROUNDF == 0 613 extern long int lroundf(
float);
615 #if HAVE_DECL_LLRINTF == 0 616 extern long long int llrintf(
float);
618 #if HAVE_DECL_LLROUNDF == 0 619 extern long long int llroundf(
float);
621 #if HAVE_DECL_TRUNCF == 0 622 extern float truncf(
float);
624 #if HAVE_DECL_FMODF == 0 625 extern float fmodf(
float,
float);
627 #if HAVE_DECL_REMAINDERF == 0 628 extern float remainderf(
float,
float);
630 #if HAVE_DECL_REMQUOF == 0 631 extern float remquof(
float x,
float y,
int *);
633 #if HAVE_DECL_FDIMF == 0 634 extern float fdimf(
float,
float);
636 #if HAVE_DECL_FMAXF == 0 637 extern float fmaxf(
float,
float);
639 #if HAVE_DECL_FMINF == 0 640 extern float fminf(
float,
float);
642 #if HAVE_DECL_FMAF == 0 643 extern float fmaf(
float x,
float y,
float z);
645 #if HAVE_DECL_FABSF == 0 646 extern float fabsf(
float);
648 #if HAVE_DECL_SQRTF == 0 649 extern float sqrtf(
float);
651 #if HAVE_DECL_CBRTF == 0 652 extern float cbrtf(
float);
654 #if HAVE_DECL_HYPOTF == 0 655 extern float hypotf(
float,
float);
657 #if HAVE_DECL_EXPF == 0 658 extern float expf(
float);
660 #if HAVE_DECL_EXP2F == 0 661 extern float exp2f(
float);
663 #if HAVE_DECL_EXPM1F == 0 664 extern float expm1f(
float);
666 #if HAVE_DECL_LOGF == 0 667 extern float logf(
float);
669 #if HAVE_DECL_LOG2F == 0 670 extern float log2f(
float);
672 #if HAVE_DECL_LOG10F == 0 673 extern float log10f(
float);
675 #if HAVE_DECL_LOG1PF == 0 676 extern float log1pf(
float);
678 #if HAVE_DECL_LOGBF == 0 679 extern float logbf(
float);
681 #if HAVE_DECL_ILOGBF == 0 682 extern int ilogbf(
float);
684 #if HAVE_DECL_MODFF == 0 685 extern float modff(
float,
float *);
687 #if HAVE_DECL_FREXPF == 0 688 extern float frexpf(
float,
int *);
690 #if HAVE_DECL_LDEXPF == 0 691 extern float ldexpf(
float,
int);
693 #if HAVE_DECL_SCALBNF == 0 694 extern float scalbnf(
float,
int);
696 #if HAVE_DECL_SCALBLNF == 0 697 extern float scalblnf(
float,
long int);
699 #if HAVE_DECL_POWF == 0 700 extern float powf(
float,
float);
702 #if HAVE_DECL_COSF == 0 703 extern float cosf(
float);
705 #if HAVE_DECL_SINF == 0 706 extern float sinf(
float);
708 #if HAVE_DECL_TANF == 0 709 extern float tanf(
float);
711 #if HAVE_DECL_COSHF == 0 712 extern float coshf(
float);
714 #if HAVE_DECL_SINHF == 0 715 extern float sinhf(
float);
717 #if HAVE_DECL_TANHF == 0 718 extern float tanhf(
float);
720 #if HAVE_DECL_ACOSF == 0 721 extern float acosf(
float);
723 #if HAVE_DECL_ASINF == 0 724 extern float asinf(
float);
726 #if HAVE_DECL_ATANF == 0 727 extern float atanf(
float);
729 #if HAVE_DECL_ATAN2F == 0 730 extern float atan2f(
float,
float);
732 #if HAVE_DECL_ACOSHF == 0 733 extern float acoshf(
float);
735 #if HAVE_DECL_ASINHF == 0 736 extern float asinhf(
float);
738 #if HAVE_DECL_ATANHF == 0 739 extern float atanhf(
float);
741 #if HAVE_DECL_TGAMMAF == 0 742 extern float tgammaf(
float);
744 #if HAVE_DECL_LGAMMAF == 0 745 extern float lgammaf(
float);
747 #if HAVE_DECL_J0F == 0 748 extern float j0f(
float);
750 #if HAVE_DECL_J1F == 0 751 extern float j1f(
float);
753 #if HAVE_DECL_JNF == 0 754 extern float jnf(
int,
float);
756 #if HAVE_DECL_Y0F == 0 757 extern float y0f(
float);
759 #if HAVE_DECL_Y1F == 0 760 extern float y1f(
float);
762 #if HAVE_DECL_YNF == 0 763 extern float ynf(
int,
float);
765 #if HAVE_DECL_ERFF == 0 766 extern float erff(
float);
768 #if HAVE_DECL_ERFCF == 0 769 extern float erfcf(
float);
771 #if HAVE_DECL_CREALF == 0 772 extern float crealf(
float _Complex z);
774 #if HAVE_DECL_CIMAGF == 0 775 extern float cimagf(
float _Complex z);
777 #if HAVE_DECL_CABSF == 0 778 extern float cabsf(
float _Complex z);
780 #if HAVE_DECL_CARGF == 0 781 extern float cargf(
float _Complex z);
783 #if HAVE_DECL_CONJF == 0 784 extern float _Complex conjf(
float _Complex z);
786 #if HAVE_DECL_CPROJF == 0 787 extern float _Complex cprojf(
float _Complex z);
789 #if HAVE_DECL_CSQRTF == 0 790 extern float _Complex csqrtf(
float _Complex z);
792 #if HAVE_DECL_CEXPF == 0 793 extern float _Complex cexpf(
float _Complex z);
795 #if HAVE_DECL_CLOGF == 0 796 extern float _Complex clogf(
float _Complex z);
798 #if HAVE_DECL_CPOWF == 0 799 extern float _Complex cpowf(
float _Complex z,
float _Complex w);
801 #if HAVE_DECL_CSINF == 0 802 extern float _Complex csinf(
float _Complex z);
804 #if HAVE_DECL_CCOSF == 0 805 extern float _Complex ccosf(
float _Complex z);
807 #if HAVE_DECL_CTANF == 0 808 extern float _Complex ctanf(
float _Complex z);
810 #if HAVE_DECL_CASINF == 0 811 extern float _Complex casinf(
float _Complex z);
813 #if HAVE_DECL_CACOSF == 0 814 extern float _Complex cacosf(
float _Complex z);
816 #if HAVE_DECL_CATANF == 0 817 extern float _Complex catanf(
float _Complex z);
819 #if HAVE_DECL_CSINHF == 0 820 extern float _Complex csinhf(
float _Complex z);
822 #if HAVE_DECL_CCOSHF == 0 823 extern float _Complex ccoshf(
float _Complex z);
825 #if HAVE_DECL_CTANHF == 0 826 extern float _Complex ctanhf(
float _Complex z);
828 #if HAVE_DECL_CASINHF == 0 829 extern float _Complex casinhf(
float _Complex z);
831 #if HAVE_DECL_CACOSHF == 0 832 extern float _Complex cacoshf(
float _Complex z);
834 #if HAVE_DECL_CATANHF == 0 835 extern float _Complex catanhf(
float _Complex z);
837 #define COPYSIGN copysignf 838 #define NEXTAFTER nextafterf 842 #define NEARBYINT nearbyintf 846 #define LROUND lroundf 847 #define LLRINT llrintf 848 #define LLROUND llroundf 851 #define REMAINDER remainderf 852 #define REMQUO remquof 873 #define SCALBN scalbnf 874 #define SCALBLN scalblnf 889 #define TGAMMA tgammaf 890 #define LGAMMA lgammaf 918 #define CASINH casinhf 919 #define CACOSH cacoshf 920 #define CATANH catanhf 922 #if HAVE_DECL_COPYSIGN == 0 923 extern double copysign(
double,
double);
925 #if HAVE_DECL_NEXTAFTER == 0 926 extern double nextafter(
double,
double);
928 #if HAVE_DECL_NAN == 0 929 extern double nan(
const char *tag);
931 #if HAVE_DECL_CEIL == 0 932 extern double ceil(
double);
934 #if HAVE_DECL_FLOOR == 0 935 extern double floor(
double);
937 #if HAVE_DECL_NEARBYINT == 0 938 extern double nearbyint(
double);
940 #if HAVE_DECL_RINT == 0 941 extern double rint(
double);
943 #if HAVE_DECL_ROUND == 0 944 extern double round(
double);
946 #if HAVE_DECL_LRINT == 0 947 extern long int lrint(
double);
949 #if HAVE_DECL_LROUND == 0 950 extern long int lround(
double);
952 #if HAVE_DECL_LLRINT == 0 953 extern long long int llrint(
double);
955 #if HAVE_DECL_LLROUND == 0 956 extern long long int llround(
double);
958 #if HAVE_DECL_TRUNC == 0 959 extern double trunc(
double);
961 #if HAVE_DECL_FMOD == 0 962 extern double fmod(
double,
double);
964 #if HAVE_DECL_REMAINDER == 0 965 extern double remainder(
double,
double);
967 #if HAVE_DECL_REMQUO == 0 968 extern double remquo(
double x,
double y,
int *);
970 #if HAVE_DECL_FDIM == 0 971 extern double fdim(
double,
double);
973 #if HAVE_DECL_FMAX == 0 974 extern double fmax(
double,
double);
976 #if HAVE_DECL_FMIN == 0 977 extern double fmin(
double,
double);
979 #if HAVE_DECL_FMA == 0 980 extern double fma(
double x,
double y,
double z);
982 #if HAVE_DECL_FABS == 0 983 extern double fabs(
double);
985 #if HAVE_DECL_SQRT == 0 986 extern double sqrt(
double);
988 #if HAVE_DECL_CBRT == 0 989 extern double cbrt(
double);
991 #if HAVE_DECL_HYPOT == 0 992 extern double hypot(
double,
double);
994 #if HAVE_DECL_EXP == 0 995 extern double exp(
double);
997 #if HAVE_DECL_EXP2 == 0 998 extern double exp2(
double);
1000 #if HAVE_DECL_EXPM1 == 0 1001 extern double expm1(
double);
1003 #if HAVE_DECL_LOG == 0 1004 extern double log(
double);
1006 #if HAVE_DECL_LOG2 == 0 1007 extern double log2(
double);
1009 #if HAVE_DECL_LOG10 == 0 1010 extern double log10(
double);
1012 #if HAVE_DECL_LOG1P == 0 1013 extern double log1p(
double);
1015 #if HAVE_DECL_LOGB == 0 1016 extern double logb(
double);
1018 #if HAVE_DECL_ILOGB == 0 1019 extern int ilogb(
double);
1021 #if HAVE_DECL_MODF == 0 1022 extern double modf(
double,
double *);
1024 #if HAVE_DECL_FREXP == 0 1025 extern double frexp(
double,
int *);
1027 #if HAVE_DECL_LDEXP == 0 1028 extern double ldexp(
double,
int);
1030 #if HAVE_DECL_SCALBN == 0 1031 extern double scalbn(
double,
int);
1033 #if HAVE_DECL_SCALBLN == 0 1034 extern double scalbln(
double,
long int);
1036 #if HAVE_DECL_POW == 0 1037 extern double pow(
double,
double);
1039 #if HAVE_DECL_COS == 0 1040 extern double cos(
double);
1042 #if HAVE_DECL_SIN == 0 1043 extern double sin(
double);
1045 #if HAVE_DECL_TAN == 0 1046 extern double tan(
double);
1048 #if HAVE_DECL_COSH == 0 1049 extern double cosh(
double);
1051 #if HAVE_DECL_SINH == 0 1052 extern double sinh(
double);
1054 #if HAVE_DECL_TANH == 0 1055 extern double tanh(
double);
1057 #if HAVE_DECL_ACOS == 0 1058 extern double acos(
double);
1060 #if HAVE_DECL_ASIN == 0 1061 extern double asin(
double);
1063 #if HAVE_DECL_ATAN == 0 1064 extern double atan(
double);
1066 #if HAVE_DECL_ATAN2 == 0 1067 extern double atan2(
double,
double);
1069 #if HAVE_DECL_ACOSH == 0 1070 extern double acosh(
double);
1072 #if HAVE_DECL_ASINH == 0 1073 extern double asinh(
double);
1075 #if HAVE_DECL_ATANH == 0 1076 extern double atanh(
double);
1078 #if HAVE_DECL_TGAMMA == 0 1079 extern double tgamma(
double);
1081 #if HAVE_DECL_LGAMMA == 0 1082 extern double lgamma(
double);
1084 #if HAVE_DECL_J0 == 0 1085 extern double j0(
double);
1087 #if HAVE_DECL_J1 == 0 1088 extern double j1(
double);
1090 #if HAVE_DECL_JN == 0 1091 extern double jn(
int,
double);
1093 #if HAVE_DECL_Y0 == 0 1094 extern double y0(
double);
1096 #if HAVE_DECL_Y1 == 0 1097 extern double y1(
double);
1099 #if HAVE_DECL_YN == 0 1100 extern double yn(
int,
double);
1102 #if HAVE_DECL_ERF == 0 1103 extern double erf(
double);
1105 #if HAVE_DECL_ERFC == 0 1106 extern double erfc(
double);
1108 #if HAVE_DECL_CREAL == 0 1109 extern double creal(
double _Complex z);
1111 #if HAVE_DECL_CIMAG == 0 1112 extern double cimag(
double _Complex z);
1114 #if HAVE_DECL_CABS == 0 1115 extern double cabs(
double _Complex z);
1117 #if HAVE_DECL_CARG == 0 1118 extern double carg(
double _Complex z);
1120 #if HAVE_DECL_CONJ == 0 1121 extern double _Complex conj(
double _Complex z);
1123 #if HAVE_DECL_CPROJ == 0 1124 extern double _Complex cproj(
double _Complex z);
1126 #if HAVE_DECL_CSQRT == 0 1127 extern double _Complex csqrt(
double _Complex z);
1129 #if HAVE_DECL_CEXP == 0 1130 extern double _Complex cexp(
double _Complex z);
1132 #if HAVE_DECL_CLOG == 0 1133 extern double _Complex clog(
double _Complex z);
1135 #if HAVE_DECL_CPOW == 0 1136 extern double _Complex cpow(
double _Complex z,
double _Complex w);
1138 #if HAVE_DECL_CSIN == 0 1139 extern double _Complex csin(
double _Complex z);
1141 #if HAVE_DECL_CCOS == 0 1142 extern double _Complex ccos(
double _Complex z);
1144 #if HAVE_DECL_CTAN == 0 1145 extern double _Complex ctan(
double _Complex z);
1147 #if HAVE_DECL_CASIN == 0 1148 extern double _Complex casin(
double _Complex z);
1150 #if HAVE_DECL_CACOS == 0 1151 extern double _Complex cacos(
double _Complex z);
1153 #if HAVE_DECL_CATAN == 0 1154 extern double _Complex catan(
double _Complex z);
1156 #if HAVE_DECL_CSINH == 0 1157 extern double _Complex csinh(
double _Complex z);
1159 #if HAVE_DECL_CCOSH == 0 1160 extern double _Complex ccosh(
double _Complex z);
1162 #if HAVE_DECL_CTANH == 0 1163 extern double _Complex ctanh(
double _Complex z);
1165 #if HAVE_DECL_CASINH == 0 1166 extern double _Complex casinh(
double _Complex z);
1168 #if HAVE_DECL_CACOSH == 0 1169 extern double _Complex cacosh(
double _Complex z);
1171 #if HAVE_DECL_CATANH == 0 1172 extern double _Complex catanh(
double _Complex z);
1174 #define COPYSIGN copysign 1175 #define NEXTAFTER nextafter 1179 #define NEARBYINT nearbyint 1183 #define LROUND lround 1184 #define LLRINT llrint 1185 #define LLROUND llround 1188 #define REMAINDER remainder 1189 #define REMQUO remquo 1210 #define SCALBN scalbn 1211 #define SCALBLN scalbln 1226 #define TGAMMA tgamma 1227 #define LGAMMA lgamma 1255 #define CASINH casinh 1256 #define CACOSH cacosh 1257 #define CATANH catanh 1260 #if defined(NFFT_LDOUBLE) 1261 #define EPSILON LDBL_EPSILON//4.0E-31L 1262 #define MANT_DIG LDBL_MANT_DIG 1263 #define MIN_EXP LDBL_MIN_EXP 1264 #define MAX_EXP LDBL_MAX_EXP 1265 #elif defined(NFFT_SINGLE) 1266 #define EPSILON FLT_EPSILON 1267 #define MANT_DIG FLT_MANT_DIG 1268 #define MIN_EXP FLT_MIN_EXP 1269 #define MAX_EXP FLT_MAX_EXP 1271 #define EPSILON DBL_EPSILON 1272 #define MANT_DIG DBL_MANT_DIG 1273 #define MIN_EXP DBL_MIN_EXP 1274 #define MAX_EXP DBL_MAX_EXP 1277 #if defined(FLT_ROUND) 1279 #define FLTROUND 1.0 1281 #define FLTROUND 0.0 1284 #define FLTROUND 0.0 1287 #if HAVE_DECL_DRAND48 == 0 1288 extern double drand48(
void);
1290 #if HAVE_DECL_SRAND48 == 0 1291 extern void srand48(
long int);
1293 #define R_RADIX FLT_RADIX 1294 #define II _Complex_I 1297 #if defined(NFFT_LDOUBLE) 1298 # define __FGS__ "Lg" 1299 # define __FES__ "LE" 1300 # define __FE__ "% 36.32LE" 1301 # define __FI__ "%Lf" 1302 # define __FIS__ "Lf" 1303 # define __FR__ "%Le" 1304 #elif defined(NFFT_SINGLE) 1305 # define __FGS__ "g" 1306 # define __FES__ "E" 1307 # define __FE__ "% 12.8E" 1308 # define __FI__ "%f" 1309 # define __FIS__ "f" 1310 # define __FR__ "%e" 1312 # define __FGS__ "lg" 1313 # define __FES__ "lE" 1314 # define __FE__ "% 20.16lE" 1315 # define __FI__ "%lf" 1316 # define __FIS__ "lf" 1317 # define __FR__ "%le" 1323 #if defined(_WIN32) || defined(_WIN64) 1324 # define __D__ "%Id" 1326 # define __D__ "%td" 1330 #define UNUSED(x) (void)x 1337 #define alloca __builtin_alloca 1344 #define alloca _alloca 1358 void *alloca(
size_t);
1366 #define STACK_MALLOC(T, p, x) p = (T)alloca(x) 1367 #define STACK_FREE(x) 1371 #define STACK_MALLOC(T, p, x) p = (T)Y(malloc)(x) 1372 #define STACK_FREE(x) Y(free)(x) 1376 R Y(elapsed_seconds)(ticks t1, ticks t0);
1379 #define UNUSED(x) (void)x 1389 double MEASURE_TIME_tt;
1390 ticks MEASURE_TIME_t0, MEASURE_TIME_t1;
1393 ths->MEASURE_TIME_t[(a)]=0; \ 1399 MEASURE_TIME_t0 = getticks(); \ 1404 MEASURE_TIME_t1 = getticks(); \ 1405 MEASURE_TIME_tt = Y(elapsed_seconds)(MEASURE_TIME_t1,MEASURE_TIME_t0);\ 1406 ths->MEASURE_TIME_t[(a)]+=MEASURE_TIME_tt; \ 1408 ths->MEASURE_TIME_t[(a)]/=MEASURE_TIME_r; \ 1415 #ifdef MEASURE_TIME_FFTW 1416 #define TIC_FFTW(a) TIC(a) 1417 #define TOC_FFTW(a) TOC(a) 1431 R Y(lambda)(R z, R eps);
1434 R Y(lambda2)(R mu, R nu);
1437 R Y(bessel_i0)(R x);
1440 R Y(bsplines)(
const INT,
const R x);
1443 typedef enum {NFFT_EPSILON = 0, NFFT_SAFE__MIN = 1, NFFT_BASE = 2,
1444 NFFT_PRECISION = 3, NFFT_MANT_DIG = 4, NFFT_FLTROUND = 5, NFFT_E_MIN = 6,
1445 NFFT_R_MIN = 7, NFFT_E_MAX = 8, NFFT_R_MAX = 9} float_property;
1447 R Y(float_property)(float_property);
1448 R Y(prod_real)(R *vec, INT d);
1451 INT Y(log2i)(
const INT m);
1452 void Y(next_power_of_2_exp)(
const INT N, INT *N2, INT *t);
1453 void Y(next_power_of_2_exp_int)(
const int N,
int *N2,
int *t);
1456 R Y(error_l_infty_double)(
const R *x,
const R *y,
const INT n);
1457 R Y(error_l_infty_1_double)(
const R *x,
const R *y,
const INT n,
const R *z,
1459 R Y(error_l_2_complex)(
const C *x,
const C *y,
const INT n);
1460 R Y(error_l_2_double)(
const R *x,
const R *y,
const INT n);
1463 void Y(sort_node_indices_radix_msdf)(INT n, INT *keys0, INT *keys1, INT rhigh);
1464 void Y(sort_node_indices_radix_lsdf)(INT n, INT *keys0, INT *keys1, INT rhigh);
1467 void Y(assertion_failed)(
const char *s,
int line,
const char *file);
1471 R Y(dot_double)(R *x, INT n);
1473 R Y(dot_w_complex)(C *x, R *w, INT n);
1475 R Y(dot_w_double)(R *x, R *w, INT n);
1477 R Y(dot_w_w2_complex)(C *x, R *w, R *w2, INT n);
1479 R Y(dot_w2_complex)(C *x, R *w2, INT n);
1483 void Y(cp_complex)(C *x, C *y, INT n);
1485 void Y(cp_double)(R *x, R *y, INT n);
1487 void Y(cp_a_complex)(C *x, R a, C *y, INT n);
1489 void Y(cp_a_double)(R *x, R a, R *y, INT n);
1491 void Y(cp_w_complex)(C *x, R *w, C *y, INT n);
1493 void Y(cp_w_double)(R *x, R *w, R *y, INT n);
1497 void Y(upd_axpy_double)(R *x, R a, R *y, INT n);
1499 void Y(upd_xpay_complex)(C *x, R a, C *y, INT n);
1501 void Y(upd_xpay_double)(R *x, R a, R *y, INT n);
1503 void Y(upd_axpby_complex)(C *x, R a, C *y, R b, INT n);
1505 void Y(upd_axpby_double)(R *x, R a, R *y, R b, INT n);
1507 void Y(upd_xpawy_complex)(C *x, R a, R *w, C *y, INT n);
1509 void Y(upd_xpawy_double)(R *x, R a, R *w, R *y, INT n);
1511 void Y(upd_axpwy_complex)(C *x, R a, R *w, C *y, INT n);
1513 void Y(upd_axpwy_double)(R *x, R a, R *w, R *y, INT n);
1516 void Y(voronoi_weights_1d)(R *w, R *x,
const INT M);
1523 R Y(modified_fejer)(
const INT N,
const INT kk);
1525 R Y(modified_jackson2)(
const INT N,
const INT kk);
1527 R Y(modified_jackson4)(
const INT N,
const INT kk);
1529 R Y(modified_sobolev)(
const R mu,
const INT kk);
1531 R Y(modified_multiquadric)(
const R mu,
const R c,
const INT kk);
1535 (void)((ex) || (Y(assertion_failed)(#ex, __LINE__, __FILE__), 0)) 1540 (void)((ex) || (Y(assertion_failed)(#ex, __LINE__, __FILE__), 0))