Name:

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 *))

Usage:

library(path) : string -> function

Description:

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);
   0.69314718055994530941723212145817656807550013436025
   > evaluate(myownlog(x), 2);
   0.69314718055994530941723212145817656807550013436025
See also: function, bashexecute, externalproc, externalplot, diff, evaluate, libraryconstant