1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
lib Scilab Group Scilab Function lib
NAME
lib - library definition
CALLING SEQUENCE
xlib = lib('lib-dir')
PARAMETERS
lib-dir: character string
DESCRIPTION
lib-dir is a character string defining a directory that contains compiled
Scilab function (.bin) files. In addition to these files lib-dir must
have a file called names, that contains the names of the functions
defined in lib-dir. On success, all functions in lib-dir are available
from within Scilab. They are loaded on demand when called for the first
time. Binary files can be created from within Scilab with the command
save. Scilab's standard libraries are defined using lib on the
SCIDIR/macros/* subdirectories. As an example, given the following
definitions
deff('z = myplus(x, y)', 'z = x + y')
deff('z = yourplus(x, y)', 'x = x - y')
lib_dir = '/home/joeuser/myscidir'
myplus and yourplus are compiled into lib_dir with the commands
save(lib_dir + '/myplus.bin', myplus)
save(lib_dir + '/yourplus.bin', yourplus)
A library can now be created from the two .bin files with the command
xlib = lib(lib_path + '/')
xlib is a Scilab variable of type "library". A library variable usually
is saved for later loading, either on-line or from the user-specific
startup file ($HOME/.scilab).
RESTRICTIONS
Scilab tacitly assumes that file foo.bin defines only a single function
named foo.
SEE ALSO
genlib, save, deff, getf, whereis
|