Debian Codegraph @

man/checkDLL.Rd

raw
1 \name{checkDLL}
2 \alias{checkDLL}
3
4 \title{
5 Check shared library (DLL/.so) of a compiled model.
6 }
7 \description{
8 Check shared library (DLL/.so) of a compiled model and create a list of symbols.
9 }
10 \usage{
11 checkDLL(func, jacfunc, dllname, initfunc, verbose, nout, outnames, JT = 1)
12 }
13
14 \arguments{
15 \item{func}{
16 character: name of the derivative function.
17 }
18 \item{jacfunc}{an \R function, that computes the
19 Jacobian of the system of differential equations
20 \eqn{\partial\dot{y}_i/\partial y_j}{dydot(i)/dy(j)}, or
21 a string giving the name of a function or subroutine in
22 \file{dllname} that computes the Jacobian.}
23
24 \item{dllname}{a string giving the name of the shared library
25 (without extension) that contains all the compiled function or
26 subroutine definitions refered to in \code{func} and
27 \code{jacfunc}.}
28
29 \item{initfunc}{ the name of the initialisation function
30 (which initialises values of parameters), as provided in
31 \file{dllname}. See package vignette \code{"compiledCode"}.
32 }
33 \item{verbose}{reserved for future extensions.
34 }
35 \item{nout}{only used if \code{dllname} is specified and the model is
36 defined in compiled code: the number of output variables calculated
37 in the compiled function \code{func}, present in the shared
38 library. Note: it is not automatically checked whether this is
39 indeed the number of output variables calculated in the dll - you have
40 to perform this check in the code.
41 }
42 \item{outnames}{only used if \file{dllname} is specified and
43 \code{nout} > 0: the names of output variables calculated in the
44 compiled function \code{func}, present in the shared library.
45 These names will be used to label the output matrix.
46 }
47 \item{JT}{integer specifying the type of the Jacobian. The default value of 1
48 must be set to 2 for solver \code{lsodes} if `func` is specified in a DLL
49 or inline compiled and if a `jacfunc` is provided.
50 }
51 }
52 \details{
53 The function \code{checkDLL} is normally called internally by the solver
54 functions. It can be used to avoid overhead, when a small compiled
55 model with a low number of integration steps is repeatedly called.
56 The feature is currently only available for the \code{lsoda} solver.
57 }
58
59 \value{
60 List of class \code{deSolve.symbols} with:
61
62 \item{ModelInit }{pointer to the init function of the DLL (class "externalptr").}
63 \item{Func }{pointer to the derivative function in the DLL (class "externalptr").}
64 \item{JacFunc }{pointer to the Jacobi function in the DLL (class "externalptr").}
65 \item{Nglobal }{number of output variables calculated in the compiled function.}
66 \item{Nmtot }{list of names of derivatives and output variables.}
67 }
68 \seealso{
69 \code{\link{lsoda}}
70 }
71 \examples{
72 \dontrun{
73 symbols <- checkDLL(func = "derivs", jacfunc = NULL, dllname = "lorenzc",
74 initfunc = "initmod", verbose = TRUE, nout = 0,
75 outnames = NULL, JT = 1)
76 }
77
78 }
79 \keyword{math}