[R] R_FindSymbol

Mathieu (Castor) Ros mathieuros at bigfoot.com
Wed Aug 2 10:39:17 CEST 2000

On Tue, 1 Aug 2000 Setzer.Woodrow at epamail.epa.gov wrote:

> I have written a function that uses LSODA from NETLIB to solve initial
> problems, given a system of ODEs written as an R function.  There are times
> it would be convenient to use the code with an ode system written in a
> language.  Certainly, that can be done using .C or .Fortran within an R
> function, but that seems inefficient (indeed, it does not enormously speed
> the numerical integration, in my limited testing).  What I would like to do
> to dynamically load a shared library, and pass the name of a symbol as a
> to my ode solver interface.  The C wrapper would then retrieve the pointer
> the function named by the string (or fail gracefully trying), and pass that
> pointer to LSODA.  It looks like all I have to do is invoke R_FindSymbol
> the name I am looking for as the first argument, and the null string as the
> second; the return value will be the pointer I am looking for.  Am I right,
> is it more complicated than that?

Have you had a look at nls2 code (http://www-bia.inra.fr/J/AB/nls2) ? It uses 
LSODA from a C function ("CalcInteg" if I remember well). 
(There is an R version)

Mathieu Ros
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list