library binds an external mathematical function to a variable in Sollya

Library names:

sollya_obj_t sollya_lib_libraryfunction(sollya_obj_t, char *,                                         int (*)(mpfi_t, mpfi_t, int)) sollya_obj_t sollya_lib_build_function_libraryfunction(sollya_obj_t, char *,                                                        int (*)(mpfi_t,                                                                mpfi_t, int)) sollya_obj_t sollya_lib_libraryfunction_with_data(                                         sollya_obj_t, char *,                                         int (*)(mpfi_t, mpfi_t, int, void *),                                         void *, void (*)(void *)) sollya_obj_t sollya_lib_build_function_libraryfunction_with_data(                                         sollya_obj_t, char *,                                         int (*)(mpfi_t,                                                 mpfi_t, int, void *),                                         void *, void (*)(void *))


library(path) : string -> function


Example 1:

   > bashexecute("gcc -fPIC -Wall -c libraryexample.c -I$HOME/.local/include");
   > bashexecute("gcc -shared -o libraryexample libraryexample.o -lgmp -lmpfr");
   > myownlog = library("./libraryexample");
   > evaluate(log(x), 2);
   > evaluate(myownlog(x), 2);
See also: function, bashexecute, externalproc, externaldata, externalplot, diff, evaluate, libraryconstant
Go back to the list of commands