objfun must calculate either the ith element of the vector fx=f1x,f2x,,fmxT or all m elements of fx and (optionally) its Jacobian (=fx) for a specified n-element vector x.

Syntax

C#
public delegate void E05US_OBJFUN(
	ref int mode,
	int m,
	int n,
	int needfi,
	double[] x,
	double[] f,
	double[,] fjsl,
	int nstate
)
Visual Basic
Public Delegate Sub E05US_OBJFUN ( _
	ByRef mode As Integer, _
	m As Integer, _
	n As Integer, _
	needfi As Integer, _
	x As Double(), _
	f As Double(), _
	fjsl As Double(,), _
	nstate As Integer _
)
Visual C++
public delegate void E05US_OBJFUN(
	int% mode, 
	int m, 
	int n, 
	int needfi, 
	array<double>^ x, 
	array<double>^ f, 
	array<double,2>^ fjsl, 
	int nstate
)
F#
type E05US_OBJFUN = 
    delegate of 
        mode : int byref * 
        m : int * 
        n : int * 
        needfi : int * 
        x : float[] * 
        f : float[] * 
        fjsl : 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 and needfi=i, where i>0
f[i-1].
mode=0 and needfi<0
f.
mode=1 and needfi<0
All available elements of fjsl.
mode=2 and needfi<0
f and all available elements of fjsl.
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 e05us will move to the next local minimization problem.
m
Type: System..::..Int32
On entry: m, the number of subfunctions.
n
Type: System..::..Int32
On entry: n, the number of variables.
needfi
Type: System..::..Int32
On entry: if needfi=i>0, only the ith element of fx needs to be evaluated at x; the remaining elements need not be set. This can result in significant computational savings when mn.
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.
f
Type: array<System..::..Double>[]()[][]
On exit: if mode=0 and needfi=i>0, f[i-1] must contain the value of fi at x.
If mode=0 or 2 and needfi<0, f[i-1] must contain the value of fi at x, for i=1,2,,m.
fjsl
Type: array<System..::..Double,2>[,](,)[,][,]
fjsl may be regarded as a two-dimensional ‘slice’ of the three-dimensional array fjac of e05us.
On entry: is set to a special value.
On exit: if mode=1 or 2 and needfi<0, the ith row of fjsl must contain the available elements of the vector fi given by
fi=fi/x1,fi/x2,,fi/xnT,
evaluated at the point x. See also the parameter nstate.
nstate
Type: System..::..Int32
On entry: if nstate=1 then e05us 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 read or calculated only once.

See Also