GetYacasPID | obtain Yacas process number |
ShowPS | view equations graphically |
MakeFunctionPlugin | compile numerical functions into plugins |
Version | show version of Yacas |
Vi | edit a file or function |
GetYacasPID() |
Requires: a Unix shell.
In> GetYacasPID() Out> 26456; |
ShowPS(expr) |
Requires: a Unix shell, latex, dvips, gv or another Postscript viewer.
In> [ PSViewCommand := "ghostview"; \ ShowPS(x+2*Sin(x)); ] Expression exported as /tmp/yacas-tmp file-28802.tex Out> True; |
MakeFunctionPlugin("name", body) |
body -- expression, function of arguments, must evaluate to a function of some variables.
Requires: a Unix shell, a compiler named c++ with ELF .so support, Yacas headers in FindFile("")/include; current directory must be writable.
The body expression must be a CForm()-exportable function of the arguments and may contain numerical constants. Pi is allowed and will be converted to floating-point.
All arguments and the return value of the function are assumed to be double precision real numbers. The result of passing a non-numerical argument will be an unevaluated expression.
Example: In> MakeFunctionPlugin("f1", {x,y}, Sin(x/y)) Function f1(x,y) loaded from plugins.tmp/libf1_plugin_cc.so Out> True; In> f1(2,3) Out> 0.618369803069736989620253; In> f1(x,5) Out> f1(x,5); |
The function creates the following files in subdirectory plugins.tmp/ of current directory:
double f1_plugin_cc(double x, double y) { return sin(x/y); } |
After creating these files, MakeFunctionPlugin() will:
If you call MakeFunctionPlugin() repeatedly to define a function with the same name, old files will be overwritten and old libraries will be unloaded with DllUnload().
Version() |
In> Version() Out> "1.0.48rev3"; In> LessThan(Version(), "1.0.47") Out> False; In> GreaterThan(Version(), "1.0.47") Out> True; |
The last two calls show that the LessThan and GreaterThan functions can be used for comparing version numbers. This method is only guaranteed, however, if the version is always expressed in the form d.d.dd as above.
Vi(filename); Vi(functionname); |
functionname - name of a function to find for editing
It finds the function by scanning the *.def files that have been reported to the system. (Vi calls FindFunction for this.) If editing a function, the command will jump directly to the first occurrence of the name of the function in the file (usually the beginning of a definition of a function).
For Vi() to be really useful, you need to start Yacas from the scripts/ directory in the development tree. In that case, FindFunction() will return the filename under that directory. Otherwise, FindFunction() will return a name in the systemwide installation directory (or directory specified in the --rootdir option).
In> Vi("yacasinit.ys") Out> True; In> Vi("Sum") Out> True; |