67#define CONCAT(prefix, name) prefix ## name
68#if defined(NFFT_SINGLE)
70typedef 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)
80typedef 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)
90typedef 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)
109#define DK(name, value) const R name = K(value)
111#if defined __CYGWIN32__ && !defined __CYGWIN__
115# define __CYGWIN__ __CYGWIN32__
120typedef ptrdiff_t INT;
122#define KPI K(3.1415926535897932384626433832795028841971693993751)
123#define K2PI K(6.2831853071795864769252867665590057683943387987502)
124#define K4PI K(12.5663706143591729538505735331180115367886775975004)
125#define KE K(2.7182818284590452353602874713526624977572470937000)
127#define IF(x,a,b) ((x)?(a):(b))
128#define MIN(a,b) (((a)<(b))?(a):(b))
129#define MAX(a,b) (((a)>(b))?(a):(b))
130#define ABS(x) (((x)>K(0.0))?(x):(-(x)))
131#define SIGN(a) (((a)>=0)?1:-1)
132#define SIGN(a) (((a)>=0)?1:-1)
133#define SIGNF(a) IF((a)<K(0.0),K(-1.0),K(1.0))
136#define SIZE(x) sizeof(x)/sizeof(x[0])
139#define CSWAP(x,y) {C* NFFT_SWAP_temp__; \
140 NFFT_SWAP_temp__=(x); (x)=(y); (y)=NFFT_SWAP_temp__;}
143#define RSWAP(x,y) {R* NFFT_SWAP_temp__; NFFT_SWAP_temp__=(x); \
144 (x)=(y); (y)=NFFT_SWAP_temp__;}
148#if defined(DIRAC_DELTA)
149 #define PHI_HUT(n,k,d) K(1.0)
150 #define PHI(n,x,d) IF(FABS((x)) < K(10E-8),K(1.0),K(0.0))
151 #define WINDOW_HELP_INIT(d)
152 #define WINDOW_HELP_FINALIZE
153 #define WINDOW_HELP_ESTIMATE_m 0
154#elif defined(GAUSSIAN)
155 #define PHI_HUT(n,k,d) ((R)EXP(-(POW(KPI*(k)/n,K(2.0))*ths->b[d])))
156 #define PHI(n,x,d) ((R)EXP(-POW((x)*((R)n),K(2.0)) / \
157 ths->b[d])/SQRT(KPI*ths->b[d]))
158 #define WINDOW_HELP_INIT \
161 ths->b = (R*) Y(malloc)(ths->d*sizeof(R)); \
162 for (WINDOW_idx = 0; WINDOW_idx < ths->d; WINDOW_idx++) \
163 ths->b[WINDOW_idx]=(K(2.0)*ths->sigma[WINDOW_idx]) / \
164 (K(2.0)*ths->sigma[WINDOW_idx] - K(1.0)) * (((R)ths->m) / KPI); \
166 #define WINDOW_HELP_FINALIZE {Y(free)(ths->b);}
167#if defined(NFFT_LDOUBLE)
168 #define WINDOW_HELP_ESTIMATE_m 17
169#elif defined(NFFT_SINGLE)
170 #define WINDOW_HELP_ESTIMATE_m 5
172 #define WINDOW_HELP_ESTIMATE_m 13
174#elif defined(B_SPLINE)
175 #define PHI_HUT(n,k,d) ((R)(((k) == 0) ? K(1.0) / n : \
176 POW(SIN((k) * KPI / n) / ((k) * KPI / n), \
178 #define PHI(n,x,d) (Y(bsplines)(2*ths->m,((x)*n) + \
180 #define WINDOW_HELP_INIT
181 #define WINDOW_HELP_FINALIZE
182#if defined(NFFT_LDOUBLE)
183 #define WINDOW_HELP_ESTIMATE_m 11
184#elif defined(NFFT_SINGLE)
185 #define WINDOW_HELP_ESTIMATE_m 11
187 #define WINDOW_HELP_ESTIMATE_m 11
189#elif defined(SINC_POWER)
190 #define PHI_HUT(n,k,d) (Y(bsplines)(2 * ths->m, (K(2.0) * ths->m*(k)) / \
191 ((K(2.0) * ths->sigma[(d)] - 1) * n / \
192 ths->sigma[(d)]) + (R)ths->m))
193 #define PHI(n,x,d) ((R)(n / ths->sigma[(d)] * \
194 (K(2.0) * ths->sigma[(d)] - K(1.0))/ (K(2.0)*ths->m) * \
195 POW(Y(sinc)(KPI * n / ths->sigma[(d)] * (x) * \
196 (K(2.0) * ths->sigma[(d)] - K(1.0)) / (K(2.0)*ths->m)) , 2*ths->m) / \
198 #define WINDOW_HELP_INIT
199 #define WINDOW_HELP_FINALIZE
200#if defined(NFFT_LDOUBLE)
201 #define WINDOW_HELP_ESTIMATE_m 13
202#elif defined(NFFT_SINGLE)
203 #define WINDOW_HELP_ESTIMATE_m 11
205 #define WINDOW_HELP_ESTIMATE_m 11
208 #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)))))
209 #define PHI(n,x,d) ( (((R)(ths->m) * (R)(ths->m) - (x) * (R)(n) * (x) * (R)(n)) > K(0.0)) \
210 ? SINH(ths->b[d] * SQRT((R)(ths->m) * (R)(ths->m) - (x) * (R)(n) * (x) * (R)(n))) \
211 / (KPI * SQRT((R)(ths->m) * (R)(ths->m) - (x) * (R)(n) * (x) * (R)(n))) \
212 : ((((R)(ths->m) * (R)(ths->m) - (x) * (R)(n) * (x) * (R)(n)) < K(0.0)) \
213 ? SIN(ths->b[d] * SQRT((x) * (R)(n) * (x) * (R)(n) - (R)(ths->m) * (R)(ths->m))) \
214 / (KPI * SQRT((x) * (R)(n) * (x) * (R)(n) - (R)(ths->m) * (R)(ths->m))) \
216 #define WINDOW_HELP_INIT \
219 ths->b = (R*) Y(malloc)((size_t)(ths->d) * sizeof(R)); \
220 for (WINDOW_idx = 0; WINDOW_idx < ths->d; WINDOW_idx++) \
221 ths->b[WINDOW_idx] = (KPI * (K(2.0) - K(1.0) / ths->sigma[WINDOW_idx])); \
223 #define WINDOW_HELP_FINALIZE {Y(free)(ths->b);}
224 #if defined(NFFT_LDOUBLE)
225 #define WINDOW_HELP_ESTIMATE_m 9
226 #elif defined(NFFT_SINGLE)
227 #define WINDOW_HELP_ESTIMATE_m 4
229 #define WINDOW_HELP_ESTIMATE_m 8
234INT Y(m2K)(
const INT m);
236#if defined(NFFT_LDOUBLE)
237#if HAVE_DECL_COPYSIGNL == 0
238extern long double copysignl(
long double,
long double);
240#if HAVE_DECL_NEXTAFTERL == 0
241extern long double nextafterl(
long double,
long double);
243#if HAVE_DECL_NANL == 0
244extern long double nanl(
const char *tag);
246#if HAVE_DECL_CEILL == 0
247extern long double ceill(
long double);
249#if HAVE_DECL_FLOORL == 0
250extern long double floorl(
long double);
252#if HAVE_DECL_NEARBYINTL == 0
253extern long double nearbyintl(
long double);
255#if HAVE_DECL_RINTL == 0
256extern long double rintl(
long double);
258#if HAVE_DECL_ROUNDL == 0
259extern long double roundl(
long double);
261#if HAVE_DECL_LRINTL == 0
262extern long int lrintl(
long double);
264#if HAVE_DECL_LROUNDL == 0
265extern long int lroundl(
long double);
267#if HAVE_DECL_LLRINTL == 0
268extern long long int llrintl(
long double);
270#if HAVE_DECL_LLROUNDL == 0
271extern long long int llroundl(
long double);
273#if HAVE_DECL_TRUNCL == 0
274extern long double truncl(
long double);
276#if HAVE_DECL_FMODL == 0
277extern long double fmodl(
long double,
long double);
279#if HAVE_DECL_REMAINDERL == 0
280extern long double remainderl(
long double,
long double);
282#if HAVE_DECL_REMQUOL == 0
283extern long double remquol(
long double x,
long double y,
int *);
285#if HAVE_DECL_FDIML == 0
286extern long double fdiml(
long double,
long double);
288#if HAVE_DECL_FMAXL == 0
289extern long double fmaxl(
long double,
long double);
291#if HAVE_DECL_FMINL == 0
292extern long double fminl(
long double,
long double);
294#if HAVE_DECL_FMAL == 0
295extern long double fmal(
long double x,
long double y,
long double z);
297#if HAVE_DECL_FABSL == 0
298extern long double fabsl(
long double);
300#if HAVE_DECL_SQRTL == 0
301extern long double sqrtl(
long double);
303#if HAVE_DECL_CBRTL == 0
304extern long double cbrtl(
long double);
306#if HAVE_DECL_HYPOTL == 0
307extern long double hypotl(
long double,
long double);
309#if HAVE_DECL_EXPL == 0
310extern long double expl(
long double);
312#if HAVE_DECL_EXP2L == 0
313extern long double exp2l(
long double);
315#if HAVE_DECL_EXPM1L == 0
316extern long double expm1l(
long double);
318#if HAVE_DECL_LOGL == 0
319extern long double logl(
long double);
321#if HAVE_DECL_LOG2L == 0
322extern long double log2l(
long double);
324#if HAVE_DECL_LOG10L == 0
325extern long double log10l(
long double);
327#if HAVE_DECL_LOG1PL == 0
328extern long double log1pl(
long double);
330#if HAVE_DECL_LOGBL == 0
331extern long double logbl(
long double);
333#if HAVE_DECL_ILOGBL == 0
334extern int ilogbl(
long double);
336#if HAVE_DECL_MODFL == 0
337extern long double modfl(
long double,
long double *);
339#if HAVE_DECL_FREXPL == 0
340extern long double frexpl(
long double,
int *);
342#if HAVE_DECL_LDEXPL == 0
343extern long double ldexpl(
long double,
int);
345#if HAVE_DECL_SCALBNL == 0
346extern long double scalbnl(
long double,
int);
348#if HAVE_DECL_SCALBLNL == 0
349extern long double scalblnl(
long double,
long int);
351#if HAVE_DECL_POWL == 0
352extern long double powl(
long double,
long double);
354#if HAVE_DECL_COSL == 0
355extern long double cosl(
long double);
357#if HAVE_DECL_SINL == 0
358extern long double sinl(
long double);
360#if HAVE_DECL_TANL == 0
361extern long double tanl(
long double);
363#if HAVE_DECL_COSHL == 0
364extern long double coshl(
long double);
366#if HAVE_DECL_SINHL == 0
367extern long double sinhl(
long double);
369#if HAVE_DECL_TANHL == 0
370extern long double tanhl(
long double);
372#if HAVE_DECL_ACOSL == 0
373extern long double acosl(
long double);
375#if HAVE_DECL_ASINL == 0
376extern long double asinl(
long double);
378#if HAVE_DECL_ATANL == 0
379extern long double atanl(
long double);
381#if HAVE_DECL_ATAN2L == 0
382extern long double atan2l(
long double,
long double);
384#if HAVE_DECL_ACOSHL == 0
385extern long double acoshl(
long double);
387#if HAVE_DECL_ASINHL == 0
388extern long double asinhl(
long double);
390#if HAVE_DECL_ATANHL == 0
391extern long double atanhl(
long double);
393#if HAVE_DECL_TGAMMAL == 0
394extern long double tgammal(
long double);
396#if HAVE_DECL_LGAMMAL == 0
397extern long double lgammal(
long double);
399#if HAVE_DECL_J0L == 0
400extern long double j0l(
long double);
402#if HAVE_DECL_J1L == 0
403extern long double j1l(
long double);
405#if HAVE_DECL_JNL == 0
406extern long double jnl(
int,
long double);
408#if HAVE_DECL_Y0L == 0
409extern long double y0l(
long double);
411#if HAVE_DECL_Y1L == 0
412extern long double y1l(
long double);
414#if HAVE_DECL_YNL == 0
415extern long double ynl(
int,
long double);
417#if HAVE_DECL_ERFL == 0
418extern long double erfl(
long double);
420#if HAVE_DECL_ERFCL == 0
421extern long double erfcl(
long double);
423#if HAVE_DECL_CREALL == 0
424extern long double creall(
long double _Complex z);
426#if HAVE_DECL_CIMAGL == 0
427extern long double cimagl(
long double _Complex z);
429#if HAVE_DECL_CABSL == 0
430extern long double cabsl(
long double _Complex z);
432#if HAVE_DECL_CARGL == 0
433extern long double cargl(
long double _Complex z);
435#if HAVE_DECL_CONJL == 0
436extern long double _Complex conjl(
long double _Complex z);
438#if HAVE_DECL_CPROJL == 0
439extern long double _Complex cprojl(
long double _Complex z);
441#if HAVE_DECL_CSQRTL == 0
442extern long double _Complex csqrtl(
long double _Complex z);
444#if HAVE_DECL_CEXPL == 0
445extern long double _Complex cexpl(
long double _Complex z);
447#if HAVE_DECL_CLOGL == 0
448extern long double _Complex clogl(
long double _Complex z);
450#if HAVE_DECL_CPOWL == 0
451extern long double _Complex cpowl(
long double _Complex z,
long double _Complex w);
453#if HAVE_DECL_CSINL == 0
454extern long double _Complex csinl(
long double _Complex z);
456#if HAVE_DECL_CCOSL == 0
457extern long double _Complex ccosl(
long double _Complex z);
459#if HAVE_DECL_CTANL == 0
460extern long double _Complex ctanl(
long double _Complex z);
462#if HAVE_DECL_CASINL == 0
463extern long double _Complex casinl(
long double _Complex z);
465#if HAVE_DECL_CACOSL == 0
466extern long double _Complex cacosl(
long double _Complex z);
468#if HAVE_DECL_CATANL == 0
469extern long double _Complex catanl(
long double _Complex z);
471#if HAVE_DECL_CSINHL == 0
472extern long double _Complex csinhl(
long double _Complex z);
474#if HAVE_DECL_CCOSHL == 0
475extern long double _Complex ccoshl(
long double _Complex z);
477#if HAVE_DECL_CTANHL == 0
478extern long double _Complex ctanhl(
long double _Complex z);
480#if HAVE_DECL_CASINHL == 0
481extern long double _Complex casinhl(
long double _Complex z);
483#if HAVE_DECL_CACOSHL == 0
484extern long double _Complex cacoshl(
long double _Complex z);
486#if HAVE_DECL_CATANHL == 0
487extern long double _Complex catanhl(
long double _Complex z);
489#define COPYSIGN copysignl
490#define NEXTAFTER nextafterl
494#define NEARBYINT nearbyintl
498#define LROUND lroundl
499#define LLRINT llrintl
500#define LLROUND llroundl
503#define REMAINDER remainderl
504#define REMQUO remquol
525#define SCALBN scalbnl
526#define SCALBLN scalblnl
541#define TGAMMA tgammal
542#define LGAMMA lgammal
570#define CASINH casinhl
571#define CACOSH cacoshl
572#define CATANH catanhl
573#elif defined(NFFT_SINGLE)
574#if HAVE_DECL_COPYSIGNF == 0
575extern float copysignf(
float,
float);
577#if HAVE_DECL_NEXTAFTERF == 0
578extern float nextafterf(
float,
float);
580#if HAVE_DECL_NANF == 0
581extern float nanf(
const char *tag);
583#if HAVE_DECL_CEILF == 0
584extern float ceilf(
float);
586#if HAVE_DECL_FLOORF == 0
587extern float floorf(
float);
589#if HAVE_DECL_NEARBYINTF == 0
590extern float nearbyintf(
float);
592#if HAVE_DECL_RINTF == 0
593extern float rintf(
float);
595#if HAVE_DECL_ROUNDF == 0
596extern float roundf(
float);
598#if HAVE_DECL_LRINTF == 0
599extern long int lrintf(
float);
601#if HAVE_DECL_LROUNDF == 0
602extern long int lroundf(
float);
604#if HAVE_DECL_LLRINTF == 0
605extern long long int llrintf(
float);
607#if HAVE_DECL_LLROUNDF == 0
608extern long long int llroundf(
float);
610#if HAVE_DECL_TRUNCF == 0
611extern float truncf(
float);
613#if HAVE_DECL_FMODF == 0
614extern float fmodf(
float,
float);
616#if HAVE_DECL_REMAINDERF == 0
617extern float remainderf(
float,
float);
619#if HAVE_DECL_REMQUOF == 0
620extern float remquof(
float x,
float y,
int *);
622#if HAVE_DECL_FDIMF == 0
623extern float fdimf(
float,
float);
625#if HAVE_DECL_FMAXF == 0
626extern float fmaxf(
float,
float);
628#if HAVE_DECL_FMINF == 0
629extern float fminf(
float,
float);
631#if HAVE_DECL_FMAF == 0
632extern float fmaf(
float x,
float y,
float z);
634#if HAVE_DECL_FABSF == 0
635extern float fabsf(
float);
637#if HAVE_DECL_SQRTF == 0
638extern float sqrtf(
float);
640#if HAVE_DECL_CBRTF == 0
641extern float cbrtf(
float);
643#if HAVE_DECL_HYPOTF == 0
644extern float hypotf(
float,
float);
646#if HAVE_DECL_EXPF == 0
647extern float expf(
float);
649#if HAVE_DECL_EXP2F == 0
650extern float exp2f(
float);
652#if HAVE_DECL_EXPM1F == 0
653extern float expm1f(
float);
655#if HAVE_DECL_LOGF == 0
656extern float logf(
float);
658#if HAVE_DECL_LOG2F == 0
659extern float log2f(
float);
661#if HAVE_DECL_LOG10F == 0
662extern float log10f(
float);
664#if HAVE_DECL_LOG1PF == 0
665extern float log1pf(
float);
667#if HAVE_DECL_LOGBF == 0
668extern float logbf(
float);
670#if HAVE_DECL_ILOGBF == 0
671extern int ilogbf(
float);
673#if HAVE_DECL_MODFF == 0
674extern float modff(
float,
float *);
676#if HAVE_DECL_FREXPF == 0
677extern float frexpf(
float,
int *);
679#if HAVE_DECL_LDEXPF == 0
680extern float ldexpf(
float,
int);
682#if HAVE_DECL_SCALBNF == 0
683extern float scalbnf(
float,
int);
685#if HAVE_DECL_SCALBLNF == 0
686extern float scalblnf(
float,
long int);
688#if HAVE_DECL_POWF == 0
689extern float powf(
float,
float);
691#if HAVE_DECL_COSF == 0
692extern float cosf(
float);
694#if HAVE_DECL_SINF == 0
695extern float sinf(
float);
697#if HAVE_DECL_TANF == 0
698extern float tanf(
float);
700#if HAVE_DECL_COSHF == 0
701extern float coshf(
float);
703#if HAVE_DECL_SINHF == 0
704extern float sinhf(
float);
706#if HAVE_DECL_TANHF == 0
707extern float tanhf(
float);
709#if HAVE_DECL_ACOSF == 0
710extern float acosf(
float);
712#if HAVE_DECL_ASINF == 0
713extern float asinf(
float);
715#if HAVE_DECL_ATANF == 0
716extern float atanf(
float);
718#if HAVE_DECL_ATAN2F == 0
719extern float atan2f(
float,
float);
721#if HAVE_DECL_ACOSHF == 0
722extern float acoshf(
float);
724#if HAVE_DECL_ASINHF == 0
725extern float asinhf(
float);
727#if HAVE_DECL_ATANHF == 0
728extern float atanhf(
float);
730#if HAVE_DECL_TGAMMAF == 0
731extern float tgammaf(
float);
733#if HAVE_DECL_LGAMMAF == 0
734extern float lgammaf(
float);
736#if HAVE_DECL_J0F == 0
737extern float j0f(
float);
739#if HAVE_DECL_J1F == 0
740extern float j1f(
float);
742#if HAVE_DECL_JNF == 0
743extern float jnf(
int,
float);
745#if HAVE_DECL_Y0F == 0
746extern float y0f(
float);
748#if HAVE_DECL_Y1F == 0
749extern float y1f(
float);
751#if HAVE_DECL_YNF == 0
752extern float ynf(
int,
float);
754#if HAVE_DECL_ERFF == 0
755extern float erff(
float);
757#if HAVE_DECL_ERFCF == 0
758extern float erfcf(
float);
760#if HAVE_DECL_CREALF == 0
761extern float crealf(
float _Complex z);
763#if HAVE_DECL_CIMAGF == 0
764extern float cimagf(
float _Complex z);
766#if HAVE_DECL_CABSF == 0
767extern float cabsf(
float _Complex z);
769#if HAVE_DECL_CARGF == 0
770extern float cargf(
float _Complex z);
772#if HAVE_DECL_CONJF == 0
773extern float _Complex conjf(
float _Complex z);
775#if HAVE_DECL_CPROJF == 0
776extern float _Complex cprojf(
float _Complex z);
778#if HAVE_DECL_CSQRTF == 0
779extern float _Complex csqrtf(
float _Complex z);
781#if HAVE_DECL_CEXPF == 0
782extern float _Complex cexpf(
float _Complex z);
784#if HAVE_DECL_CLOGF == 0
785extern float _Complex clogf(
float _Complex z);
787#if HAVE_DECL_CPOWF == 0
788extern float _Complex cpowf(
float _Complex z,
float _Complex w);
790#if HAVE_DECL_CSINF == 0
791extern float _Complex csinf(
float _Complex z);
793#if HAVE_DECL_CCOSF == 0
794extern float _Complex ccosf(
float _Complex z);
796#if HAVE_DECL_CTANF == 0
797extern float _Complex ctanf(
float _Complex z);
799#if HAVE_DECL_CASINF == 0
800extern float _Complex casinf(
float _Complex z);
802#if HAVE_DECL_CACOSF == 0
803extern float _Complex cacosf(
float _Complex z);
805#if HAVE_DECL_CATANF == 0
806extern float _Complex catanf(
float _Complex z);
808#if HAVE_DECL_CSINHF == 0
809extern float _Complex csinhf(
float _Complex z);
811#if HAVE_DECL_CCOSHF == 0
812extern float _Complex ccoshf(
float _Complex z);
814#if HAVE_DECL_CTANHF == 0
815extern float _Complex ctanhf(
float _Complex z);
817#if HAVE_DECL_CASINHF == 0
818extern float _Complex casinhf(
float _Complex z);
820#if HAVE_DECL_CACOSHF == 0
821extern float _Complex cacoshf(
float _Complex z);
823#if HAVE_DECL_CATANHF == 0
824extern float _Complex catanhf(
float _Complex z);
826#define COPYSIGN copysignf
827#define NEXTAFTER nextafterf
831#define NEARBYINT nearbyintf
835#define LROUND lroundf
836#define LLRINT llrintf
837#define LLROUND llroundf
840#define REMAINDER remainderf
841#define REMQUO remquof
862#define SCALBN scalbnf
863#define SCALBLN scalblnf
878#define TGAMMA tgammaf
879#define LGAMMA lgammaf
907#define CASINH casinhf
908#define CACOSH cacoshf
909#define CATANH catanhf
911#if HAVE_DECL_COPYSIGN == 0
912extern double copysign(
double,
double);
914#if HAVE_DECL_NEXTAFTER == 0
915extern double nextafter(
double,
double);
917#if HAVE_DECL_NAN == 0
918extern double nan(
const char *tag);
920#if HAVE_DECL_CEIL == 0
921extern double ceil(
double);
923#if HAVE_DECL_FLOOR == 0
924extern double floor(
double);
926#if HAVE_DECL_NEARBYINT == 0
927extern double nearbyint(
double);
929#if HAVE_DECL_RINT == 0
930extern double rint(
double);
932#if HAVE_DECL_ROUND == 0
933extern double round(
double);
935#if HAVE_DECL_LRINT == 0
936extern long int lrint(
double);
938#if HAVE_DECL_LROUND == 0
939extern long int lround(
double);
941#if HAVE_DECL_LLRINT == 0
942extern long long int llrint(
double);
944#if HAVE_DECL_LLROUND == 0
945extern long long int llround(
double);
947#if HAVE_DECL_TRUNC == 0
948extern double trunc(
double);
950#if HAVE_DECL_FMOD == 0
951extern double fmod(
double,
double);
953#if HAVE_DECL_REMAINDER == 0
954extern double remainder(
double,
double);
956#if HAVE_DECL_REMQUO == 0
957extern double remquo(
double x,
double y,
int *);
959#if HAVE_DECL_FDIM == 0
960extern double fdim(
double,
double);
962#if HAVE_DECL_FMAX == 0
963extern double fmax(
double,
double);
965#if HAVE_DECL_FMIN == 0
966extern double fmin(
double,
double);
968#if HAVE_DECL_FMA == 0
969extern double fma(
double x,
double y,
double z);
971#if HAVE_DECL_FABS == 0
972extern double fabs(
double);
974#if HAVE_DECL_SQRT == 0
975extern double sqrt(
double);
977#if HAVE_DECL_CBRT == 0
978extern double cbrt(
double);
980#if HAVE_DECL_HYPOT == 0
981extern double hypot(
double,
double);
983#if HAVE_DECL_EXP == 0
984extern double exp(
double);
986#if HAVE_DECL_EXP2 == 0
987extern double exp2(
double);
989#if HAVE_DECL_EXPM1 == 0
990extern double expm1(
double);
992#if HAVE_DECL_LOG == 0
993extern double log(
double);
995#if HAVE_DECL_LOG2 == 0
996extern double log2(
double);
998#if HAVE_DECL_LOG10 == 0
999extern double log10(
double);
1001#if HAVE_DECL_LOG1P == 0
1002extern double log1p(
double);
1004#if HAVE_DECL_LOGB == 0
1005extern double logb(
double);
1007#if HAVE_DECL_ILOGB == 0
1008extern int ilogb(
double);
1010#if HAVE_DECL_MODF == 0
1011extern double modf(
double,
double *);
1013#if HAVE_DECL_FREXP == 0
1014extern double frexp(
double,
int *);
1016#if HAVE_DECL_LDEXP == 0
1017extern double ldexp(
double,
int);
1019#if HAVE_DECL_SCALBN == 0
1020extern double scalbn(
double,
int);
1022#if HAVE_DECL_SCALBLN == 0
1023extern double scalbln(
double,
long int);
1025#if HAVE_DECL_POW == 0
1026extern double pow(
double,
double);
1028#if HAVE_DECL_COS == 0
1029extern double cos(
double);
1031#if HAVE_DECL_SIN == 0
1032extern double sin(
double);
1034#if HAVE_DECL_TAN == 0
1035extern double tan(
double);
1037#if HAVE_DECL_COSH == 0
1038extern double cosh(
double);
1040#if HAVE_DECL_SINH == 0
1041extern double sinh(
double);
1043#if HAVE_DECL_TANH == 0
1044extern double tanh(
double);
1046#if HAVE_DECL_ACOS == 0
1047extern double acos(
double);
1049#if HAVE_DECL_ASIN == 0
1050extern double asin(
double);
1052#if HAVE_DECL_ATAN == 0
1053extern double atan(
double);
1055#if HAVE_DECL_ATAN2 == 0
1056extern double atan2(
double,
double);
1058#if HAVE_DECL_ACOSH == 0
1059extern double acosh(
double);
1061#if HAVE_DECL_ASINH == 0
1062extern double asinh(
double);
1064#if HAVE_DECL_ATANH == 0
1065extern double atanh(
double);
1067#if HAVE_DECL_TGAMMA == 0
1068extern double tgamma(
double);
1070#if HAVE_DECL_LGAMMA == 0
1071extern double lgamma(
double);
1073#if HAVE_DECL_J0 == 0
1074extern double j0(
double);
1076#if HAVE_DECL_J1 == 0
1077extern double j1(
double);
1079#if HAVE_DECL_JN == 0
1080extern double jn(
int,
double);
1082#if HAVE_DECL_Y0 == 0
1083extern double y0(
double);
1085#if HAVE_DECL_Y1 == 0
1086extern double y1(
double);
1088#if HAVE_DECL_YN == 0
1089extern double yn(
int,
double);
1091#if HAVE_DECL_ERF == 0
1092extern double erf(
double);
1094#if HAVE_DECL_ERFC == 0
1095extern double erfc(
double);
1097#if HAVE_DECL_CREAL == 0
1098extern double creal(
double _Complex z);
1100#if HAVE_DECL_CIMAG == 0
1101extern double cimag(
double _Complex z);
1103#if HAVE_DECL_CABS == 0
1104extern double cabs(
double _Complex z);
1106#if HAVE_DECL_CARG == 0
1107extern double carg(
double _Complex z);
1109#if HAVE_DECL_CONJ == 0
1110extern double _Complex conj(
double _Complex z);
1112#if HAVE_DECL_CPROJ == 0
1113extern double _Complex cproj(
double _Complex z);
1115#if HAVE_DECL_CSQRT == 0
1116extern double _Complex csqrt(
double _Complex z);
1118#if HAVE_DECL_CEXP == 0
1119extern double _Complex cexp(
double _Complex z);
1121#if HAVE_DECL_CLOG == 0
1122extern double _Complex clog(
double _Complex z);
1124#if HAVE_DECL_CPOW == 0
1125extern double _Complex cpow(
double _Complex z,
double _Complex w);
1127#if HAVE_DECL_CSIN == 0
1128extern double _Complex csin(
double _Complex z);
1130#if HAVE_DECL_CCOS == 0
1131extern double _Complex ccos(
double _Complex z);
1133#if HAVE_DECL_CTAN == 0
1134extern double _Complex ctan(
double _Complex z);
1136#if HAVE_DECL_CASIN == 0
1137extern double _Complex casin(
double _Complex z);
1139#if HAVE_DECL_CACOS == 0
1140extern double _Complex cacos(
double _Complex z);
1142#if HAVE_DECL_CATAN == 0
1143extern double _Complex catan(
double _Complex z);
1145#if HAVE_DECL_CSINH == 0
1146extern double _Complex csinh(
double _Complex z);
1148#if HAVE_DECL_CCOSH == 0
1149extern double _Complex ccosh(
double _Complex z);
1151#if HAVE_DECL_CTANH == 0
1152extern double _Complex ctanh(
double _Complex z);
1154#if HAVE_DECL_CASINH == 0
1155extern double _Complex casinh(
double _Complex z);
1157#if HAVE_DECL_CACOSH == 0
1158extern double _Complex cacosh(
double _Complex z);
1160#if HAVE_DECL_CATANH == 0
1161extern double _Complex catanh(
double _Complex z);
1163#define COPYSIGN copysign
1164#define NEXTAFTER nextafter
1168#define NEARBYINT nearbyint
1172#define LROUND lround
1173#define LLRINT llrint
1174#define LLROUND llround
1177#define REMAINDER remainder
1178#define REMQUO remquo
1199#define SCALBN scalbn
1200#define SCALBLN scalbln
1215#define TGAMMA tgamma
1216#define LGAMMA lgamma
1244#define CASINH casinh
1245#define CACOSH cacosh
1246#define CATANH catanh
1249#if defined(NFFT_LDOUBLE)
1250 #define MANT_DIG LDBL_MANT_DIG
1251 #define MIN_EXP LDBL_MIN_EXP
1252 #define MAX_EXP LDBL_MAX_EXP
1253 #define EPSILON LDBL_EPSILON
1254#elif defined(NFFT_SINGLE)
1255 #define MANT_DIG FLT_MANT_DIG
1256 #define MIN_EXP FLT_MIN_EXP
1257 #define MAX_EXP FLT_MAX_EXP
1258 #define EPSILON FLT_EPSILON
1260 #define MANT_DIG DBL_MANT_DIG
1261 #define MIN_EXP DBL_MIN_EXP
1262 #define MAX_EXP DBL_MAX_EXP
1263 #define EPSILON DBL_EPSILON
1266#if defined(FLT_ROUND)
1268 #define FLTROUND 1.0
1270 #define FLTROUND 0.0
1273 #define FLTROUND 0.0
1276#if HAVE_DECL_DRAND48 == 0
1277 extern double drand48(
void);
1279#if HAVE_DECL_SRAND48 == 0
1280 extern void srand48(
long int);
1282#define R_RADIX FLT_RADIX
1283#define II _Complex_I
1286#if defined(NFFT_LDOUBLE)
1287# define __FGS__ "Lg"
1288# define __FES__ "LE"
1289# define __FE__ "% 36.32LE"
1290# define __FI__ "%Lf"
1291# define __FIS__ "Lf"
1292# define __FR__ "%Le"
1293#elif defined(NFFT_SINGLE)
1296# define __FE__ "% 12.8E"
1301# define __FGS__ "lg"
1302# define __FES__ "lE"
1303# define __FE__ "% 20.16lE"
1304# define __FI__ "%lf"
1305# define __FIS__ "lf"
1306# define __FR__ "%le"
1312#if defined(_WIN32) || defined(_WIN64)
1319#define UNUSED(x) (void)x
1326 #define alloca __builtin_alloca
1333 #define alloca _alloca
1347 void *alloca(
size_t);
1355 #define STACK_MALLOC(T, p, x) p = (T)alloca(x)
1356 #define STACK_FREE(x)
1360 #define STACK_MALLOC(T, p, x) p = (T)Y(malloc)(x)
1361 #define STACK_FREE(x) Y(free)(x)
1365R Y(elapsed_seconds)(ticks t1, ticks t0);
1368#define UNUSED(x) (void)x
1378 double MEASURE_TIME_tt;
1379 ticks MEASURE_TIME_t0, MEASURE_TIME_t1;
1382 ths->MEASURE_TIME_t[(a)]=0; \
1388 MEASURE_TIME_t0 = getticks(); \
1393 MEASURE_TIME_t1 = getticks(); \
1394 MEASURE_TIME_tt = Y(elapsed_seconds)(MEASURE_TIME_t1,MEASURE_TIME_t0);\
1395 ths->MEASURE_TIME_t[(a)]+=MEASURE_TIME_tt; \
1397 ths->MEASURE_TIME_t[(a)]/=MEASURE_TIME_r; \
1404#ifdef MEASURE_TIME_FFTW
1405#define TIC_FFTW(a) TIC(a)
1406#define TOC_FFTW(a) TOC(a)
1420R Y(lambda)(R z, R eps);
1423R Y(lambda2)(R mu, R nu);
1429R Y(bsplines)(
const INT,
const R x);
1432typedef enum {NFFT_EPSILON = 0, NFFT_SAFE__MIN = 1, NFFT_BASE = 2,
1433 NFFT_PRECISION = 3, NFFT_MANT_DIG = 4, NFFT_FLTROUND = 5, NFFT_E_MIN = 6,
1434 NFFT_R_MIN = 7, NFFT_E_MAX = 8, NFFT_R_MAX = 9 } float_property;
1436R Y(float_property)(float_property);
1437R Y(prod_real)(R *vec, INT d);
1440INT Y(log2i)(
const INT m);
1441void Y(next_power_of_2_exp)(
const INT N, INT *N2, INT *t);
1442void Y(next_power_of_2_exp_int)(
const int N,
int *N2,
int *t);
1445 R Y(error_l_infty_double)(
const R *x,
const R *y,
const INT n);
1446 R Y(error_l_infty_1_double)(
const R *x,
const R *y,
const INT n,
const R *z,
1448R Y(error_l_2_complex)(
const C *x,
const C *y,
const INT n);
1449 R Y(error_l_2_double)(
const R *x,
const R *y,
const INT n);
1452void Y(sort_node_indices_radix_msdf)(INT n, INT *keys0, INT *keys1, INT rhigh);
1453void Y(sort_node_indices_radix_lsdf)(INT n, INT *keys0, INT *keys1, INT rhigh);
1456void Y(assertion_failed)(
const char *s,
int line,
const char *file);
1460R Y(dot_double)(R *x, INT n);
1462R Y(dot_w_complex)(C *x, R *w, INT n);
1464R Y(dot_w_double)(R *x, R *w, INT n);
1466R Y(dot_w_w2_complex)(C *x, R *w, R *w2, INT n);
1468R Y(dot_w2_complex)(C *x, R *w2, INT n);
1472void Y(cp_complex)(C *x, C *y, INT n);
1474void Y(cp_double)(R *x, R *y, INT n);
1476void Y(cp_a_complex)(C *x, R a, C *y, INT n);
1478void Y(cp_a_double)(R *x, R a, R *y, INT n);
1480void Y(cp_w_complex)(C *x, R *w, C *y, INT n);
1482void Y(cp_w_double)(R *x, R *w, R *y, INT n);
1486void Y(upd_axpy_double)(R *x, R a, R *y, INT n);
1488void Y(upd_xpay_complex)(C *x, R a, C *y, INT n);
1490void Y(upd_xpay_double)(R *x, R a, R *y, INT n);
1492void Y(upd_axpby_complex)(C *x, R a, C *y, R b, INT n);
1494void Y(upd_axpby_double)(R *x, R a, R *y, R b, INT n);
1496void Y(upd_xpawy_complex)(C *x, R a, R *w, C *y, INT n);
1498void Y(upd_xpawy_double)(R *x, R a, R *w, R *y, INT n);
1500void Y(upd_axpwy_complex)(C *x, R a, R *w, C *y, INT n);
1502void Y(upd_axpwy_double)(R *x, R a, R *w, R *y, INT n);
1505void Y(voronoi_weights_1d)(R *w, R *x,
const INT M);
1512R Y(modified_fejer)(
const INT N,
const INT kk);
1514R Y(modified_jackson2)(
const INT N,
const INT kk);
1516R Y(modified_jackson4)(
const INT N,
const INT kk);
1518R Y(modified_sobolev)(
const R mu,
const INT kk);
1520R Y(modified_multiquadric)(
const R mu,
const R c,
const INT kk);
1524 (void)((ex) || (Y(assertion_failed)(#ex, __LINE__, __FILE__), 0))
1529 (void)((ex) || (Y(assertion_failed)(#ex, __LINE__, __FILE__), 0))