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 E04US_OBJFUN(
	ref int mode,
	int m,
	int n,
	int needfi,
	double[] x,
	double[] f,
	double[,] fjac,
	int nstate
)
Visual Basic
Public Delegate Sub E04US_OBJFUN ( _
	ByRef mode As Integer, _
	m As Integer, _
	n As Integer, _
	needfi As Integer, _
	x As Double(), _
	f As Double(), _
	fjac As Double(,), _
	nstate As Integer _
)
Visual C++
public delegate void E04US_OBJFUN(
	int% mode, 
	int m, 
	int n, 
	int needfi, 
	array<double>^ x, 
	array<double>^ f, 
	array<double,2>^ fjac, 
	int nstate
)
F#
type E04US_OBJFUN = 
    delegate of 
        mode : int byref * 
        m : int * 
        n : int * 
        needfi : int * 
        x : float[] * 
        f : float[] * 
        fjac : 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 fjac.
mode=2 and needfi<0
f and all available elements of fjac.
On exit: may be set to a negative value if you wish to terminate the solution to the current problem, and in this case e04us will terminate with ifail set to mode.
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 fx and/or all available elements of its Jacobian 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.
fjac
Type: array<System..::..Double,2>[,](,)[,][,]
On entry: is set to a special value.
On exit: if mode=1 or 2 and needfi<0, the ith row of fjac must contain the available elements of the vector fi given by
fi=fix1,fix2,,fixnT,
evaluated at the point x. See also the parameter nstate.
nstate
Type: System..::..Int32
On entry: if nstate=1 then e04us is calling objfun for the first time. This parameter setting allows you to save computation time if certain data must be read or calculated only once.

See Also