If mode=0 or 2, objfun must calculate the objective function; otherwise if mode=1, objfun must calculate the objective function and the gradients.

Syntax

C#
public delegate void E04XA_OBJFUN(
	ref int mode,
	int n,
	double[] x,
	ref double objf,
	double[] objgrd,
	int nstate
)
Visual Basic
Public Delegate Sub E04XA_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 E04XA_OBJFUN(
	int% mode, 
	int n, 
	array<double>^ x, 
	double% objf, 
	array<double>^ objgrd, 
	int nstate
)
F#
type E04XA_OBJFUN = 
    delegate of 
        mode : int byref * 
        n : int * 
        x : float[] * 
        objf : float byref * 
        objgrd : float[] * 
        nstate : int -> unit

Parameters

mode
Type: System..::..Int32%
mode indicates which parameter values within objfun need to be set.
On entry: to objfun, mode is always set to the value that you set it to before the call to e04xa.
On exit: its value must not be altered unless you wish to indicate a failure within objfun, in which case it should be set to a negative value. If mode is negative on exit from objfun, the execution of e04xa is terminated with ifail set to mode.
n
Type: System..::..Int32
On entry: the number n of variables as input to e04xa.
x
Type: array<System..::..Double>[]()[][]
On entry: the point x at which the objective function (and gradients if mode=1) is to be evaluated.
objf
Type: System..::..Double%
On exit: must be set to the value of the objective function.
objgrd
Type: array<System..::..Double>[]()[][]
On exit: if mode=1, objgrd[j-1] must contain the value of the first derivative with respect to x.
If mode1, objgrd need not be set.
nstate
Type: System..::..Int32
On entry: will be set to 1 on the first call of objfun by e04xa, and is 0 for all subsequent calls. Thus, if you wish, nstate may be tested within objfun in order to perform certain calculations once only. For example you may read data.

See Also