summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/builtin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/builtin.cc')
-rw-r--r--Build/source/utils/asymptote/builtin.cc724
1 files changed, 23 insertions, 701 deletions
diff --git a/Build/source/utils/asymptote/builtin.cc b/Build/source/utils/asymptote/builtin.cc
index 2e95dc2f394..7435d08cb7a 100644
--- a/Build/source/utils/asymptote/builtin.cc
+++ b/Build/source/utils/asymptote/builtin.cc
@@ -37,14 +37,11 @@
#include "settings.h"
#include "opsymbols.h"
-#include "builtin.symbols.h"
-#ifdef HAVE_LIBGSL
-#include <gsl/gsl_math.h>
-#include <gsl/gsl_sf.h>
-#include <gsl/gsl_errno.h>
+#ifndef NOSYM
+#include "builtin.symbols.h"
#endif
-
+
using namespace types;
using namespace camp;
using namespace vm;
@@ -75,7 +72,7 @@ void gen_runtriple_venv(venv &ve);
void gen_runpath_venv(venv &ve);
void gen_runpath3d_venv(venv &ve);
void gen_runmath_venv(venv &ve);
-
+void gen_rungsl_venv(venv &ve);
void addType(tenv &te, symbol name, ty *t)
{
@@ -215,411 +212,6 @@ void addRealIntFunc(venv& ve, symbol name, symbol arg1,
addFunc(ve, realRealInt<fcn>, primReal(), name, formal(primReal(), arg1),
formal(primInt(), arg2));
}
-
-#ifdef HAVE_LIBGSL
-bool GSLerror=false;
-
-types::dummyRecord *GSLModule;
-
-types::record *getGSLModule()
-{
- return GSLModule;
-}
-
-inline void checkGSLerror()
-{
- if(GSLerror) {
- GSLerror=false;
- throw handled_error();
- }
-}
-
-template <double (*func)(double)>
-void realRealGSL(vm::stack *s)
-{
- double x=pop<double>(s);
- s->push(func(x));
- checkGSLerror();
-}
-
-template <double (*func)(double, gsl_mode_t)>
-void realRealDOUBLE(vm::stack *s)
-{
- double x=pop<double>(s);
- s->push(func(x,GSL_PREC_DOUBLE));
- checkGSLerror();
-}
-
-template <double (*func)(double, double, gsl_mode_t)>
-void realRealRealDOUBLE(vm::stack *s)
-{
- double y=pop<double>(s);
- double x=pop<double>(s);
- s->push(func(x,y,GSL_PREC_DOUBLE));
- checkGSLerror();
-}
-
-template <double (*func)(unsigned)>
-void realIntGSL(vm::stack *s)
-{
- s->push(func(unsignedcast(pop<Int>(s))));
- checkGSLerror();
-}
-
-template <double (*func)(int, double)>
-void realIntRealGSL(vm::stack *s)
-{
- double x=pop<double>(s);
-
- s->push(func(intcast(pop<Int>(s)),x));
- checkGSLerror();
-}
-
-template <double (*func)(double, double)>
-void realRealRealGSL(vm::stack *s)
-{
- double x=pop<double>(s);
- double n=pop<double>(s);
- s->push(func(n,x));
- checkGSLerror();
-}
-
-template <int (*func)(double, double, double)>
-void intRealRealRealGSL(vm::stack *s)
-{
- double x=pop<double>(s);
- double n=pop<double>(s);
- double a=pop<double>(s);
- s->push(func(a,n,x));
- checkGSLerror();
-}
-
-template <double (*func)(double, double, double)>
-void realRealRealRealGSL(vm::stack *s)
-{
- double x=pop<double>(s);
- double n=pop<double>(s);
- double a=pop<double>(s);
- s->push(func(a,n,x));
- checkGSLerror();
-}
-
-template <double (*func)(double, unsigned)>
-void realRealIntGSL(vm::stack *s)
-{
- Int n=pop<Int>(s);
- double x=pop<double>(s);
- s->push(func(x,unsignedcast(n)));
- checkGSLerror();
-}
-
-// Add a GSL special function from the GNU GSL library
-template<double (*fcn)(double)>
-void addGSLRealFunc(symbol name, symbol arg1=SYM(x))
-{
- addFunc(GSLModule->e.ve, realRealGSL<fcn>, primReal(), name,
- formal(primReal(),arg1));
-}
-
-// Add a GSL_PREC_DOUBLE GSL special function.
-template<double (*fcn)(double, gsl_mode_t)>
-void addGSLDOUBLEFunc(symbol name, symbol arg1=SYM(x))
-{
- addFunc(GSLModule->e.ve, realRealDOUBLE<fcn>, primReal(), name,
- formal(primReal(),arg1));
-}
-
-template<double (*fcn)(double, double, gsl_mode_t)>
-void addGSLDOUBLE2Func(symbol name, symbol arg1=SYM(phi),
- symbol arg2=SYM(k))
-{
- addFunc(GSLModule->e.ve, realRealRealDOUBLE<fcn>, primReal(), name,
- formal(primReal(),arg1), formal(primReal(),arg2));
-}
-
-template <double (*func)(double, double, double, gsl_mode_t)>
-void realRealRealRealDOUBLE(vm::stack *s)
-{
- double z=pop<double>(s);
- double y=pop<double>(s);
- double x=pop<double>(s);
- s->push(func(x,y,z,GSL_PREC_DOUBLE));
- checkGSLerror();
-}
-
-template<double (*fcn)(double, double, double, gsl_mode_t)>
-void addGSLDOUBLE3Func(symbol name, symbol arg1, symbol arg2,
- symbol arg3)
-{
- addFunc(GSLModule->e.ve, realRealRealRealDOUBLE<fcn>, primReal(), name,
- formal(primReal(),arg1), formal(primReal(),arg2),
- formal(primReal(), arg3));
-}
-
-template <double (*func)(double, double, double, double, gsl_mode_t)>
-void realRealRealRealRealDOUBLE(vm::stack *s)
-{
- double z=pop<double>(s);
- double y=pop<double>(s);
- double x=pop<double>(s);
- double w=pop<double>(s);
- s->push(func(w,x,y,z,GSL_PREC_DOUBLE));
- checkGSLerror();
-}
-
-template<double (*fcn)(double, double, double, double, gsl_mode_t)>
-void addGSLDOUBLE4Func(symbol name, symbol arg1, symbol arg2,
- symbol arg3, symbol arg4)
-{
- addFunc(GSLModule->e.ve, realRealRealRealRealDOUBLE<fcn>, primReal(), name,
- formal(primReal(),arg1), formal(primReal(),arg2),
- formal(primReal(), arg3), formal(primReal(), arg4));
-}
-
-template<double (*fcn)(unsigned)>
-void addGSLIntFunc(symbol name)
-{
- addFunc(GSLModule->e.ve, realIntGSL<fcn>, primReal(), name,
- formal(primInt(),SYM(s)));
-}
-
-template <double (*func)(int)>
-void realSignedGSL(vm::stack *s)
-{
- Int a = pop<Int>(s);
- s->push(func(intcast(a)));
- checkGSLerror();
-}
-
-template<double (*fcn)(int)>
-void addGSLSignedFunc(symbol name, symbol arg1)
-{
- addFunc(GSLModule->e.ve, realSignedGSL<fcn>, primReal(), name,
- formal(primInt(),arg1));
-}
-
-template<double (*fcn)(int, double)>
-void addGSLIntRealFunc(symbol name, symbol arg1=SYM(n),
- symbol arg2=SYM(x))
-{
- addFunc(GSLModule->e.ve, realIntRealGSL<fcn>, primReal(), name,
- formal(primInt(),arg1), formal(primReal(),arg2));
-}
-
-template<double (*fcn)(double, double)>
-void addGSLRealRealFunc(symbol name, symbol arg1=SYM(nu),
- symbol arg2=SYM(x))
-{
- addFunc(GSLModule->e.ve, realRealRealGSL<fcn>, primReal(), name,
- formal(primReal(),arg1), formal(primReal(),arg2));
-}
-
-template<double (*fcn)(double, double, double)>
-void addGSLRealRealRealFunc(symbol name, symbol arg1,
- symbol arg2, symbol arg3)
-{
- addFunc(GSLModule->e.ve, realRealRealRealGSL<fcn>, primReal(), name,
- formal(primReal(),arg1), formal(primReal(),arg2),
- formal(primReal(), arg3));
-}
-
-template<int (*fcn)(double, double, double)>
-void addGSLRealRealRealFuncInt(symbol name, symbol arg1,
- symbol arg2, symbol arg3)
-{
- addFunc(GSLModule->e.ve, intRealRealRealGSL<fcn>, primInt(), name,
- formal(primReal(),arg1), formal(primReal(),arg2),
- formal(primReal(), arg3));
-}
-
-template<double (*fcn)(double, unsigned)>
-void addGSLRealIntFunc(symbol name, symbol arg1=SYM(nu),
- symbol arg2=SYM(s))
-{
- addFunc(GSLModule->e.ve, realRealIntGSL<fcn>, primReal(), name,
- formal(primReal(),arg1), formal(primInt(),arg2));
-}
-
-template<double (*func)(double, int)>
-void realRealSignedGSL(vm::stack *s)
-{
- Int b = pop<Int>(s);
- double a = pop<double>(s);
- s->push(func(a, intcast(b)));
- checkGSLerror();
-}
-
-template<double (*fcn)(double, int)>
-void addGSLRealSignedFunc(symbol name, symbol arg1, symbol arg2)
-{
- addFunc(GSLModule->e.ve, realRealSignedGSL<fcn>, primReal(), name,
- formal(primReal(),arg1), formal(primInt(),arg2));
-}
-
-template<double (*func)(unsigned int, unsigned int)>
-void realUnsignedUnsignedGSL(vm::stack *s)
-{
- Int b = pop<Int>(s);
- Int a = pop<Int>(s);
- s->push(func(unsignedcast(a), unsignedcast(b)));
- checkGSLerror();
-}
-
-template<double (*fcn)(unsigned int, unsigned int)>
-void addGSLUnsignedUnsignedFunc(symbol name, symbol arg1,
- symbol arg2)
-{
- addFunc(GSLModule->e.ve, realUnsignedUnsignedGSL<fcn>, primReal(), name,
- formal(primInt(), arg1), formal(primInt(), arg2));
-}
-
-template<double (*func)(int, double, double)>
-void realIntRealRealGSL(vm::stack *s)
-{
- double c = pop<double>(s);
- double b = pop<double>(s);
- Int a = pop<Int>(s);
- s->push(func(intcast(a), b, c));
- checkGSLerror();
-}
-
-template<double (*fcn)(int, double, double)>
-void addGSLIntRealRealFunc(symbol name, symbol arg1,
- symbol arg2, symbol arg3)
-{
- addFunc(GSLModule->e.ve, realIntRealRealGSL<fcn>, primReal(), name,
- formal(primInt(), arg1), formal(primReal(), arg2),
- formal(primReal(), arg3));
-}
-
-template<double (*func)(int, int, double)>
-void realIntIntRealGSL(vm::stack *s)
-{
- double c = pop<double>(s);
- Int b = pop<Int>(s);
- Int a = pop<Int>(s);
- s->push(func(intcast(a), intcast(b), c));
- checkGSLerror();
-}
-
-template<double (*fcn)(int, int, double)>
-void addGSLIntIntRealFunc(symbol name, symbol arg1, symbol arg2,
- symbol arg3)
-{
- addFunc(GSLModule->e.ve, realIntIntRealGSL<fcn>, primReal(), name,
- formal(primInt(), arg1), formal(primInt(), arg2),
- formal(primReal(), arg3));
-}
-
-template<double (*func)(int, int, double, double)>
-void realIntIntRealRealGSL(vm::stack *s)
-{
- double d = pop<double>(s);
- double c = pop<double>(s);
- Int b = pop<Int>(s);
- Int a = pop<Int>(s);
- s->push(func(intcast(a), intcast(b), c, d));
- checkGSLerror();
-}
-
-template<double (*fcn)(int, int, double, double)>
-void addGSLIntIntRealRealFunc(symbol name, symbol arg1,
- symbol arg2, symbol arg3,
- symbol arg4)
-{
- addFunc(GSLModule->e.ve, realIntIntRealRealGSL<fcn>, primReal(), name,
- formal(primInt(), arg1), formal(primInt(), arg2),
- formal(primReal(), arg3), formal(primReal(), arg4));
-}
-
-template<double (*func)(double, double, double, double)>
-void realRealRealRealRealGSL(vm::stack *s)
-{
- double d = pop<double>(s);
- double c = pop<double>(s);
- double b = pop<double>(s);
- double a = pop<double>(s);
- s->push(func(a, b, c, d));
- checkGSLerror();
-}
-
-template<double (*fcn)(double, double, double, double)>
-void addGSLRealRealRealRealFunc(symbol name, symbol arg1,
- symbol arg2, symbol arg3,
- symbol arg4)
-{
- addFunc(GSLModule->e.ve, realRealRealRealRealGSL<fcn>, primReal(), name,
- formal(primReal(), arg1), formal(primReal(), arg2),
- formal(primReal(), arg3), formal(primReal(), arg4));
-}
-
-template<double (*func)(int, int, int, int, int, int)>
-void realIntIntIntIntIntIntGSL(vm::stack *s)
-{
- Int f = pop<Int>(s);
- Int e = pop<Int>(s);
- Int d = pop<Int>(s);
- Int c = pop<Int>(s);
- Int b = pop<Int>(s);
- Int a = pop<Int>(s);
- s->push(func(intcast(a), intcast(b), intcast(c), intcast(d), intcast(e),
- intcast(f)));
- checkGSLerror();
-}
-
-template<double (*fcn)(int, int, int, int, int, int)>
-void addGSLIntIntIntIntIntIntFunc(symbol name, symbol arg1,
- symbol arg2, symbol arg3,
- symbol arg4, symbol arg5,
- symbol arg6)
-{
- addFunc(GSLModule->e.ve, realIntIntIntIntIntIntGSL<fcn>, primReal(), name,
- formal(primInt(), arg1), formal(primInt(), arg2),
- formal(primInt(), arg3), formal(primInt(), arg4),
- formal(primInt(), arg5), formal(primInt(), arg6));
-}
-
-template<double (*func)(int, int, int, int, int, int, int, int, int)>
-void realIntIntIntIntIntIntIntIntIntGSL(vm::stack *s)
-{
- Int i = pop<Int>(s);
- Int h = pop<Int>(s);
- Int g = pop<Int>(s);
- Int f = pop<Int>(s);
- Int e = pop<Int>(s);
- Int d = pop<Int>(s);
- Int c = pop<Int>(s);
- Int b = pop<Int>(s);
- Int a = pop<Int>(s);
- s->push(func(intcast(a), intcast(b), intcast(c), intcast(d), intcast(e),
- intcast(f), intcast(g), intcast(h), intcast(i)));
- checkGSLerror();
-}
-
-template<double (*fcn)(int, int, int, int, int, int, int, int, int)>
-void addGSLIntIntIntIntIntIntIntIntIntFunc(symbol name, symbol arg1,
- symbol arg2, symbol arg3,
- symbol arg4, symbol arg5,
- symbol arg6, symbol arg7,
- symbol arg8, symbol arg9)
-{
- addFunc(GSLModule->e.ve, realIntIntIntIntIntIntIntIntIntGSL<fcn>, primReal(),
- name, formal(primInt(), arg1), formal(primInt(), arg2),
- formal(primInt(), arg3), formal(primInt(), arg4),
- formal(primInt(), arg5), formal(primInt(), arg6),
- formal(primInt(), arg7), formal(primInt(), arg8),
- formal(primInt(), arg9));
-}
-
-// Handle GSL errors gracefully.
-void GSLerrorhandler(const char *reason, const char *, int, int)
-{
- if(!GSLerror) {
- vm::errornothrow(reason);
- GSLerror=true;
- }
-}
-#endif
void addInitializer(venv &ve, ty *t, access *a)
{
@@ -826,7 +418,8 @@ void addBooleanOps(venv &ve, ty *t1, symbol name, ty *t2)
void addWrite(venv &ve, bltin f, ty *t1, ty *t2)
{
addRestFunc(ve,f,primVoid(),SYM(write),t2,
- formal(primFile(),SYM(file),true),formal(primString(),SYM(s),true),
+ formal(primFile(),SYM(file),true),
+ formal(primString(),SYM(s),true),
formal(t1,SYM(x)),formal(voidFileFunction(),SYM(suffix),true));
}
@@ -838,7 +431,8 @@ void addUnorderedOps(venv &ve, ty *t1, ty *t2, ty *t3, ty *t4)
addFunc(ve, run::array2Equals<T>, primBoolean(), SYM_EQ, formal(t3, SYM(a)),
formal(t3, SYM(b)));
- addFunc(ve, run::array2NotEquals<T>, primBoolean(), SYM_NEQ, formal(t3, SYM(a)),
+ addFunc(ve, run::array2NotEquals<T>, primBoolean(),
+ SYM_NEQ, formal(t3, SYM(a)),
formal(t3, SYM(b)));
addCast(ve,t1,primFile(),read<T>);
@@ -848,7 +442,8 @@ void addUnorderedOps(venv &ve, ty *t1, ty *t2, ty *t3, ty *t4)
addWrite(ve,write<T>,t1,t2);
addRestFunc(ve,writeArray<T>,primVoid(),SYM(write),t3,
- formal(primFile(),SYM(file),true),formal(primString(),SYM(s),true),
+ formal(primFile(),SYM(file),true),
+ formal(primString(),SYM(s),true),
formal(t2,SYM(a),false,true));
addFunc(ve,writeArray2<T>,primVoid(),SYM(write),
formal(primFile(),SYM(file),true),t3);
@@ -916,7 +511,8 @@ void addBasicOps(venv &ve, ty *t1, ty *t2, ty *t3, ty *t4, bool integer=false,
addFunc(ve,Negate<T>,t1,SYM_MINUS,formal(t1,SYM(a)));
addFunc(ve,arrayFunc<T,T,negate>,t2,SYM_MINUS,formal(t2,SYM(a)));
addFunc(ve,arrayFunc2<T,T,negate>,t3,SYM_MINUS,formal(t3,SYM(a)));
- if(!integer) addFunc(ve,interp<T>,t1,SYM(interp),formal(t1,SYM(a),false,Explicit),
+ if(!integer) addFunc(ve,interp<T>,t1,SYM(interp),
+ formal(t1,SYM(a),false,Explicit),
formal(t1,SYM(b),false,Explicit),
formal(primReal(),SYM(t)));
@@ -966,7 +562,7 @@ void addArrayOps(venv &ve, types::array *t)
typedef void (*stackFcn)(stack *Stack);
static stackFcn routine[]={run::copyArray0,run::copyArray1,run::copyArray2};
- Int ndepth=sizeof(routine)/sizeof(stackFcn);
+ size_t ndepth=sizeof(routine)/sizeof(stackFcn);
if(depth <= ndepth) {
addFunc(ve, routine[depth-1],
@@ -983,10 +579,14 @@ void addArrayOps(venv &ve, types::array *t)
t, SYM(sequence), formal(new function(ct, primInt()), SYM(f)),
formal(primInt(), SYM(n)));
addFunc(ve, run::arrayFunction,
- t, SYM(map), formal(new function(ct, ct), SYM(f)), formal(t, SYM(a)));
+ t, SYM(map), formal(new function(ct, ct), SYM(f)),
+ formal(t, SYM(a)));
addFunc(ve, run::arraySort,
t, SYM(sort), formal(t, SYM(a)),
- formal(new function(primBoolean(), ct, ct), SYM(f)));
+ formal(new function(primBoolean(), ct, ct), SYM(less)));
+ addFunc(ve, run::arraySearch,
+ primInt(), SYM(search), formal(t, SYM(a)), formal(ct, SYM(key)),
+ formal(new function(primBoolean(), ct, ct), SYM(less)));
break;
case 2:
addFunc(ve, run::array2Copy, t, SYM(copy), formal(t, SYM(a)));
@@ -1162,288 +762,6 @@ void base_venv(venv &ve)
addRealFunc(pow10,SYM(pow10));
addRealFunc(identity,SYM(identity));
-#ifdef HAVE_LIBGSL
- GSLModule=new dummyRecord(SYM(gsl));
- gsl_set_error_handler(GSLerrorhandler);
-
- // Common functions
- addGSLRealRealFunc<gsl_hypot>(SYM(hypot),SYM(x),SYM(y));
-// addGSLRealRealRealFunc<gsl_hypot3>(SYM(hypot),SYM(x),SYM(y),SYM(z));
- addGSLRealRealRealFuncInt<gsl_fcmp>(SYM(fcmp),SYM(x),SYM(y),SYM(epsilon));
-
- // Airy functions
- addGSLDOUBLEFunc<gsl_sf_airy_Ai>(SYM(Ai));
- addGSLDOUBLEFunc<gsl_sf_airy_Bi>(SYM(Bi));
- addGSLDOUBLEFunc<gsl_sf_airy_Ai_scaled>(SYM(Ai_scaled));
- addGSLDOUBLEFunc<gsl_sf_airy_Bi_scaled>(SYM(Bi_scaled));
- addGSLDOUBLEFunc<gsl_sf_airy_Ai_deriv>(SYM(Ai_deriv));
- addGSLDOUBLEFunc<gsl_sf_airy_Bi_deriv>(SYM(Bi_deriv));
- addGSLDOUBLEFunc<gsl_sf_airy_Ai_deriv_scaled>(SYM(Ai_deriv_scaled));
- addGSLDOUBLEFunc<gsl_sf_airy_Bi_deriv_scaled>(SYM(Bi_deriv_scaled));
- addGSLIntFunc<gsl_sf_airy_zero_Ai>(SYM(zero_Ai));
- addGSLIntFunc<gsl_sf_airy_zero_Bi>(SYM(zero_Bi));
- addGSLIntFunc<gsl_sf_airy_zero_Ai_deriv>(SYM(zero_Ai_deriv));
- addGSLIntFunc<gsl_sf_airy_zero_Bi_deriv>(SYM(zero_Bi_deriv));
-
- // Bessel functions
- addGSLRealFunc<gsl_sf_bessel_J0>(SYM(J0));
- addGSLRealFunc<gsl_sf_bessel_J1>(SYM(J1));
- addGSLIntRealFunc<gsl_sf_bessel_Jn>(SYM(Jn));
- addGSLRealFunc<gsl_sf_bessel_Y0>(SYM(Y0));
- addGSLRealFunc<gsl_sf_bessel_Y1>(SYM(Y1));
- addGSLIntRealFunc<gsl_sf_bessel_Yn>(SYM(Yn));
- addGSLRealFunc<gsl_sf_bessel_I0>(SYM(I0));
- addGSLRealFunc<gsl_sf_bessel_I1>(SYM(I1));
- addGSLIntRealFunc<gsl_sf_bessel_In>(SYM(I));
- addGSLRealFunc<gsl_sf_bessel_I0_scaled>(SYM(I0_scaled));
- addGSLRealFunc<gsl_sf_bessel_I1_scaled>(SYM(I1_scaled));
- addGSLIntRealFunc<gsl_sf_bessel_In_scaled>(SYM(I_scaled));
- addGSLRealFunc<gsl_sf_bessel_K0>(SYM(K0));
- addGSLRealFunc<gsl_sf_bessel_K1>(SYM(K1));
- addGSLIntRealFunc<gsl_sf_bessel_Kn>(SYM(K));
- addGSLRealFunc<gsl_sf_bessel_K0_scaled>(SYM(K0_scaled));
- addGSLRealFunc<gsl_sf_bessel_K1_scaled>(SYM(K1_scaled));
- addGSLIntRealFunc<gsl_sf_bessel_Kn_scaled>(SYM(K_scaled));
- addGSLRealFunc<gsl_sf_bessel_j0>(SYM(j0));
- addGSLRealFunc<gsl_sf_bessel_j1>(SYM(j1));
- addGSLRealFunc<gsl_sf_bessel_j2>(SYM(j2));
- addGSLIntRealFunc<gsl_sf_bessel_jl>(SYM(j),SYM(l));
- addGSLRealFunc<gsl_sf_bessel_y0>(SYM(y0));
- addGSLRealFunc<gsl_sf_bessel_y1>(SYM(y1));
- addGSLRealFunc<gsl_sf_bessel_y2>(SYM(y2));
- addGSLIntRealFunc<gsl_sf_bessel_yl>(SYM(y),SYM(l));
- addGSLRealFunc<gsl_sf_bessel_i0_scaled>(SYM(i0_scaled));
- addGSLRealFunc<gsl_sf_bessel_i1_scaled>(SYM(i1_scaled));
- addGSLRealFunc<gsl_sf_bessel_i2_scaled>(SYM(i2_scaled));
- addGSLIntRealFunc<gsl_sf_bessel_il_scaled>(SYM(i_scaled),SYM(l));
- addGSLRealFunc<gsl_sf_bessel_k0_scaled>(SYM(k0_scaled));
- addGSLRealFunc<gsl_sf_bessel_k1_scaled>(SYM(k1_scaled));
- addGSLRealFunc<gsl_sf_bessel_k2_scaled>(SYM(k2_scaled));
- addGSLIntRealFunc<gsl_sf_bessel_kl_scaled>(SYM(k_scaled),SYM(l));
- addGSLRealRealFunc<gsl_sf_bessel_Jnu>(SYM(J));
- addGSLRealRealFunc<gsl_sf_bessel_Ynu>(SYM(Y));
- addGSLRealRealFunc<gsl_sf_bessel_Inu>(SYM(I));
- addGSLRealRealFunc<gsl_sf_bessel_Inu_scaled>(SYM(I_scaled));
- addGSLRealRealFunc<gsl_sf_bessel_Knu>(SYM(K));
- addGSLRealRealFunc<gsl_sf_bessel_lnKnu>(SYM(lnK));
- addGSLRealRealFunc<gsl_sf_bessel_Knu_scaled>(SYM(K_scaled));
- addGSLIntFunc<gsl_sf_bessel_zero_J0>(SYM(zero_J0));
- addGSLIntFunc<gsl_sf_bessel_zero_J1>(SYM(zero_J1));
- addGSLRealIntFunc<gsl_sf_bessel_zero_Jnu>(SYM(zero_J));
-
- // Clausen functions
- addGSLRealFunc<gsl_sf_clausen>(SYM(clausen));
-
- // Coulomb functions
- addGSLRealRealFunc<gsl_sf_hydrogenicR_1>(SYM(hydrogenicR_1),SYM(Z),SYM(r));
- addGSLIntIntRealRealFunc<gsl_sf_hydrogenicR>(SYM(hydrogenicR),SYM(n),SYM(l),SYM(Z),
- SYM(r));
- // Missing: F_L(eta,x), G_L(eta,x), C_L(eta)
-
- // Coupling coefficients
- addGSLIntIntIntIntIntIntFunc<gsl_sf_coupling_3j>(SYM(coupling_3j),SYM(two_ja),
- SYM(two_jb),SYM(two_jc),SYM(two_ma),
- SYM(two_mb),SYM(two_mc));
- addGSLIntIntIntIntIntIntFunc<gsl_sf_coupling_6j>(SYM(coupling_6j),SYM(two_ja),
- SYM(two_jb),SYM(two_jc),SYM(two_jd),
- SYM(two_je),SYM(two_jf));
- addGSLIntIntIntIntIntIntIntIntIntFunc<gsl_sf_coupling_9j>(SYM(coupling_9j),
- SYM(two_ja),SYM(two_jb),
- SYM(two_jc),SYM(two_jd),
- SYM(two_je),SYM(two_jf),
- SYM(two_jg),SYM(two_jh),
- SYM(two_ji));
- // Dawson function
- addGSLRealFunc<gsl_sf_dawson>(SYM(dawson));
-
- // Debye functions
- addGSLRealFunc<gsl_sf_debye_1>(SYM(debye_1));
- addGSLRealFunc<gsl_sf_debye_2>(SYM(debye_2));
- addGSLRealFunc<gsl_sf_debye_3>(SYM(debye_3));
- addGSLRealFunc<gsl_sf_debye_4>(SYM(debye_4));
- addGSLRealFunc<gsl_sf_debye_5>(SYM(debye_5));
- addGSLRealFunc<gsl_sf_debye_6>(SYM(debye_6));
-
- // Dilogarithm
- addGSLRealFunc<gsl_sf_dilog>(SYM(dilog));
- // Missing: complex dilogarithm
-
- // Elementary operations
- // we don't support errors at the moment
-
- // Elliptic integrals
- addGSLDOUBLEFunc<gsl_sf_ellint_Kcomp>(SYM(K),SYM(k));
- addGSLDOUBLEFunc<gsl_sf_ellint_Ecomp>(SYM(E),SYM(k));
- addGSLDOUBLE2Func<gsl_sf_ellint_Pcomp>(SYM(P),SYM(k),SYM(n));
- addGSLDOUBLE2Func<gsl_sf_ellint_F>(SYM(F));
- addGSLDOUBLE2Func<gsl_sf_ellint_E>(SYM(E));
- addGSLDOUBLE3Func<gsl_sf_ellint_P>(SYM(P),SYM(phi),SYM(k),SYM(n));
- addGSLDOUBLE3Func<gsl_sf_ellint_D>(SYM(D),SYM(phi),SYM(k),SYM(n));
- addGSLDOUBLE2Func<gsl_sf_ellint_RC>(SYM(RC),SYM(x),SYM(y));
- addGSLDOUBLE3Func<gsl_sf_ellint_RD>(SYM(RD),SYM(x),SYM(y),SYM(z));
- addGSLDOUBLE3Func<gsl_sf_ellint_RF>(SYM(RF),SYM(x),SYM(y),SYM(z));
- addGSLDOUBLE4Func<gsl_sf_ellint_RJ>(SYM(RJ),SYM(x),SYM(y),SYM(z),SYM(p));
-
- // Elliptic functions (Jacobi)
- // to be implemented
-
- // Error functions
- addGSLRealFunc<gsl_sf_erf>(SYM(erf));
- addGSLRealFunc<gsl_sf_erfc>(SYM(erfc));
- addGSLRealFunc<gsl_sf_log_erfc>(SYM(log_erfc));
- addGSLRealFunc<gsl_sf_erf_Z>(SYM(erf_Z));
- addGSLRealFunc<gsl_sf_erf_Q>(SYM(erf_Q));
- addGSLRealFunc<gsl_sf_hazard>(SYM(hazard));
-
- // Exponential functions
- addGSLRealRealFunc<gsl_sf_exp_mult>(SYM(exp_mult),SYM(x),SYM(y));
-// addGSLRealFunc<gsl_sf_expm1>(SYM(expm1));
- addGSLRealFunc<gsl_sf_exprel>(SYM(exprel));
- addGSLRealFunc<gsl_sf_exprel_2>(SYM(exprel_2));
- addGSLIntRealFunc<gsl_sf_exprel_n>(SYM(exprel),SYM(n),SYM(x));
-
- // Exponential integrals
- addGSLRealFunc<gsl_sf_expint_E1>(SYM(E1));
- addGSLRealFunc<gsl_sf_expint_E2>(SYM(E2));
-// addGSLIntRealFunc<gsl_sf_expint_En>(SYM(En),SYM(n),SYM(x));
- addGSLRealFunc<gsl_sf_expint_Ei>(SYM(Ei));
- addGSLRealFunc<gsl_sf_Shi>(SYM(Shi));
- addGSLRealFunc<gsl_sf_Chi>(SYM(Chi));
- addGSLRealFunc<gsl_sf_expint_3>(SYM(Ei3));
- addGSLRealFunc<gsl_sf_Si>(SYM(Si));
- addGSLRealFunc<gsl_sf_Ci>(SYM(Ci));
- addGSLRealFunc<gsl_sf_atanint>(SYM(atanint));
-
- // Fermi--Dirac function
- addGSLRealFunc<gsl_sf_fermi_dirac_m1>(SYM(FermiDiracM1));
- addGSLRealFunc<gsl_sf_fermi_dirac_0>(SYM(FermiDirac0));
- addGSLRealFunc<gsl_sf_fermi_dirac_1>(SYM(FermiDirac1));
- addGSLRealFunc<gsl_sf_fermi_dirac_2>(SYM(FermiDirac2));
- addGSLIntRealFunc<gsl_sf_fermi_dirac_int>(SYM(FermiDirac),SYM(j),SYM(x));
- addGSLRealFunc<gsl_sf_fermi_dirac_mhalf>(SYM(FermiDiracMHalf));
- addGSLRealFunc<gsl_sf_fermi_dirac_half>(SYM(FermiDiracHalf));
- addGSLRealFunc<gsl_sf_fermi_dirac_3half>(SYM(FermiDirac3Half));
- addGSLRealRealFunc<gsl_sf_fermi_dirac_inc_0>(SYM(FermiDiracInc0),SYM(x),SYM(b));
-
- // Gamma and beta functions
- addGSLRealFunc<gsl_sf_gamma>(SYM(gamma));
- addGSLRealFunc<gsl_sf_lngamma>(SYM(lngamma));
- addGSLRealFunc<gsl_sf_gammastar>(SYM(gammastar));
- addGSLRealFunc<gsl_sf_gammainv>(SYM(gammainv));
- addGSLIntFunc<gsl_sf_fact>(SYM(fact));
- addGSLIntFunc<gsl_sf_doublefact>(SYM(doublefact));
- addGSLIntFunc<gsl_sf_lnfact>(SYM(lnfact));
- addGSLIntFunc<gsl_sf_lndoublefact>(SYM(lndoublefact));
- addGSLUnsignedUnsignedFunc<gsl_sf_choose>(SYM(choose),SYM(n),SYM(m));
- addGSLUnsignedUnsignedFunc<gsl_sf_lnchoose>(SYM(lnchoose),SYM(n),SYM(m));
- addGSLIntRealFunc<gsl_sf_taylorcoeff>(SYM(taylorcoeff),SYM(n),SYM(x));
- addGSLRealRealFunc<gsl_sf_poch>(SYM(poch),SYM(a),SYM(x));
- addGSLRealRealFunc<gsl_sf_lnpoch>(SYM(lnpoch),SYM(a),SYM(x));
- addGSLRealRealFunc<gsl_sf_pochrel>(SYM(pochrel),SYM(a),SYM(x));
- addGSLRealRealFunc<gsl_sf_gamma_inc>(SYM(gamma),SYM(a),SYM(x));
- addGSLRealRealFunc<gsl_sf_gamma_inc_Q>(SYM(gamma_Q),SYM(a),SYM(x));
- addGSLRealRealFunc<gsl_sf_gamma_inc_P>(SYM(gamma_P),SYM(a),SYM(x));
- addGSLRealRealFunc<gsl_sf_beta>(SYM(beta),SYM(a),SYM(b));
- addGSLRealRealFunc<gsl_sf_lnbeta>(SYM(lnbeta),SYM(a),SYM(b));
- addGSLRealRealRealFunc<gsl_sf_beta_inc>(SYM(beta),SYM(a),SYM(b),SYM(x));
-
- // Gegenbauer functions
- addGSLRealRealFunc<gsl_sf_gegenpoly_1>(SYM(gegenpoly_1),SYM(lambda),SYM(x));
- addGSLRealRealFunc<gsl_sf_gegenpoly_2>(SYM(gegenpoly_2),SYM(lambda),SYM(x));
- addGSLRealRealFunc<gsl_sf_gegenpoly_3>(SYM(gegenpoly_3),SYM(lambda),SYM(x));
- addGSLIntRealRealFunc<gsl_sf_gegenpoly_n>(SYM(gegenpoly),SYM(n),SYM(lambda),SYM(x));
-
- // Hypergeometric functions
- addGSLRealRealFunc<gsl_sf_hyperg_0F1>(SYM(hy0F1),SYM(c),SYM(x));
- addGSLIntIntRealFunc<gsl_sf_hyperg_1F1_int>(SYM(hy1F1),SYM(m),SYM(n),SYM(x));
- addGSLRealRealRealFunc<gsl_sf_hyperg_1F1>(SYM(hy1F1),SYM(a),SYM(b),SYM(x));
- addGSLIntIntRealFunc<gsl_sf_hyperg_U_int>(SYM(U),SYM(m),SYM(n),SYM(x));
- addGSLRealRealRealFunc<gsl_sf_hyperg_U>(SYM(U),SYM(a),SYM(b),SYM(x));
- addGSLRealRealRealRealFunc<gsl_sf_hyperg_2F1>(SYM(hy2F1),SYM(a),SYM(b),SYM(c),SYM(x));
- addGSLRealRealRealRealFunc<gsl_sf_hyperg_2F1_conj>(SYM(hy2F1_conj),SYM(aR),SYM(aI),SYM(c),
- SYM(x));
- addGSLRealRealRealRealFunc<gsl_sf_hyperg_2F1_renorm>(SYM(hy2F1_renorm),SYM(a),SYM(b),
- SYM(c),SYM(x));
- addGSLRealRealRealRealFunc<gsl_sf_hyperg_2F1_conj_renorm>(SYM(hy2F1_conj_renorm),
- SYM(aR),SYM(aI),SYM(c),SYM(x));
- addGSLRealRealRealFunc<gsl_sf_hyperg_2F0>(SYM(hy2F0),SYM(a),SYM(b),SYM(x));
-
- // Laguerre functions
- addGSLRealRealFunc<gsl_sf_laguerre_1>(SYM(L1),SYM(a),SYM(x));
- addGSLRealRealFunc<gsl_sf_laguerre_2>(SYM(L2),SYM(a),SYM(x));
- addGSLRealRealFunc<gsl_sf_laguerre_3>(SYM(L3),SYM(a),SYM(x));
- addGSLIntRealRealFunc<gsl_sf_laguerre_n>(SYM(L),SYM(n),SYM(a),SYM(x));
-
- // Lambert W functions
- addGSLRealFunc<gsl_sf_lambert_W0>(SYM(W0));
- addGSLRealFunc<gsl_sf_lambert_Wm1>(SYM(Wm1));
-
- // Legendre functions and spherical harmonics
- addGSLRealFunc<gsl_sf_legendre_P1>(SYM(P1));
- addGSLRealFunc<gsl_sf_legendre_P2>(SYM(P2));
- addGSLRealFunc<gsl_sf_legendre_P3>(SYM(P3));
- addGSLIntRealFunc<gsl_sf_legendre_Pl>(SYM(Pl),SYM(l));
- addGSLRealFunc<gsl_sf_legendre_Q0>(SYM(Q0));
- addGSLRealFunc<gsl_sf_legendre_Q1>(SYM(Q1));
- addGSLIntRealFunc<gsl_sf_legendre_Ql>(SYM(Ql),SYM(l));
- addGSLIntIntRealFunc<gsl_sf_legendre_Plm>(SYM(Plm),SYM(l),SYM(m),SYM(x));
- addGSLIntIntRealFunc<gsl_sf_legendre_sphPlm>(SYM(sphPlm),SYM(l),SYM(m),SYM(x));
- addGSLRealRealFunc<gsl_sf_conicalP_half>(SYM(conicalP_half),SYM(lambda),SYM(x));
- addGSLRealRealFunc<gsl_sf_conicalP_mhalf>(SYM(conicalP_mhalf),SYM(lambda),SYM(x));
- addGSLRealRealFunc<gsl_sf_conicalP_0>(SYM(conicalP_0),SYM(lambda),SYM(x));
- addGSLRealRealFunc<gsl_sf_conicalP_1>(SYM(conicalP_1),SYM(lambda),SYM(x));
- addGSLIntRealRealFunc<gsl_sf_conicalP_sph_reg>(SYM(conicalP_sph_reg),SYM(l),
- SYM(lambda),SYM(x));
- addGSLIntRealRealFunc<gsl_sf_conicalP_cyl_reg>(SYM(conicalP_cyl_reg),SYM(m),
- SYM(lambda),SYM(x));
- addGSLRealRealFunc<gsl_sf_legendre_H3d_0>(SYM(H3d0),SYM(lambda),SYM(eta));
- addGSLRealRealFunc<gsl_sf_legendre_H3d_1>(SYM(H3d1),SYM(lambda),SYM(eta));
- addGSLIntRealRealFunc<gsl_sf_legendre_H3d>(SYM(H3d),SYM(l),SYM(lambda),SYM(eta));
-
- // Logarithm and related functions
- addGSLRealFunc<gsl_sf_log_abs>(SYM(logabs));
-// addGSLRealFunc<gsl_sf_log_1plusx>(SYM(log1p));
- addGSLRealFunc<gsl_sf_log_1plusx_mx>(SYM(log1pm));
-
- // Matthieu functions
- // to be implemented
-
- // Power function
- addGSLRealSignedFunc<gsl_sf_pow_int>(SYM(pow),SYM(x),SYM(n));
-
- // Psi (digamma) function
- addGSLSignedFunc<gsl_sf_psi_int>(SYM(psi),SYM(n));
- addGSLRealFunc<gsl_sf_psi>(SYM(psi));
- addGSLRealFunc<gsl_sf_psi_1piy>(SYM(psi_1piy),SYM(y));
- addGSLSignedFunc<gsl_sf_psi_1_int>(SYM(psi1),SYM(n));
- addGSLRealFunc<gsl_sf_psi_1>(SYM(psi1),SYM(x));
- addGSLIntRealFunc<gsl_sf_psi_n>(SYM(psi),SYM(n),SYM(x));
-
- // Synchrotron functions
- addGSLRealFunc<gsl_sf_synchrotron_1>(SYM(synchrotron_1));
- addGSLRealFunc<gsl_sf_synchrotron_2>(SYM(synchrotron_2));
-
- // Transport functions
- addGSLRealFunc<gsl_sf_transport_2>(SYM(transport_2));
- addGSLRealFunc<gsl_sf_transport_3>(SYM(transport_3));
- addGSLRealFunc<gsl_sf_transport_4>(SYM(transport_4));
- addGSLRealFunc<gsl_sf_transport_5>(SYM(transport_5));
-
- // Trigonometric functions
- addGSLRealFunc<gsl_sf_sinc>(SYM(sinc));
- addGSLRealFunc<gsl_sf_lnsinh>(SYM(lnsinh));
- addGSLRealFunc<gsl_sf_lncosh>(SYM(lncosh));
-
- // Zeta functions
- addGSLSignedFunc<gsl_sf_zeta_int>(SYM(zeta),SYM(n));
- addGSLRealFunc<gsl_sf_zeta>(SYM(zeta),SYM(s));
- addGSLSignedFunc<gsl_sf_zetam1_int>(SYM(zetam1),SYM(n));
- addGSLRealFunc<gsl_sf_zetam1>(SYM(zetam1),SYM(s));
- addGSLRealRealFunc<gsl_sf_hzeta>(SYM(hzeta),SYM(s),SYM(q));
- addGSLSignedFunc<gsl_sf_eta_int>(SYM(eta),SYM(n));
- addGSLRealFunc<gsl_sf_eta>(SYM(eta),SYM(s));
-#endif
-
#ifdef STRUCTEXAMPLE
dummyRecord *fun=createDummyRecord(ve, SYM(test));
addFunc(fun->e.ve,realReal<sin>,primReal(),SYM(f),formal(primReal(),SYM(x)));
@@ -1503,6 +821,10 @@ void base_venv(venv &ve)
gen_runpath_venv(ve);
gen_runpath3d_venv(ve);
gen_runmath_venv(ve);
+
+#ifdef HAVE_LIBGSL
+ gen_rungsl_venv(ve);
+#endif
}
} //namespace trans