checkDLL: Check shared library (DLL/.so) of a compiled model.

checkDLLR Documentation

Check shared library (DLL/.so) of a compiled model.

Description

Check shared library (DLL/.so) of a compiled model and create a list of symbols.

Usage

checkDLL(func, jacfunc, dllname, initfunc, verbose, nout, outnames, JT = 1)

Arguments

func

character: name of the derivative function.

jacfunc

an R function, that computes the Jacobian of the system of differential equations \partial\dot{y}_i/\partial y_j, or a string giving the name of a function or subroutine in ‘dllname’ that computes the Jacobian.

dllname

a string giving the name of the shared library (without extension) that contains all the compiled function or subroutine definitions refered to in func and jacfunc.

initfunc

the name of the initialisation function (which initialises values of parameters), as provided in ‘dllname’. See package vignette "compiledCode".

verbose

reserved for future extensions.

nout

only used if dllname is specified and the model is defined in compiled code: the number of output variables calculated in the compiled function func, present in the shared library. Note: it is not automatically checked whether this is indeed the number of output variables calculated in the dll - you have to perform this check in the code.

outnames

only used if ‘dllname’ is specified and nout > 0: the names of output variables calculated in the compiled function func, present in the shared library. These names will be used to label the output matrix.

JT

integer specifying the type of the Jacobian. The default value of 1 must be set to 2 for solver lsodes if 'func' is specified in a DLL or inline compiled and if a 'jacfunc' is provided.

Details

The function checkDLL is normally called internally by the solver functions. It can be used to avoid overhead, when a small compiled model with a low number of integration steps is repeatedly called. The feature is currently only available for the lsoda solver.

Value

List of class deSolve.symbols with:

ModelInit

pointer to the init function of the DLL (class "externalptr").

Func

pointer to the derivative function in the DLL (class "externalptr").

JacFunc

pointer to the Jacobi function in the DLL (class "externalptr").

Nglobal

number of output variables calculated in the compiled function.

Nmtot

list of names of derivatives and output variables.

See Also

lsoda

Examples

## Not run: 
symbols <- checkDLL(func = "derivs", jacfunc = NULL, dllname = "lorenzc",
             initfunc = "initmod", verbose = TRUE, nout = 0,
             outnames = NULL, JT = 1)

## End(Not run)


deSolve documentation built on Nov. 28, 2023, 1:11 a.m.