[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
value
> problems, given a system of ODEs written as an R function.  There are times
when
> it would be convenient to use the code with an ode system written in a
compiled
> language.  Certainly, that can be done using .C or .Fortran within an R
> function, but that seems inefficient (indeed, it does not enormously speed
up
> the numerical integration, in my limited testing).  What I would like to do
is
> to dynamically load a shared library, and pass the name of a symbol as a
string
> to my ode solver interface.  The C wrapper would then retrieve the pointer
to
> 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
with
> 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,
or
> 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)
regards,

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