From tpapp at Princeton.EDU  Thu Dec 28 15:46:28 2006
From: tpapp at Princeton.EDU (Tamas K Papp)
Date: Thu, 28 Dec 2006 15:46:28 +0100
Subject: [Rd] calling optimize/fmin from C code
Message-ID: <20061228144628.GA4458@pu100877.student.princeton.edu>

Hi,

To make a calculation (an innermost loop) that uses optimize faster, I
think I should write things in C.  Is it possible to call fmin, which
is called by optimize, from C?  It is not listed in Writing R
extensions, but I found

double Brent_fmin(double ax, double bx, double (*f)(double, void *),
                  void *info, double tol);

in Applic.h.  Is this the function I am looking for?

My guess is that ax and bx are the endpoints, f is the function, but
what is it's second argument (void *)?  What is *info?

Or is it some other function altogether?

Thanks,

Tamas



[Rd] calling optimize/fmin from C code
Tamas K Papp