[R] .Internal

rkevinburton at charter.net rkevinburton at charter.net
Thu Mar 19 05:46:51 CET 2009


I was trying to find source for optimize and I ran across

function (f, interval, ..., lower = min(interval), upper = max(interval), 
    maximum = FALSE, tol = .Machine$double.eps^0.25) 
{
    if (maximum) {
        val <- .Internal(fmin(function(arg) -f(arg, ...), lower, 
            upper, tol))
        list(maximum = val, objective = f(val, ...))
    }
    else {
        val <- .Internal(fmin(function(arg) f(arg, ...), lower, 
            upper, tol))
        list(minimum = val, objective = f(val, ...))
    }
}

Then I did a search for fmin and i came up with:

/* fmin(f, xmin, xmax tol) */
SEXP attribute_hidden do_fmin(SEXP call, SEXP op, SEXP args, SEXP rho)


So my question is where do I find the intermediary step between 

.Internal(fmin(function(arg) f(arg, ...), lower,  upper, tol))

and

SEXP attribute_hidden do_fmin(SEXP call, SEXP op, SEXP args, SEXP rho)

The number of arguments doesn't match up. I am guessing that lower and upper somehow get merged into the args. And rho is 'tol'. Right?

Thank you for your comments.

Kevin




More information about the R-help mailing list