Provides a wrapper around user analytic Hessian function for nonlinear optimization to try to control for inadmissible arguments to user that function, as well as provide for maximization.
A vector of parameters to the user-supplied function
A user-supplied function object that has three sub-functions fn, gr, and hess. fn generates the scalar numerical value of the objective function, gr its vector valued gradient (or is NULL) and hess a numerical matrix for the Hessian (or is NULL).
Note that a FIXED name environment opx12env is used to carry the user's fn, gr and hess and the counters.
uhess returns a matrix numeric value, but if the inputs to the function
are inadmissible, all elements are set to the R
constant .Machine$double.xmax and the
fn fails. The returned value has an attribute
inadmissible which is returned TRUE in this case, but otherwise
cat("uhess: try an inadmissible set of parameters to a user function\n")