confun must calculate the vector Fx of nonlinear constraint functions and (optionally) its Jacobian =Fx for a specified n1 (n) element vector x. If there are no nonlinear constraints (i.e., ncnln=0), confun will never be called by e04ug and confun may be the dummy method E04UGM. (E04UGM is included in the NAG Library.) If there are nonlinear constraints, the first call to confun will occur before the first call to objfun.

Syntax

C#
public delegate void E04UG_CONFUN(
	ref int mode,
	int ncnln,
	int njnln,
	int nnzjac,
	double[] x,
	double[] f,
	double[] fjac,
	int nstate
)
Visual Basic
Public Delegate Sub E04UG_CONFUN ( _
	ByRef mode As Integer, _
	ncnln As Integer, _
	njnln As Integer, _
	nnzjac As Integer, _
	x As Double(), _
	f As Double(), _
	fjac As Double(), _
	nstate As Integer _
)
Visual C++
public delegate void E04UG_CONFUN(
	int% mode, 
	int ncnln, 
	int njnln, 
	int nnzjac, 
	array<double>^ x, 
	array<double>^ f, 
	array<double>^ fjac, 
	int nstate
)
F#
type E04UG_CONFUN = 
    delegate of 
        mode : int byref * 
        ncnln : int * 
        njnln : int * 
        nnzjac : 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 confun. Only the following values need be assigned:
mode=0
f.
mode=1
All available elements of fjac.
mode=2
f and all available elements of fjac.
On exit: you may set to a negative value as follows:
mode-2
The solution to the current problem is terminated and in this case e04ug will terminate with ifail set to mode.
mode=-1
The nonlinear constraint functions cannot be calculated at the current x. e04ug will then terminate with ifail=-1 unless this occurs during the linesearch; in this case, the linesearch will shorten the step and try again.
ncnln
Type: System..::..Int32
On entry: nN, the number of nonlinear constraints. These must be the first ncnln constraints in the problem.
njnln
Type: System..::..Int32
On entry: n1, the number of nonlinear variables. These must be the first njnln variables in the problem.
nnzjac
Type: System..::..Int32
On entry: the number of nonzero elements in the constraint Jacobian. Note that nnzjac will usually be less than ncnln×njnln.
x
Type: array<System..::..Double>[]()[][]
On entry: x, the vector of nonlinear Jacobian variables at which the nonlinear constraint functions and/or the available elements of the constraint Jacobian are to be evaluated.
f
Type: array<System..::..Double>[]()[][]
On exit: if mode=0 or 2, f[i-1] must contain the value of the ith nonlinear constraint function at x.
fjac
Type: array<System..::..Double>[]()[][]
On entry: the elements of fjac are set to special values which enable e04ug to detect whether they are changed by confun.
On exit: if mode=1 or 2, fjac must return the available elements of the constraint Jacobian evaluated at x. These elements must be stored in exactly the same positions as implied by the definitions of the arrays a, ha and ka. If optional parameter Derivative Level=2 or 3, the value of any constant Jacobian element not defined by confun will be obtained directly from a. Note that the method does not perform any internal checks for consistency (except indirectly via the optional parameter Verify Level), so great care is essential.
nstate
Type: System..::..Int32
On entry: if nstate=1, then e04ug is calling confun for the first time. This parameter setting allows you to save computation time if certain data must be read or calculated only once.
If nstate2, then e04ug is calling confun for the last time. This parameter setting allows you to perform some additional computation on the final solution. In general, the last call to confun is made with nstate=2+ifail (see []).
Otherwise, nstate=0.

See Also