Commit 5630f2d8 authored by ulrich_y's avatar ulrich_y
Browse files

Added clearcache and set_options to mathlink

parent 942247c6
......@@ -2,7 +2,13 @@
:Evaluate:
Print["handyG by L. Naterop, Y. Ulrich, A. Signer"];
G::usage = "G function";
Begin["`Private`"];
ClearCache::usage = "Clears handyG cache";
SetHandyOptions::usage = "Sets evaluation options";
MPLdel::usage = "difference between two successive terms at which the series expansion is truncated.";
LiInf::usage = "number of terms in the expansion of classical polylogarithms.";
hCircle::usage = "the size of the H\[ODoubleDot]lder circle \[Lambda]";
:Evaluate: Begin["`Private`"];
:Evaluate:
args2r[a_]:=Re[N[a/.SubPlus|SubMinus->Identity]];
args2i[a_]:=Im[N[a/.SubPlus|SubMinus->Identity]];
args2e[a_]:=Switch[Head[#], SubPlus, 1, SubMinus, -1, _, 1]& /@ a;
......@@ -14,6 +20,22 @@
:ReturnType: Manual
:End:
:Begin:
:Function: wipecache
:Pattern: ClearCache[]
:Arguments: {}
:ArgumentTypes: {}
:ReturnType: Manual
:End:
:Begin:
:Function: setopts
:Pattern: SetHandyOptions[opts___Rule]
:Arguments: List@@( {MPLdel, LiInf, hCircle } /. {opts} /. s_Symbol->-1)
:ArgumentTypes: {Real, Integer, Real}
:ReturnType: Manual
:End:
:Evaluate:
End[];
EndPackage[];
......@@ -55,6 +77,37 @@ void gpl(double * re, long nr, double * im, long ni, int*ieps, long ne)
}
void __maths_functions_MOD_clearcache();
void wipecache(void)
{
__maths_functions_MOD_clearcache();
MLPutSymbol(stdlink, "Null");
}
double __globals_MOD_hoeldercircle;
double __globals_MOD_mpldel;
int __globals_MOD_polyloginfinity;
void setopts(double del, int inf, double circ)
{
if(del > 0)
__globals_MOD_mpldel = del;
if (inf > 0)
__globals_MOD_polyloginfinity = inf;
if (circ > 0)
__globals_MOD_hoeldercircle = circ;
MLPutFunction(stdlink, "List", 3);
MLPutFunction(stdlink, "Rule", 2);
MLPutSymbol(stdlink, "MPLdel");
MLPutReal(stdlink, __globals_MOD_mpldel);
MLPutFunction(stdlink, "Rule", 2);
MLPutSymbol(stdlink, "LiInf");
MLPutInteger32(stdlink, __globals_MOD_polyloginfinity);
MLPutFunction(stdlink, "Rule", 2);
MLPutSymbol(stdlink, "hCircle");
MLPutReal(stdlink, __globals_MOD_hoeldercircle);
}
int main(int argc, char **argv)
{
return MLMain(argc, argv);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment