[S] uniroot -- doesn't work recursively

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Mon, 26 Apr 1999 15:19:37 +0200

>>>>> "PD" == Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:

    PD> Balasubramanian Narasimhan <naras@stat.stanford.edu> writes:
    >> >>>>> "Peter" == Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk>
    >> writes:
    Peter> The only sensible thing to do to get this to work is to rewite
    Peter> zeroin in C. According to the comments in the file, it is a
    Peter> transcription of an Algol60 program, so it is probably not hard
    Peter> to convert it to another Algol descendant.
    >>  Agreed, but there's no need for a rewrite. A C version has been
    >> available in Netlib for some time.

    PD> Thanks for the pointer, Naras!

    PD> Found, adapted and inserted (in my private source tree for now). It
    PD> wasn't a complete drop-in replacement since it didn't support
    PD> max.iter and didn't return convergence info, but close enough.

The max.iter and convergence info are things that Jim Lindsey and I had
ADDED to the original netlib/Fortran code.
It's the ``value-added'' part of the R (vs. S-plus) code...

    PD> Unfortunately, closer inspection revealed that the Fortran-ness of
    PD> zeroin was not the only problem, there's also trouble with global
    PD> storage used by the wrapper routine. And since C doesn't have
    PD> lexical scoping, that stuff needs to be passed around via
    PD> arguments. Oh well...

yes (I think that's what the comment in optimize.c [the wrapper] meant
     that I had cited here...).
and  YES  it would be really nice if that could be done, finally.

r-devel 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-devel-request@stat.math.ethz.ch