objfun must calculate the objective function Fx and (optionally) its gradient gx=Fx for a specified n-vector x.

Syntax

C#
public delegate void E05UC_OBJFUN(
	ref int mode,
	int n,
	double[] x,
	ref double objf,
	double[] objgrd,
	int nstate
)
Visual Basic
Public Delegate Sub E05UC_OBJFUN ( _
	ByRef mode As Integer, _
	n As Integer, _
	x As Double(), _
	ByRef objf As Double, _
	objgrd As Double(), _
	nstate As Integer _
)
Visual C++
public delegate void E05UC_OBJFUN(
	int% mode, 
	int n, 
	array<double>^ x, 
	double% objf, 
	array<double>^ objgrd, 
	int nstate
)
F#
type E05UC_OBJFUN = 
    delegate of 
        mode : int byref * 
        n : int * 
        x : float[] * 
        objf : float byref * 
        objgrd : float[] * 
        nstate : int -> unit

Parameters

mode
Type: System..::..Int32%
On entry: indicates which values must be assigned during each call of objfun. Only the following values need be assigned:
mode=0
objf.
mode=1
All available elements of objgrd.
mode=2
objf and all available elements of objgrd.
On exit: may be set to a negative value if you wish to abandon the solution to the current local minimization problem. In this case e05uc will move to the next local minimization problem.
n
Type: System..::..Int32
On entry: n, the number of variables.
x
Type: array<System..::..Double>[]()[][]
On entry: x, the vector of variables at which the objective function and/or all available elements of its gradient are to be evaluated.
objf
Type: System..::..Double%
On exit: if mode=0 or 2, objf must be set to the value of the objective function at x.
objgrd
Type: array<System..::..Double>[]()[][]
On entry: the elements of objgrd are set to special values which enable e05uc to detect whether they are changed by objfun.
On exit: if mode=1 or 2, objgrd must return the available elements of the gradient evaluated at x.
nstate
Type: System..::..Int32
On entry: if nstate=1 then e05uc is calling objfun for the first time on the current local optimization problem. This parameter setting allows you to save computation time if certain data must be calculated only once.

See Also