This function calls the cost function defined in the fun
element of
the current object and returns the required results. If an additionnal
argument for the cost function is defined in current object, it is passed to
the function as the last argument. See
vignette('optimbase',package='optimbase')
for more details.
optimbase.function(this = NULL, x = NULL, index = NULL)
An optimization object.
The point estimate where the cost function should be evaluated, i.e. a column vector.
An integer between 1 and 6 (see
vignette('omptimbase',package='optimbase')
for more details).
Return a list with the following elements:
The updated optimization object.
The value of the cost function.
The gradient of the cost function.
The nonlinear, positive, inequality constraints.
The gradient of the nonlinear, positive, inequality constraints.
An integer:
if index > 0, everything went fine,
if index == 0, interrupts the optimization,
if index < 0, one of the function could not be evaluated.