summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/builtin.cc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-06-08 13:46:05 +0000
committerKarl Berry <karl@freefriends.org>2010-06-08 13:46:05 +0000
commita960e44eb527236f39aec81babc0474911a86078 (patch)
tree9950eca71791d90820a80a521a7cc252c0955db5 /Build/source/utils/asymptote/builtin.cc
parent6443467452320c296faa1f43f0606a9457bd4463 (diff)
asy 1.96
git-svn-id: svn://tug.org/texlive/trunk@18817 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/builtin.cc')
-rw-r--r--Build/source/utils/asymptote/builtin.cc979
1 files changed, 499 insertions, 480 deletions
diff --git a/Build/source/utils/asymptote/builtin.cc b/Build/source/utils/asymptote/builtin.cc
index deb0e223d05..8e2d80cb3f1 100644
--- a/Build/source/utils/asymptote/builtin.cc
+++ b/Build/source/utils/asymptote/builtin.cc
@@ -36,6 +36,9 @@
#include "refaccess.h"
#include "settings.h"
+#include "opsymbols.h"
+#include "builtin.symbols.h"
+
#ifdef HAVE_LIBGSL
#include <gsl/gsl_math.h>
#include <gsl/gsl_sf.h>
@@ -73,15 +76,17 @@ void gen_runpath_venv(venv &ve);
void gen_runpath3d_venv(venv &ve);
void gen_runmath_venv(venv &ve);
-void addType(tenv &te, const char *name, ty *t)
+
+void addType(tenv &te, symbol *name, ty *t)
{
- te.enter(symbol::trans(name), new tyEntry(t,0,0,position()));
+ te.enter(name, new tyEntry(t,0,0,position()));
}
// The base environments for built-in types and functions
void base_tenv(tenv &te)
{
-#define PRIMITIVE(name,Name,asyName) addType(te, #asyName, prim##Name());
+#define PRIMITIVE(name,Name,asyName) \
+ addType(te, symbol::trans(#asyName), prim##Name());
#include "primitives.h"
#undef PRIMITIVE
}
@@ -125,6 +130,19 @@ void addFunc(venv &ve, access *a, ty *result, symbol *id,
}
// Add a function with one or more default arguments.
+void addFunc(venv &ve, bltin f, ty *result, symbol *name,
+ formal f1, formal f2, formal f3, formal f4, formal f5, formal f6,
+ formal f7, formal f8, formal f9, formal fA, formal fB, formal fC,
+ formal fD, formal fE, formal fF, formal fG, formal fH, formal fI)
+{
+ REGISTER_BLTIN(f, name);
+ access *a = new bltinAccess(f);
+ addFunc(ve,a,result,name,f1,f2,f3,f4,f5,f6,f7,f8,f9,
+ fA,fB,fC,fD,fE,fF,fG,fH,fI);
+}
+
+#if 0
+// Add a function with one or more default arguments.
void addFunc(venv &ve, bltin f, ty *result, const char *name,
formal f1, formal f2, formal f3, formal f4, formal f5, formal f6,
formal f7, formal f8, formal f9, formal fA, formal fB, formal fC,
@@ -140,8 +158,9 @@ void addFunc(venv &ve, access *a, ty *result, const char *name, formal f1)
{
addFunc(ve,a,result,symbol::trans(name),f1);
}
+#endif
-void addOpenFunc(venv &ve, bltin f, ty *result, const char *name)
+void addOpenFunc(venv &ve, bltin f, ty *result, symbol *name)
{
function *fun = new function(result, signature::OPEN);
@@ -150,12 +169,12 @@ void addOpenFunc(venv &ve, bltin f, ty *result, const char *name)
varEntry *ent = new varEntry(fun, a, 0, position());
- ve.enter(symbol::trans(name), ent);
+ ve.enter(name, ent);
}
// Add a rest function with zero or more default/explicit arguments.
-void addRestFunc(venv &ve, bltin f, ty *result, const char *name, formal frest,
+void addRestFunc(venv &ve, bltin f, ty *result, symbol *name, formal frest,
formal f1=noformal, formal f2=noformal, formal f3=noformal,
formal f4=noformal, formal f5=noformal, formal f6=noformal,
formal f7=noformal, formal f8=noformal, formal f9=noformal)
@@ -178,28 +197,28 @@ void addRestFunc(venv &ve, bltin f, ty *result, const char *name, formal frest,
varEntry *ent = new varEntry(fun, a, 0, position());
- ve.enter(symbol::trans(name), ent);
+ ve.enter(name, ent);
}
-void addRealFunc0(venv &ve, bltin fcn, const char *name)
+void addRealFunc0(venv &ve, bltin fcn, symbol *name)
{
addFunc(ve, fcn, primReal(), name);
}
template<double (*fcn)(double)>
-void addRealFunc(venv &ve, const char* name)
+void addRealFunc(venv &ve, symbol *name)
{
- addFunc(ve, realReal<fcn>, primReal(), name, formal(primReal(),"x"));
+ addFunc(ve, realReal<fcn>, primReal(), name, formal(primReal(),SYM(x)));
addFunc(ve, arrayFunc<double,double,fcn>, realArray(), name,
- formal(realArray(),"a"));
+ formal(realArray(),SYM(a)));
}
-#define addRealFunc(fcn) addRealFunc<fcn>(ve, #fcn);
+#define addRealFunc(fcn, sym) addRealFunc<fcn>(ve, sym);
-void addRealFunc2(venv &ve, bltin fcn, const char *name)
+void addRealFunc2(venv &ve, bltin fcn, symbol *name)
{
- addFunc(ve,fcn,primReal(),name,formal(primReal(),"a"),
- formal(primReal(),"b"));
+ addFunc(ve,fcn,primReal(),name,formal(primReal(),SYM(a)),
+ formal(primReal(),SYM(b)));
}
template <double (*func)(double, int)>
@@ -210,8 +229,8 @@ void realRealInt(vm::stack *s) {
}
template<double (*fcn)(double, int)>
-void addRealIntFunc(venv& ve, const char* name, const char* arg1,
- const char* arg2) {
+void addRealIntFunc(venv& ve, symbol *name, symbol *arg1,
+ symbol *arg2) {
addFunc(ve, realRealInt<fcn>, primReal(), name, formal(primReal(), arg1),
formal(primInt(), arg2));
}
@@ -315,7 +334,7 @@ void realRealIntGSL(vm::stack *s)
// Add a GSL special function from the GNU GSL library
template<double (*fcn)(double)>
-void addGSLRealFunc(const char* name, const char* arg1="x")
+void addGSLRealFunc(symbol *name, symbol *arg1=SYM(x))
{
addFunc(GSLModule->e.ve, realRealGSL<fcn>, primReal(), name,
formal(primReal(),arg1));
@@ -323,15 +342,15 @@ void addGSLRealFunc(const char* name, const char* arg1="x")
// Add a GSL_PREC_DOUBLE GSL special function.
template<double (*fcn)(double, gsl_mode_t)>
-void addGSLDOUBLEFunc(const char* name, const char* arg1="x")
+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(const char* name, const char* arg1="phi",
- const char* arg2="k")
+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));
@@ -348,8 +367,8 @@ void realRealRealRealDOUBLE(vm::stack *s)
}
template<double (*fcn)(double, double, double, gsl_mode_t)>
-void addGSLDOUBLE3Func(const char* name, const char* arg1, const char* arg2,
- const char* arg3)
+void addGSLDOUBLE3Func(symbol *name, symbol *arg1, symbol *arg2,
+ symbol *arg3)
{
addFunc(GSLModule->e.ve, realRealRealRealDOUBLE<fcn>, primReal(), name,
formal(primReal(),arg1), formal(primReal(),arg2),
@@ -368,8 +387,8 @@ void realRealRealRealRealDOUBLE(vm::stack *s)
}
template<double (*fcn)(double, double, double, double, gsl_mode_t)>
-void addGSLDOUBLE4Func(const char* name, const char* arg1, const char* arg2,
- const char* arg3, const char* arg4)
+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),
@@ -377,10 +396,10 @@ void addGSLDOUBLE4Func(const char* name, const char* arg1, const char* arg2,
}
template<double (*fcn)(unsigned)>
-void addGSLIntFunc(const char* name)
+void addGSLIntFunc(symbol *name)
{
addFunc(GSLModule->e.ve, realIntGSL<fcn>, primReal(), name,
- formal(primInt(),"s"));
+ formal(primInt(),SYM(s)));
}
template <double (*func)(int)>
@@ -392,31 +411,31 @@ void realSignedGSL(vm::stack *s)
}
template<double (*fcn)(int)>
-void addGSLSignedFunc(const char* name, const char* arg1)
+void addGSLSignedFunc(symbol *name, symbol *arg1)
{
addFunc(GSLModule->e.ve, realSignedGSL<fcn>, primReal(), name,
formal(primInt(),arg1));
}
template<double (*fcn)(int, double)>
-void addGSLIntRealFunc(const char* name, const char *arg1="n",
- const char* arg2="x")
+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(const char* name, const char* arg1="nu",
- const char* arg2="x")
+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(const char* name, const char* arg1,
- const char* arg2, const char* arg3)
+void addGSLRealRealRealFunc(symbol *name, symbol *arg1,
+ symbol *arg2, symbol *arg3)
{
addFunc(GSLModule->e.ve, realRealRealRealGSL<fcn>, primReal(), name,
formal(primReal(),arg1), formal(primReal(),arg2),
@@ -424,8 +443,8 @@ void addGSLRealRealRealFunc(const char* name, const char* arg1,
}
template<int (*fcn)(double, double, double)>
-void addGSLRealRealRealFuncInt(const char* name, const char* arg1,
- const char* arg2, const char* arg3)
+void addGSLRealRealRealFuncInt(symbol *name, symbol *arg1,
+ symbol *arg2, symbol *arg3)
{
addFunc(GSLModule->e.ve, intRealRealRealGSL<fcn>, primInt(), name,
formal(primReal(),arg1), formal(primReal(),arg2),
@@ -433,8 +452,8 @@ void addGSLRealRealRealFuncInt(const char* name, const char* arg1,
}
template<double (*fcn)(double, unsigned)>
-void addGSLRealIntFunc(const char* name, const char* arg1="nu",
- const char* arg2="s")
+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));
@@ -450,7 +469,7 @@ void realRealSignedGSL(vm::stack *s)
}
template<double (*fcn)(double, int)>
-void addGSLRealSignedFunc(const char* name, const char* arg1, const char* arg2)
+void addGSLRealSignedFunc(symbol *name, symbol *arg1, symbol *arg2)
{
addFunc(GSLModule->e.ve, realRealSignedGSL<fcn>, primReal(), name,
formal(primReal(),arg1), formal(primInt(),arg2));
@@ -466,8 +485,8 @@ void realUnsignedUnsignedGSL(vm::stack *s)
}
template<double (*fcn)(unsigned int, unsigned int)>
-void addGSLUnsignedUnsignedFunc(const char* name, const char* arg1,
- const char* arg2)
+void addGSLUnsignedUnsignedFunc(symbol *name, symbol *arg1,
+ symbol *arg2)
{
addFunc(GSLModule->e.ve, realUnsignedUnsignedGSL<fcn>, primReal(), name,
formal(primInt(), arg1), formal(primInt(), arg2));
@@ -484,8 +503,8 @@ void realIntRealRealGSL(vm::stack *s)
}
template<double (*fcn)(int, double, double)>
-void addGSLIntRealRealFunc(const char* name, const char* arg1,
- const char* arg2, const char* arg3)
+void addGSLIntRealRealFunc(symbol *name, symbol *arg1,
+ symbol *arg2, symbol *arg3)
{
addFunc(GSLModule->e.ve, realIntRealRealGSL<fcn>, primReal(), name,
formal(primInt(), arg1), formal(primReal(), arg2),
@@ -503,8 +522,8 @@ void realIntIntRealGSL(vm::stack *s)
}
template<double (*fcn)(int, int, double)>
-void addGSLIntIntRealFunc(const char* name, const char* arg1, const char* arg2,
- const char* arg3)
+void addGSLIntIntRealFunc(symbol *name, symbol *arg1, symbol *arg2,
+ symbol *arg3)
{
addFunc(GSLModule->e.ve, realIntIntRealGSL<fcn>, primReal(), name,
formal(primInt(), arg1), formal(primInt(), arg2),
@@ -523,9 +542,9 @@ void realIntIntRealRealGSL(vm::stack *s)
}
template<double (*fcn)(int, int, double, double)>
-void addGSLIntIntRealRealFunc(const char* name, const char* arg1,
- const char* arg2, const char* arg3,
- const char* arg4)
+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),
@@ -544,9 +563,9 @@ void realRealRealRealRealGSL(vm::stack *s)
}
template<double (*fcn)(double, double, double, double)>
-void addGSLRealRealRealRealFunc(const char* name, const char* arg1,
- const char* arg2, const char* arg3,
- const char* arg4)
+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),
@@ -568,10 +587,10 @@ void realIntIntIntIntIntIntGSL(vm::stack *s)
}
template<double (*fcn)(int, int, int, int, int, int)>
-void addGSLIntIntIntIntIntIntFunc(const char* name, const char* arg1,
- const char* arg2, const char* arg3,
- const char* arg4, const char* arg5,
- const char* arg6)
+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),
@@ -597,11 +616,11 @@ void realIntIntIntIntIntIntIntIntIntGSL(vm::stack *s)
}
template<double (*fcn)(int, int, int, int, int, int, int, int, int)>
-void addGSLIntIntIntIntIntIntIntIntIntFunc(const char* name, const char* arg1,
- const char* arg2, const char* arg3,
- const char* arg4, const char* arg5,
- const char* arg6, const char* arg7,
- const char* arg8, const char* arg9)
+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),
@@ -669,26 +688,26 @@ void addCast(venv &ve, ty *target, ty *source, bltin f) {
}
template<class T>
-void addVariable(venv &ve, T *ref, ty *t, const char *name,
+void addVariable(venv &ve, T *ref, ty *t, symbol *name,
record *module=settings::getSettingsModule()) {
access *a = new refAccess<T>(ref);
varEntry *ent = new varEntry(t, a, PUBLIC, module, 0, position());
- ve.enter(symbol::trans(name), ent);
+ ve.enter(name, ent);
}
template<class T>
-void addVariable(venv &ve, T value, ty *t, const char *name,
+void addVariable(venv &ve, T value, ty *t, symbol *name,
record *module=settings::getSettingsModule(),
permission perm=PUBLIC) {
item* ref=new item;
*ref=value;
access *a = new itemRefAccess(ref);
varEntry *ent = new varEntry(t, a, perm, module, 0, position());
- ve.enter(symbol::trans(name), ent);
+ ve.enter(name, ent);
}
template<class T>
-void addConstant(venv &ve, T value, ty *t, const char *name,
+void addConstant(venv &ve, T value, ty *t, symbol *name,
record *module=settings::getSettingsModule()) {
addVariable(ve,value,t,name,module,RESTRICTED);
}
@@ -770,76 +789,76 @@ void addGuideOperators(venv &ve)
{
// The guide operators .. and -- take an array of guides, and turn them
// into a single guide.
- addRestFunc(ve, dotsGuide, primGuide(), "..", guideArray());
- addRestFunc(ve, dashesGuide, primGuide(), "--", guideArray());
+ addRestFunc(ve, dotsGuide, primGuide(), SYM_DOTS, guideArray());
+ addRestFunc(ve, dashesGuide, primGuide(), SYM_DASHES, guideArray());
}
/* Avoid typing the same type three times. */
-void addSimpleOperator(venv &ve, bltin f, ty *t, const char *name)
+void addSimpleOperator(venv &ve, bltin f, ty *t, symbol *name)
{
- addFunc(ve,f,t,name,formal(t,"a"),formal(t,"b"));
+ addFunc(ve,f,t,name,formal(t,SYM(a)),formal(t,SYM(b)));
}
-void addBooleanOperator(venv &ve, bltin f, ty *t, const char *name)
+void addBooleanOperator(venv &ve, bltin f, ty *t, symbol *name)
{
- addFunc(ve,f,primBoolean(),name,formal(t,"a"),formal(t,"b"));
+ addFunc(ve,f,primBoolean(),name,formal(t,SYM(a)),formal(t,SYM(b)));
}
template<class T, template <class S> class op>
-void addArray2Array2Op(venv &ve, ty *t3, const char *name)
+void addArray2Array2Op(venv &ve, ty *t3, symbol *name)
{
- addFunc(ve,array2Array2Op<T,op>,t3,name,formal(t3,"a"),formal(t3,"b"));
+ addFunc(ve,array2Array2Op<T,op>,t3,name,formal(t3,SYM(a)),formal(t3,SYM(b)));
}
template<class T, template <class S> class op>
-void addOpArray2(venv &ve, ty *t1, const char *name, ty *t3)
+void addOpArray2(venv &ve, ty *t1, symbol *name, ty *t3)
{
- addFunc(ve,opArray2<T,T,op>,t3,name,formal(t1,"a"),formal(t3,"b"));
+ addFunc(ve,opArray2<T,T,op>,t3,name,formal(t1,SYM(a)),formal(t3,SYM(b)));
}
template<class T, template <class S> class op>
-void addArray2Op(venv &ve, ty *t1, const char *name, ty *t3)
+void addArray2Op(venv &ve, ty *t1, symbol *name, ty *t3)
{
- addFunc(ve,array2Op<T,T,op>,t3,name,formal(t3,"a"),formal(t1,"b"));
+ addFunc(ve,array2Op<T,T,op>,t3,name,formal(t3,SYM(a)),formal(t1,SYM(b)));
}
template<class T, template <class S> class op>
-void addOps(venv &ve, ty *t1, const char *name, ty *t2)
+void addOps(venv &ve, ty *t1, symbol *name, ty *t2)
{
addSimpleOperator(ve,binaryOp<T,op>,t1,name);
- addFunc(ve,opArray<T,T,op>,t2,name,formal(t1,"a"),formal(t2,"b"));
- addFunc(ve,arrayOp<T,T,op>,t2,name,formal(t2,"a"),formal(t1,"b"));
+ addFunc(ve,opArray<T,T,op>,t2,name,formal(t1,SYM(a)),formal(t2,SYM(b)));
+ addFunc(ve,arrayOp<T,T,op>,t2,name,formal(t2,SYM(a)),formal(t1,SYM(b)));
addSimpleOperator(ve,arrayArrayOp<T,op>,t2,name);
}
template<class T, template <class S> class op>
-void addBooleanOps(venv &ve, ty *t1, const char *name, ty *t2)
+void addBooleanOps(venv &ve, ty *t1, symbol *name, ty *t2)
{
addBooleanOperator(ve,binaryOp<T,op>,t1,name);
addFunc(ve,opArray<T,T,op>,
- booleanArray(),name,formal(t1,"a"),formal(t2,"b"));
+ booleanArray(),name,formal(t1,SYM(a)),formal(t2,SYM(b)));
addFunc(ve,arrayOp<T,T,op>,
- booleanArray(),name,formal(t2,"a"),formal(t1,"b"));
- addFunc(ve,arrayArrayOp<T,op>,booleanArray(),name,formal(t2,"a"),
- formal(t2,"b"));
+ booleanArray(),name,formal(t2,SYM(a)),formal(t1,SYM(b)));
+ addFunc(ve,arrayArrayOp<T,op>,booleanArray(),name,formal(t2,SYM(a)),
+ formal(t2,SYM(b)));
}
void addWrite(venv &ve, bltin f, ty *t1, ty *t2)
{
- addRestFunc(ve,f,primVoid(),"write",t2,
- formal(primFile(),"file",true),formal(primString(),"s",true),
- formal(t1,"x"),formal(voidFileFunction(),"suffix",true));
+ addRestFunc(ve,f,primVoid(),SYM(write),t2,
+ formal(primFile(),SYM(file),true),formal(primString(),SYM(s),true),
+ formal(t1,SYM(x)),formal(voidFileFunction(),SYM(suffix),true));
}
template<class T>
void addUnorderedOps(venv &ve, ty *t1, ty *t2, ty *t3, ty *t4)
{
- addBooleanOps<T,equals>(ve,t1,"==",t2);
- addBooleanOps<T,notequals>(ve,t1,"!=",t2);
+ addBooleanOps<T,equals>(ve,t1,SYM_EQ,t2);
+ addBooleanOps<T,notequals>(ve,t1,SYM_NEQ,t2);
- addFunc(ve, run::array2Equals<T>, primBoolean(), "==", formal(t3, "a"),
- formal(t3, "b"));
- addFunc(ve, run::array2NotEquals<T>, primBoolean(), "!=", formal(t3, "a"),
- formal(t3, "b"));
+ 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)),
+ formal(t3, SYM(b)));
addCast(ve,t1,primFile(),read<T>);
addCast(ve,t2,primFile(),readArray<T>);
@@ -847,13 +866,13 @@ void addUnorderedOps(venv &ve, ty *t1, ty *t2, ty *t3, ty *t4)
addCast(ve,t4,primFile(),readArray<T>);
addWrite(ve,write<T>,t1,t2);
- addRestFunc(ve,writeArray<T>,primVoid(),"write",t3,
- formal(primFile(),"file",true),formal(primString(),"s",true),
- formal(t2,"a",false,true));
- addFunc(ve,writeArray2<T>,primVoid(),"write",
- formal(primFile(),"file",true),t3);
- addFunc(ve,writeArray3<T>,primVoid(),"write",
- formal(primFile(),"file",true),t4);
+ addRestFunc(ve,writeArray<T>,primVoid(),SYM(write),t3,
+ 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);
+ addFunc(ve,writeArray3<T>,primVoid(),SYM(write),
+ formal(primFile(),SYM(file),true),t4);
}
inline double abs(pair z) {
@@ -874,53 +893,53 @@ inline T negate(T x) {
}
template<class T, template <class S> class op>
-void addBinOps(venv &ve, ty *t1, ty *t2, ty *t3, ty *t4, const char *name)
+void addBinOps(venv &ve, ty *t1, ty *t2, ty *t3, ty *t4, symbol *name)
{
- addFunc(ve,binopArray<T,op>,t1,name,formal(t2,"a"));
- addFunc(ve,binopArray2<T,op>,t1,name,formal(t3,"a"));
- addFunc(ve,binopArray3<T,op>,t1,name,formal(t4,"a"));
+ addFunc(ve,binopArray<T,op>,t1,name,formal(t2,SYM(a)));
+ addFunc(ve,binopArray2<T,op>,t1,name,formal(t3,SYM(a)));
+ addFunc(ve,binopArray3<T,op>,t1,name,formal(t4,SYM(a)));
}
template<class T>
void addOrderedOps(venv &ve, ty *t1, ty *t2, ty *t3, ty *t4)
{
- addBooleanOps<T,less>(ve,t1,"<",t2);
- addBooleanOps<T,lessequals>(ve,t1,"<=",t2);
- addBooleanOps<T,greaterequals>(ve,t1,">=",t2);
- addBooleanOps<T,greater>(ve,t1,">",t2);
+ addBooleanOps<T,less>(ve,t1,SYM_LT,t2);
+ addBooleanOps<T,lessequals>(ve,t1,SYM_LE,t2);
+ addBooleanOps<T,greaterequals>(ve,t1,SYM_GE,t2);
+ addBooleanOps<T,greater>(ve,t1,SYM_GT,t2);
- addOps<T,run::min>(ve,t1,"min",t2);
- addOps<T,run::max>(ve,t1,"max",t2);
- addBinOps<T,run::min>(ve,t1,t2,t3,t4,"min");
- addBinOps<T,run::max>(ve,t1,t2,t3,t4,"max");
+ addOps<T,run::min>(ve,t1,SYM(min),t2);
+ addOps<T,run::max>(ve,t1,SYM(max),t2);
+ addBinOps<T,run::min>(ve,t1,t2,t3,t4,SYM(min));
+ addBinOps<T,run::max>(ve,t1,t2,t3,t4,SYM(max));
- addFunc(ve,sortArray<T>,t2,"sort",formal(t2,"a"));
- addFunc(ve,sortArray2<T>,t3,"sort",formal(t3,"a"));
+ addFunc(ve,sortArray<T>,t2,SYM(sort),formal(t2,SYM(a)));
+ addFunc(ve,sortArray2<T>,t3,SYM(sort),formal(t3,SYM(a)));
- addFunc(ve,searchArray<T>,primInt(),"search",formal(t2,"a"),
- formal(t1,"key"));
+ addFunc(ve,searchArray<T>,primInt(),SYM(search),formal(t2,SYM(a)),
+ formal(t1,SYM(key)));
}
template<class T>
void addBasicOps(venv &ve, ty *t1, ty *t2, ty *t3, ty *t4, bool integer=false,
bool Explicit=false)
{
- addOps<T,plus>(ve,t1,"+",t2);
- addOps<T,minus>(ve,t1,"-",t2);
+ addOps<T,plus>(ve,t1,SYM_PLUS,t2);
+ addOps<T,minus>(ve,t1,SYM_MINUS,t2);
- addArray2Array2Op<T,plus>(ve,t3,"+");
- addArray2Array2Op<T,minus>(ve,t3,"-");
+ addArray2Array2Op<T,plus>(ve,t3,SYM_PLUS);
+ addArray2Array2Op<T,minus>(ve,t3,SYM_MINUS);
- addFunc(ve,&id,t1,"+",formal(t1,"a"));
- addFunc(ve,&id,t2,"+",formal(t2,"a"));
- addFunc(ve,Negate<T>,t1,"-",formal(t1,"a"));
- addFunc(ve,arrayFunc<T,T,negate>,t2,"-",formal(t2,"a"));
- addFunc(ve,arrayFunc2<T,T,negate>,t3,"-",formal(t3,"a"));
- if(!integer) addFunc(ve,interp<T>,t1,"interp",formal(t1,"a",false,Explicit),
- formal(t1,"b",false,Explicit),
- formal(primReal(),"t"));
+ addFunc(ve,&id,t1,SYM_PLUS,formal(t1,SYM(a)));
+ addFunc(ve,&id,t2,SYM_PLUS,formal(t2,SYM(a)));
+ 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),
+ formal(t1,SYM(b),false,Explicit),
+ formal(primReal(),SYM(t)));
- addFunc(ve,sumArray<T>,t1,"sum",formal(t2,"a"));
+ addFunc(ve,sumArray<T>,t1,SYM(sum),formal(t2,SYM(a)));
addUnorderedOps<T>(ve,t1,t2,t3,t4);
}
@@ -930,16 +949,16 @@ void addOps(venv &ve, ty *t1, ty *t2, ty *t3, ty *t4, bool integer=false,
{
addBasicOps<T>(ve,t1,t2,t3,t4,integer,Explicit);
- addOps<T,times>(ve,t1,"*",t2);
- addOpArray2<T,times>(ve,t1,"*",t3);
- addArray2Op<T,times>(ve,t1,"*",t3);
+ addOps<T,times>(ve,t1,SYM_TIMES,t2);
+ addOpArray2<T,times>(ve,t1,SYM_TIMES,t3);
+ addArray2Op<T,times>(ve,t1,SYM_TIMES,t3);
if(!integer) {
- addOps<T,run::divide>(ve,t1,"/",t2);
- addArray2Op<T,run::divide>(ve,t1,"/",t3);
+ addOps<T,run::divide>(ve,t1,SYM_DIVIDE,t2);
+ addArray2Op<T,run::divide>(ve,t1,SYM_DIVIDE,t3);
}
- addOps<T,power>(ve,t1,"^",t2);
+ addOps<T,power>(ve,t1,SYM_CARET,t2);
}
@@ -949,34 +968,34 @@ void addArrayOps(venv &ve, types::array *t)
ty *ct = t->celltype;
addFunc(ve, run::arrayAlias,
- primBoolean(), "alias", formal(t, "a"), formal(t, "b"));
+ primBoolean(), SYM(alias), formal(t, SYM(a)), formal(t, SYM(b)));
addFunc(ve, run::newDuplicateArray,
- t, "array", formal(primInt(), "n"),
- formal(ct, "value"),
- formal(primInt(), "depth", /*optional=*/ true));
+ t, SYM(array), formal(primInt(), SYM(n)),
+ formal(ct, SYM(value)),
+ formal(primInt(), SYM(depth), /*optional=*/ true));
switch (t->depth()) {
case 1:
- addFunc(ve, run::arrayCopy, t, "copy", formal(t, "a"));
- addRestFunc(ve, run::arrayConcat, t, "concat", new types::array(t));
+ addFunc(ve, run::arrayCopy, t, SYM(copy), formal(t, SYM(a)));
+ addRestFunc(ve, run::arrayConcat, t, SYM(concat), new types::array(t));
addFunc(ve, run::arraySequence,
- t, "sequence", formal(new function(ct, primInt()), "f"),
- formal(primInt(), "n"));
+ t, SYM(sequence), formal(new function(ct, primInt()), SYM(f)),
+ formal(primInt(), SYM(n)));
addFunc(ve, run::arrayFunction,
- t, "map", formal(new function(ct, ct), "f"), formal(t, "a"));
+ t, SYM(map), formal(new function(ct, ct), SYM(f)), formal(t, SYM(a)));
addFunc(ve, run::arraySort,
- t, "sort", formal(t, "a"),
- formal(new function(primBoolean(), ct, ct), "f"));
+ t, SYM(sort), formal(t, SYM(a)),
+ formal(new function(primBoolean(), ct, ct), SYM(f)));
break;
case 2:
- addFunc(ve, run::array2Copy, t, "copy", formal(t, "a"));
- addFunc(ve, run::array2Transpose, t, "transpose", formal(t, "a"));
+ addFunc(ve, run::array2Copy, t, SYM(copy), formal(t, SYM(a)));
+ addFunc(ve, run::array2Transpose, t, SYM(transpose), formal(t, SYM(a)));
break;
case 3:
- addFunc(ve, run::array3Copy, t, "copy", formal(t, "a"));
- addFunc(ve, run::array3Transpose, t, "transpose", formal(t, "a"),
- formal(IntArray(),"perm"));
+ addFunc(ve, run::array3Copy, t, SYM(copy), formal(t, SYM(a)));
+ addFunc(ve, run::array3Transpose, t, SYM(transpose), formal(t, SYM(a)),
+ formal(IntArray(),SYM(perm)));
break;
default:
break;
@@ -985,29 +1004,29 @@ void addArrayOps(venv &ve, types::array *t)
void addRecordOps(venv &ve, record *r)
{
- addFunc(ve, run::boolMemEq, primBoolean(), "alias", formal(r, "a"),
- formal(r, "b"));
- addFunc(ve, run::boolMemEq, primBoolean(), "==", formal(r, "a"),
- formal(r, "b"));
- addFunc(ve, run::boolMemNeq, primBoolean(), "!=", formal(r, "a"),
- formal(r, "b"));
+ addFunc(ve, run::boolMemEq, primBoolean(), SYM(alias), formal(r, SYM(a)),
+ formal(r, SYM(b)));
+ addFunc(ve, run::boolMemEq, primBoolean(), SYM_EQ, formal(r, SYM(a)),
+ formal(r, SYM(b)));
+ addFunc(ve, run::boolMemNeq, primBoolean(), SYM_NEQ, formal(r, SYM(a)),
+ formal(r, SYM(b)));
}
void addFunctionOps(venv &ve, function *f)
{
- addFunc(ve, run::boolFuncEq, primBoolean(), "==", formal(f, "a"),
- formal(f, "b"));
- addFunc(ve, run::boolFuncNeq, primBoolean(), "!=", formal(f, "a"),
- formal(f, "b"));
+ addFunc(ve, run::boolFuncEq, primBoolean(), SYM_EQ, formal(f, SYM(a)),
+ formal(f, SYM(b)));
+ addFunc(ve, run::boolFuncNeq, primBoolean(), SYM_NEQ, formal(f, SYM(a)),
+ formal(f, SYM(b)));
}
void addOperators(venv &ve)
{
- addSimpleOperator(ve,binaryOp<string,plus>,primString(),"+");
+ addSimpleOperator(ve,binaryOp<string,plus>,primString(),SYM_PLUS);
- addBooleanOps<bool,And>(ve,primBoolean(),"&",booleanArray());
- addBooleanOps<bool,Or>(ve,primBoolean(),"|",booleanArray());
- addBooleanOps<bool,Xor>(ve,primBoolean(),"^",booleanArray());
+ addBooleanOps<bool,And>(ve,primBoolean(),SYM_AMPERSAND,booleanArray());
+ addBooleanOps<bool,Or>(ve,primBoolean(),SYM_BAR,booleanArray());
+ addBooleanOps<bool,Xor>(ve,primBoolean(),SYM_CARET,booleanArray());
addUnorderedOps<bool>(ve,primBoolean(),booleanArray(),booleanArray2(),
booleanArray3());
@@ -1016,66 +1035,66 @@ void addOperators(venv &ve)
addOps<pair>(ve,primPair(),pairArray(),pairArray2(),pairArray3(),false,true);
addBasicOps<triple>(ve,primTriple(),tripleArray(),tripleArray2(),
tripleArray3());
- addFunc(ve,opArray<double,triple,times>,tripleArray(),"*",
- formal(primReal(),"a"),formal(tripleArray(),"b"));
- addFunc(ve,opArray2<double,triple,timesR>,tripleArray2(),"*",
- formal(primReal(),"a"),formal(tripleArray2(),"b"));
- addFunc(ve,arrayOp<triple,double,timesR>,tripleArray(),"*",
- formal(tripleArray(),"a"),formal(primReal(),"b"));
- addFunc(ve,array2Op<triple,double,timesR>,tripleArray2(),"*",
- formal(tripleArray2(),"a"),formal(primReal(),"b"));
- addFunc(ve,arrayOp<triple,double,divide>,tripleArray(),"/",
- formal(tripleArray(),"a"),formal(primReal(),"b"));
+ addFunc(ve,opArray<double,triple,times>,tripleArray(),SYM_TIMES,
+ formal(primReal(),SYM(a)),formal(tripleArray(),SYM(b)));
+ addFunc(ve,opArray2<double,triple,timesR>,tripleArray2(),SYM_TIMES,
+ formal(primReal(),SYM(a)),formal(tripleArray2(),SYM(b)));
+ addFunc(ve,arrayOp<triple,double,timesR>,tripleArray(),SYM_TIMES,
+ formal(tripleArray(),SYM(a)),formal(primReal(),SYM(b)));
+ addFunc(ve,array2Op<triple,double,timesR>,tripleArray2(),SYM_TIMES,
+ formal(tripleArray2(),SYM(a)),formal(primReal(),SYM(b)));
+ addFunc(ve,arrayOp<triple,double,divide>,tripleArray(),SYM_DIVIDE,
+ formal(tripleArray(),SYM(a)),formal(primReal(),SYM(b)));
addUnorderedOps<string>(ve,primString(),stringArray(),stringArray2(),
stringArray3());
- addSimpleOperator(ve,binaryOp<pair,minbound>,primPair(),"minbound");
- addSimpleOperator(ve,binaryOp<pair,maxbound>,primPair(),"maxbound");
- addSimpleOperator(ve,binaryOp<triple,minbound>,primTriple(),"minbound");
- addSimpleOperator(ve,binaryOp<triple,maxbound>,primTriple(),"maxbound");
+ addSimpleOperator(ve,binaryOp<pair,minbound>,primPair(),SYM(minbound));
+ addSimpleOperator(ve,binaryOp<pair,maxbound>,primPair(),SYM(maxbound));
+ addSimpleOperator(ve,binaryOp<triple,minbound>,primTriple(),SYM(minbound));
+ addSimpleOperator(ve,binaryOp<triple,maxbound>,primTriple(),SYM(maxbound));
addBinOps<pair,minbound>(ve,primPair(),pairArray(),pairArray2(),pairArray3(),
- "minbound");
+ SYM(minbound));
addBinOps<pair,maxbound>(ve,primPair(),pairArray(),pairArray2(),pairArray3(),
- "maxbound");
+ SYM(maxbound));
addBinOps<triple,minbound>(ve,primTriple(),tripleArray(),tripleArray2(),
- tripleArray3(),"minbound");
+ tripleArray3(),SYM(minbound));
addBinOps<triple,maxbound>(ve,primTriple(),tripleArray(),tripleArray2(),
- tripleArray3(),"maxbound");
-
- addFunc(ve,arrayFunc<double,pair,abs>,realArray(),"abs",
- formal(pairArray(),"a"));
- addFunc(ve,arrayFunc<double,triple,abs>,realArray(),"abs",
- formal(tripleArray(),"a"));
-
- addFunc(ve,arrayFunc<pair,pair,conjugate>,pairArray(),"conj",
- formal(pairArray(),"a"));
- addFunc(ve,arrayFunc2<pair,pair,conjugate>,pairArray2(),"conj",
- formal(pairArray2(),"a"));
-
- addFunc(ve,binaryOp<Int,divide>,primReal(),"/",
- formal(primInt(),"a"),formal(primInt(),"b"));
- addFunc(ve,arrayOp<Int,Int,divide>,realArray(),"/",
- formal(IntArray(),"a"),formal(primInt(),"b"));
- addFunc(ve,opArray<Int,Int,divide>,realArray(),"/",
- formal(primInt(),"a"),formal(IntArray(),"b"));
- addFunc(ve,arrayArrayOp<Int,divide>,realArray(),"/",
- formal(IntArray(),"a"),formal(IntArray(),"b"));
+ tripleArray3(),SYM(maxbound));
+
+ addFunc(ve,arrayFunc<double,pair,abs>,realArray(),SYM(abs),
+ formal(pairArray(),SYM(a)));
+ addFunc(ve,arrayFunc<double,triple,abs>,realArray(),SYM(abs),
+ formal(tripleArray(),SYM(a)));
+
+ addFunc(ve,arrayFunc<pair,pair,conjugate>,pairArray(),SYM(conj),
+ formal(pairArray(),SYM(a)));
+ addFunc(ve,arrayFunc2<pair,pair,conjugate>,pairArray2(),SYM(conj),
+ formal(pairArray2(),SYM(a)));
+
+ addFunc(ve,binaryOp<Int,divide>,primReal(),SYM_DIVIDE,
+ formal(primInt(),SYM(a)),formal(primInt(),SYM(b)));
+ addFunc(ve,arrayOp<Int,Int,divide>,realArray(),SYM_DIVIDE,
+ formal(IntArray(),SYM(a)),formal(primInt(),SYM(b)));
+ addFunc(ve,opArray<Int,Int,divide>,realArray(),SYM_DIVIDE,
+ formal(primInt(),SYM(a)),formal(IntArray(),SYM(b)));
+ addFunc(ve,arrayArrayOp<Int,divide>,realArray(),SYM_DIVIDE,
+ formal(IntArray(),SYM(a)),formal(IntArray(),SYM(b)));
addOrderedOps<Int>(ve,primInt(),IntArray(),IntArray2(),IntArray3());
addOrderedOps<double>(ve,primReal(),realArray(),realArray2(),realArray3());
addOrderedOps<string>(ve,primString(),stringArray(),stringArray2(),
stringArray3());
- addOps<Int,mod>(ve,primInt(),"%",IntArray());
- addOps<double,mod>(ve,primReal(),"%",realArray());
+ addOps<Int,mod>(ve,primInt(),SYM_MOD,IntArray());
+ addOps<double,mod>(ve,primReal(),SYM_MOD,realArray());
- addRestFunc(ve,diagonal<Int>,IntArray2(),"diagonal",IntArray());
- addRestFunc(ve,diagonal<double>,realArray2(),"diagonal",realArray());
- addRestFunc(ve,diagonal<pair>,pairArray2(),"diagonal",pairArray());
+ addRestFunc(ve,diagonal<Int>,IntArray2(),SYM(diagonal),IntArray());
+ addRestFunc(ve,diagonal<double>,realArray2(),SYM(diagonal),realArray());
+ addRestFunc(ve,diagonal<pair>,pairArray2(),SYM(diagonal),pairArray());
}
-dummyRecord *createDummyRecord(venv &ve, const char *name)
+dummyRecord *createDummyRecord(venv &ve, symbol *name)
{
dummyRecord *r=new dummyRecord(name);
#ifdef DEBUG_FRAME
@@ -1112,357 +1131,357 @@ void base_venv(venv &ve)
addOperators(ve);
addGuideOperators(ve);
- addRealFunc(sin);
- addRealFunc(cos);
- addRealFunc(tan);
- addRealFunc(asin);
- addRealFunc(acos);
- addRealFunc(atan);
- addRealFunc(exp);
- addRealFunc(log);
- addRealFunc(log10);
- addRealFunc(sinh);
- addRealFunc(cosh);
- addRealFunc(tanh);
- addRealFunc(asinh);
- addRealFunc(acosh);
- addRealFunc(atanh);
- addRealFunc(sqrt);
- addRealFunc(cbrt);
- addRealFunc(fabs);
- addRealFunc<fabs>(ve,"abs");
- addRealFunc(expm1);
- addRealFunc(log1p);
- addRealIntFunc<ldexp>(ve, "ldexp", "x", "e");
-
- addRealFunc(pow10);
- addRealFunc(identity);
+ addRealFunc(sin,SYM(sin));
+ addRealFunc(cos,SYM(cos));
+ addRealFunc(tan,SYM(tan));
+ addRealFunc(asin,SYM(asin));
+ addRealFunc(acos,SYM(acos));
+ addRealFunc(atan,SYM(atan));
+ addRealFunc(exp,SYM(exp));
+ addRealFunc(log,SYM(log));
+ addRealFunc(log10,SYM(log10));
+ addRealFunc(sinh,SYM(sinh));
+ addRealFunc(cosh,SYM(cosh));
+ addRealFunc(tanh,SYM(tanh));
+ addRealFunc(asinh,SYM(asinh));
+ addRealFunc(acosh,SYM(acosh));
+ addRealFunc(atanh,SYM(atanh));
+ addRealFunc(sqrt,SYM(sqrt));
+ addRealFunc(cbrt,SYM(cbrt));
+ addRealFunc(fabs,SYM(fabs));
+ addRealFunc<fabs>(ve,SYM(abs));
+ addRealFunc(expm1,SYM(expm1));
+ addRealFunc(log1p,SYM(log1p));
+ addRealIntFunc<ldexp>(ve, SYM(ldexp), SYM(x), SYM(e));
+
+ addRealFunc(pow10,SYM(pow10));
+ addRealFunc(identity,SYM(identity));
#ifdef HAVE_LIBGSL
- GSLModule=new dummyRecord(symbol::trans("gsl"));
+ GSLModule=new dummyRecord(SYM(gsl));
gsl_set_error_handler(GSLerrorhandler);
// Common functions
- addGSLRealRealFunc<gsl_hypot>("hypot","x","y");
-// addGSLRealRealRealFunc<gsl_hypot3>("hypot","x","y","z");
- addGSLRealRealRealFuncInt<gsl_fcmp>("fcmp","x","y","epsilon");
+ 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>("Ai");
- addGSLDOUBLEFunc<gsl_sf_airy_Bi>("Bi");
- addGSLDOUBLEFunc<gsl_sf_airy_Ai_scaled>("Ai_scaled");
- addGSLDOUBLEFunc<gsl_sf_airy_Bi_scaled>("Bi_scaled");
- addGSLDOUBLEFunc<gsl_sf_airy_Ai_deriv>("Ai_deriv");
- addGSLDOUBLEFunc<gsl_sf_airy_Bi_deriv>("Bi_deriv");
- addGSLDOUBLEFunc<gsl_sf_airy_Ai_deriv_scaled>("Ai_deriv_scaled");
- addGSLDOUBLEFunc<gsl_sf_airy_Bi_deriv_scaled>("Bi_deriv_scaled");
- addGSLIntFunc<gsl_sf_airy_zero_Ai>("zero_Ai");
- addGSLIntFunc<gsl_sf_airy_zero_Bi>("zero_Bi");
- addGSLIntFunc<gsl_sf_airy_zero_Ai_deriv>("zero_Ai_deriv");
- addGSLIntFunc<gsl_sf_airy_zero_Bi_deriv>("zero_Bi_deriv");
+ 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>("J0");
- addGSLRealFunc<gsl_sf_bessel_J1>("J1");
- addGSLIntRealFunc<gsl_sf_bessel_Jn>("Jn");
- addGSLRealFunc<gsl_sf_bessel_Y0>("Y0");
- addGSLRealFunc<gsl_sf_bessel_Y1>("Y1");
- addGSLIntRealFunc<gsl_sf_bessel_Yn>("Yn");
- addGSLRealFunc<gsl_sf_bessel_I0>("I0");
- addGSLRealFunc<gsl_sf_bessel_I1>("I1");
- addGSLIntRealFunc<gsl_sf_bessel_In>("I");
- addGSLRealFunc<gsl_sf_bessel_I0_scaled>("I0_scaled");
- addGSLRealFunc<gsl_sf_bessel_I1_scaled>("I1_scaled");
- addGSLIntRealFunc<gsl_sf_bessel_In_scaled>("I_scaled");
- addGSLRealFunc<gsl_sf_bessel_K0>("K0");
- addGSLRealFunc<gsl_sf_bessel_K1>("K1");
- addGSLIntRealFunc<gsl_sf_bessel_Kn>("K");
- addGSLRealFunc<gsl_sf_bessel_K0_scaled>("K0_scaled");
- addGSLRealFunc<gsl_sf_bessel_K1_scaled>("K1_scaled");
- addGSLIntRealFunc<gsl_sf_bessel_Kn_scaled>("K_scaled");
- addGSLRealFunc<gsl_sf_bessel_j0>("j0");
- addGSLRealFunc<gsl_sf_bessel_j1>("j1");
- addGSLRealFunc<gsl_sf_bessel_j2>("j2");
- addGSLIntRealFunc<gsl_sf_bessel_jl>("j","l");
- addGSLRealFunc<gsl_sf_bessel_y0>("y0");
- addGSLRealFunc<gsl_sf_bessel_y1>("y1");
- addGSLRealFunc<gsl_sf_bessel_y2>("y2");
- addGSLIntRealFunc<gsl_sf_bessel_yl>("y","l");
- addGSLRealFunc<gsl_sf_bessel_i0_scaled>("i0_scaled");
- addGSLRealFunc<gsl_sf_bessel_i1_scaled>("i1_scaled");
- addGSLRealFunc<gsl_sf_bessel_i2_scaled>("i2_scaled");
- addGSLIntRealFunc<gsl_sf_bessel_il_scaled>("i_scaled","l");
- addGSLRealFunc<gsl_sf_bessel_k0_scaled>("k0_scaled");
- addGSLRealFunc<gsl_sf_bessel_k1_scaled>("k1_scaled");
- addGSLRealFunc<gsl_sf_bessel_k2_scaled>("k2_scaled");
- addGSLIntRealFunc<gsl_sf_bessel_kl_scaled>("k_scaled","l");
- addGSLRealRealFunc<gsl_sf_bessel_Jnu>("J");
- addGSLRealRealFunc<gsl_sf_bessel_Ynu>("Y");
- addGSLRealRealFunc<gsl_sf_bessel_Inu>("I");
- addGSLRealRealFunc<gsl_sf_bessel_Inu_scaled>("I_scaled");
- addGSLRealRealFunc<gsl_sf_bessel_Knu>("K");
- addGSLRealRealFunc<gsl_sf_bessel_lnKnu>("lnK");
- addGSLRealRealFunc<gsl_sf_bessel_Knu_scaled>("K_scaled");
- addGSLIntFunc<gsl_sf_bessel_zero_J0>("zero_J0");
- addGSLIntFunc<gsl_sf_bessel_zero_J1>("zero_J1");
- addGSLRealIntFunc<gsl_sf_bessel_zero_Jnu>("zero_J");
+ 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>("clausen");
+ addGSLRealFunc<gsl_sf_clausen>(SYM(clausen));
// Coulomb functions
- addGSLRealRealFunc<gsl_sf_hydrogenicR_1>("hydrogenicR_1","Z","r");
- addGSLIntIntRealRealFunc<gsl_sf_hydrogenicR>("hydrogenicR","n","l","Z",
- "r");
+ 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>("coupling_3j","two_ja",
- "two_jb","two_jc","two_ma",
- "two_mb","two_mc");
- addGSLIntIntIntIntIntIntFunc<gsl_sf_coupling_6j>("coupling_6j","two_ja",
- "two_jb","two_jc","two_jd",
- "two_je","two_jf");
- addGSLIntIntIntIntIntIntIntIntIntFunc<gsl_sf_coupling_9j>("coupling_9j",
- "two_ja","two_jb",
- "two_jc","two_jd",
- "two_je","two_jf",
- "two_jg","two_jh",
- "two_ji");
+ 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>("dawson");
+ addGSLRealFunc<gsl_sf_dawson>(SYM(dawson));
// Debye functions
- addGSLRealFunc<gsl_sf_debye_1>("debye_1");
- addGSLRealFunc<gsl_sf_debye_2>("debye_2");
- addGSLRealFunc<gsl_sf_debye_3>("debye_3");
- addGSLRealFunc<gsl_sf_debye_4>("debye_4");
- addGSLRealFunc<gsl_sf_debye_5>("debye_5");
- addGSLRealFunc<gsl_sf_debye_6>("debye_6");
+ 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>("dilog");
+ 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>("K","k");
- addGSLDOUBLEFunc<gsl_sf_ellint_Ecomp>("E","k");
- addGSLDOUBLE2Func<gsl_sf_ellint_Pcomp>("P","k","n");
- addGSLDOUBLE2Func<gsl_sf_ellint_F>("F");
- addGSLDOUBLE2Func<gsl_sf_ellint_E>("E");
- addGSLDOUBLE3Func<gsl_sf_ellint_P>("P","phi","k","n");
- addGSLDOUBLE3Func<gsl_sf_ellint_D>("D","phi","k","n");
- addGSLDOUBLE2Func<gsl_sf_ellint_RC>("RC","x","y");
- addGSLDOUBLE3Func<gsl_sf_ellint_RD>("RD","x","y","z");
- addGSLDOUBLE3Func<gsl_sf_ellint_RF>("RF","x","y","z");
- addGSLDOUBLE4Func<gsl_sf_ellint_RJ>("RJ","x","y","z","p");
+ 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>("erf");
- addGSLRealFunc<gsl_sf_erfc>("erfc");
- addGSLRealFunc<gsl_sf_log_erfc>("log_erfc");
- addGSLRealFunc<gsl_sf_erf_Z>("erf_Z");
- addGSLRealFunc<gsl_sf_erf_Q>("erf_Q");
- addGSLRealFunc<gsl_sf_hazard>("hazard");
+ 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>("exp_mult","x","y");
-// addGSLRealFunc<gsl_sf_expm1>("expm1");
- addGSLRealFunc<gsl_sf_exprel>("exprel");
- addGSLRealFunc<gsl_sf_exprel_2>("exprel_2");
- addGSLIntRealFunc<gsl_sf_exprel_n>("exprel","n","x");
+ 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>("E1");
- addGSLRealFunc<gsl_sf_expint_E2>("E2");
-// addGSLIntRealFunc<gsl_sf_expint_En>("En","n","x");
- addGSLRealFunc<gsl_sf_expint_Ei>("Ei");
- addGSLRealFunc<gsl_sf_Shi>("Shi");
- addGSLRealFunc<gsl_sf_Chi>("Chi");
- addGSLRealFunc<gsl_sf_expint_3>("Ei3");
- addGSLRealFunc<gsl_sf_Si>("Si");
- addGSLRealFunc<gsl_sf_Ci>("Ci");
- addGSLRealFunc<gsl_sf_atanint>("atanint");
+ 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>("FermiDiracM1");
- addGSLRealFunc<gsl_sf_fermi_dirac_0>("FermiDirac0");
- addGSLRealFunc<gsl_sf_fermi_dirac_1>("FermiDirac1");
- addGSLRealFunc<gsl_sf_fermi_dirac_2>("FermiDirac2");
- addGSLIntRealFunc<gsl_sf_fermi_dirac_int>("FermiDirac","j","x");
- addGSLRealFunc<gsl_sf_fermi_dirac_mhalf>("FermiDiracMHalf");
- addGSLRealFunc<gsl_sf_fermi_dirac_half>("FermiDiracHalf");
- addGSLRealFunc<gsl_sf_fermi_dirac_3half>("FermiDirac3Half");
- addGSLRealRealFunc<gsl_sf_fermi_dirac_inc_0>("FermiDiracInc0","x","b");
+ 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>("gamma");
- addGSLRealFunc<gsl_sf_lngamma>("lngamma");
- addGSLRealFunc<gsl_sf_gammastar>("gammastar");
- addGSLRealFunc<gsl_sf_gammainv>("gammainv");
- addGSLIntFunc<gsl_sf_fact>("fact");
- addGSLIntFunc<gsl_sf_doublefact>("doublefact");
- addGSLIntFunc<gsl_sf_lnfact>("lnfact");
- addGSLIntFunc<gsl_sf_lndoublefact>("lndoublefact");
- addGSLUnsignedUnsignedFunc<gsl_sf_choose>("choose","n","m");
- addGSLUnsignedUnsignedFunc<gsl_sf_lnchoose>("lnchoose","n","m");
- addGSLIntRealFunc<gsl_sf_taylorcoeff>("taylorcoeff","n","x");
- addGSLRealRealFunc<gsl_sf_poch>("poch","a","x");
- addGSLRealRealFunc<gsl_sf_lnpoch>("lnpoch","a","x");
- addGSLRealRealFunc<gsl_sf_pochrel>("pochrel","a","x");
- addGSLRealRealFunc<gsl_sf_gamma_inc>("gamma","a","x");
- addGSLRealRealFunc<gsl_sf_gamma_inc_Q>("gamma_Q","a","x");
- addGSLRealRealFunc<gsl_sf_gamma_inc_P>("gamma_P","a","x");
- addGSLRealRealFunc<gsl_sf_beta>("beta","a","b");
- addGSLRealRealFunc<gsl_sf_lnbeta>("lnbeta","a","b");
- addGSLRealRealRealFunc<gsl_sf_beta_inc>("beta","a","b","x");
+ 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>("gegenpoly_1","lambda","x");
- addGSLRealRealFunc<gsl_sf_gegenpoly_2>("gegenpoly_2","lambda","x");
- addGSLRealRealFunc<gsl_sf_gegenpoly_3>("gegenpoly_3","lambda","x");
- addGSLIntRealRealFunc<gsl_sf_gegenpoly_n>("gegenpoly","n","lambda","x");
+ 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>("hy0F1","c","x");
- addGSLIntIntRealFunc<gsl_sf_hyperg_1F1_int>("hy1F1","m","n","x");
- addGSLRealRealRealFunc<gsl_sf_hyperg_1F1>("hy1F1","a","b","x");
- addGSLIntIntRealFunc<gsl_sf_hyperg_U_int>("U","m","n","x");
- addGSLRealRealRealFunc<gsl_sf_hyperg_U>("U","a","b","x");
- addGSLRealRealRealRealFunc<gsl_sf_hyperg_2F1>("hy2F1","a","b","c","x");
- addGSLRealRealRealRealFunc<gsl_sf_hyperg_2F1_conj>("hy2F1_conj","aR","aI","c",
- "x");
- addGSLRealRealRealRealFunc<gsl_sf_hyperg_2F1_renorm>("hy2F1_renorm","a","b",
- "c","x");
- addGSLRealRealRealRealFunc<gsl_sf_hyperg_2F1_conj_renorm>("hy2F1_conj_renorm",
- "aR","aI","c","x");
- addGSLRealRealRealFunc<gsl_sf_hyperg_2F0>("hy2F0","a","b","x");
+ 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>("L1","a","x");
- addGSLRealRealFunc<gsl_sf_laguerre_2>("L2","a","x");
- addGSLRealRealFunc<gsl_sf_laguerre_3>("L3","a","x");
- addGSLIntRealRealFunc<gsl_sf_laguerre_n>("L","n","a","x");
+ 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>("W0");
- addGSLRealFunc<gsl_sf_lambert_Wm1>("Wm1");
+ addGSLRealFunc<gsl_sf_lambert_W0>(SYM(W0));
+ addGSLRealFunc<gsl_sf_lambert_Wm1>(SYM(Wm1));
// Legendre functions and spherical harmonics
- addGSLRealFunc<gsl_sf_legendre_P1>("P1");
- addGSLRealFunc<gsl_sf_legendre_P2>("P2");
- addGSLRealFunc<gsl_sf_legendre_P3>("P3");
- addGSLIntRealFunc<gsl_sf_legendre_Pl>("Pl","l");
- addGSLRealFunc<gsl_sf_legendre_Q0>("Q0");
- addGSLRealFunc<gsl_sf_legendre_Q1>("Q1");
- addGSLIntRealFunc<gsl_sf_legendre_Ql>("Ql","l");
- addGSLIntIntRealFunc<gsl_sf_legendre_Plm>("Plm","l","m","x");
- addGSLIntIntRealFunc<gsl_sf_legendre_sphPlm>("sphPlm","l","m","x");
- addGSLRealRealFunc<gsl_sf_conicalP_half>("conicalP_half","lambda","x");
- addGSLRealRealFunc<gsl_sf_conicalP_mhalf>("conicalP_mhalf","lambda","x");
- addGSLRealRealFunc<gsl_sf_conicalP_0>("conicalP_0","lambda","x");
- addGSLRealRealFunc<gsl_sf_conicalP_1>("conicalP_1","lambda","x");
- addGSLIntRealRealFunc<gsl_sf_conicalP_sph_reg>("conicalP_sph_reg","l",
- "lambda","x");
- addGSLIntRealRealFunc<gsl_sf_conicalP_cyl_reg>("conicalP_cyl_reg","m",
- "lambda","x");
- addGSLRealRealFunc<gsl_sf_legendre_H3d_0>("H3d0","lambda","eta");
- addGSLRealRealFunc<gsl_sf_legendre_H3d_1>("H3d1","lambda","eta");
- addGSLIntRealRealFunc<gsl_sf_legendre_H3d>("H3d","l","lambda","eta");
+ 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>("logabs");
-// addGSLRealFunc<gsl_sf_log_1plusx>("log1p");
- addGSLRealFunc<gsl_sf_log_1plusx_mx>("log1pm");
+ 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>("pow","x","n");
+ addGSLRealSignedFunc<gsl_sf_pow_int>(SYM(pow),SYM(x),SYM(n));
// Psi (digamma) function
- addGSLSignedFunc<gsl_sf_psi_int>("psi","n");
- addGSLRealFunc<gsl_sf_psi>("psi");
- addGSLRealFunc<gsl_sf_psi_1piy>("psi_1piy","y");
- addGSLSignedFunc<gsl_sf_psi_1_int>("psi1","n");
- addGSLRealFunc<gsl_sf_psi_1>("psi1","x");
- addGSLIntRealFunc<gsl_sf_psi_n>("psi","n","x");
+ 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>("synchrotron_1");
- addGSLRealFunc<gsl_sf_synchrotron_2>("synchrotron_2");
+ addGSLRealFunc<gsl_sf_synchrotron_1>(SYM(synchrotron_1));
+ addGSLRealFunc<gsl_sf_synchrotron_2>(SYM(synchrotron_2));
// Transport functions
- addGSLRealFunc<gsl_sf_transport_2>("transport_2");
- addGSLRealFunc<gsl_sf_transport_3>("transport_3");
- addGSLRealFunc<gsl_sf_transport_4>("transport_4");
- addGSLRealFunc<gsl_sf_transport_5>("transport_5");
+ 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>("sinc");
- addGSLRealFunc<gsl_sf_lnsinh>("lnsinh");
- addGSLRealFunc<gsl_sf_lncosh>("lncosh");
+ 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>("zeta","n");
- addGSLRealFunc<gsl_sf_zeta>("zeta","s");
- addGSLSignedFunc<gsl_sf_zetam1_int>("zetam1","n");
- addGSLRealFunc<gsl_sf_zetam1>("zetam1","s");
- addGSLRealRealFunc<gsl_sf_hzeta>("hzeta","s","q");
- addGSLSignedFunc<gsl_sf_eta_int>("eta","n");
- addGSLRealFunc<gsl_sf_eta>("eta","s");
+ 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, "test");
- addFunc(fun->e.ve,realReal<sin>,primReal(),"f",formal(primReal(),"x"));
- addVariable<Int>(fun->e.ve,1,primInt(),"x");
+ dummyRecord *fun=createDummyRecord(ve, SYM(test));
+ addFunc(fun->e.ve,realReal<sin>,primReal(),SYM(f),formal(primReal(),SYM(x)));
+ addVariable<Int>(fun->e.ve,1,primInt(),SYM(x));
#endif
- addFunc(ve,writestring,primVoid(),"write",
- formal(primFile(),"file",true),
- formal(primString(),"s"),
- formal(voidFileFunction(),"suffix",true));
+ addFunc(ve,writestring,primVoid(),SYM(write),
+ formal(primFile(),SYM(file),true),
+ formal(primString(),SYM(s)),
+ formal(voidFileFunction(),SYM(suffix),true));
addWrite(ve,write<transform>,primTransform(),transformArray());
addWrite(ve,write<guide *>,primGuide(),guideArray());
addWrite(ve,write<pen>,primPen(),penArray());
- addFunc(ve,arrayArrayOp<pen,equals>,booleanArray(),"==",
- formal(penArray(),"a"),formal(penArray(),"b"));
- addFunc(ve,arrayArrayOp<pen,notequals>,booleanArray(),"!=",
- formal(penArray(),"a"),formal(penArray(),"b"));
-
- addFunc(ve,arrayFunction,realArray(),"map",
- formal(realPairFunction(),"f"),
- formal(pairArray(),"a"));
- addFunc(ve,arrayFunction,IntArray(),"map",
- formal(IntRealFunction(),"f"),
- formal(realArray(),"a"));
-
- addConstant<Int>(ve, Int_MAX, primInt(), "intMax");
- addConstant<Int>(ve, Int_MIN, primInt(), "intMin");
- addConstant<double>(ve, HUGE_VAL, primReal(), "inf");
- addConstant<double>(ve, run::infinity, primReal(), "infinity");
- addConstant<double>(ve, DBL_MAX, primReal(), "realMax");
- addConstant<double>(ve, DBL_MIN, primReal(), "realMin");
- addConstant<double>(ve, DBL_EPSILON, primReal(), "realEpsilon");
- addConstant<Int>(ve, DBL_DIG, primInt(), "realDigits");
- addConstant<Int>(ve, RAND_MAX, primInt(), "randMax");
- addConstant<double>(ve, PI, primReal(), "pi");
+ addFunc(ve,arrayArrayOp<pen,equals>,booleanArray(),SYM_EQ,
+ formal(penArray(),SYM(a)),formal(penArray(),SYM(b)));
+ addFunc(ve,arrayArrayOp<pen,notequals>,booleanArray(),SYM_NEQ,
+ formal(penArray(),SYM(a)),formal(penArray(),SYM(b)));
+
+ addFunc(ve,arrayFunction,realArray(),SYM(map),
+ formal(realPairFunction(),SYM(f)),
+ formal(pairArray(),SYM(a)));
+ addFunc(ve,arrayFunction,IntArray(),SYM(map),
+ formal(IntRealFunction(),SYM(f)),
+ formal(realArray(),SYM(a)));
+
+ addConstant<Int>(ve, Int_MAX, primInt(), SYM(intMax));
+ addConstant<Int>(ve, Int_MIN, primInt(), SYM(intMin));
+ addConstant<double>(ve, HUGE_VAL, primReal(), SYM(inf));
+ addConstant<double>(ve, run::infinity, primReal(), SYM(infinity));
+ addConstant<double>(ve, DBL_MAX, primReal(), SYM(realMax));
+ addConstant<double>(ve, DBL_MIN, primReal(), SYM(realMin));
+ addConstant<double>(ve, DBL_EPSILON, primReal(), SYM(realEpsilon));
+ addConstant<Int>(ve, DBL_DIG, primInt(), SYM(realDigits));
+ addConstant<Int>(ve, RAND_MAX, primInt(), SYM(randMax));
+ addConstant<double>(ve, PI, primReal(), SYM(pi));
addConstant<string>(ve, string(settings::VERSION)+string(SVN_REVISION),
- primString(),"VERSION");
+ primString(),SYM(VERSION));
- addVariable<pen>(ve, &processData().currentpen, primPen(), "currentpen");
+ addVariable<pen>(ve, &processData().currentpen, primPen(), SYM(currentpen));
#ifdef OPENFUNCEXAMPLE
- addOpenFunc(ve, openFunc, primInt(), "openFunc");
+ addOpenFunc(ve, openFunc, primInt(), SYM(openFunc));
#endif
gen_runtime_venv(ve);