e04wdp Method
関数リスト一覧   NagLibrary Namespaceへ  ライブラリイントロダクション  本ヘルプドキュメントのchm形式版

nAG supplied method for use with the callback parameter: confun.

Syntax

C#
public static void e04wdp(
	ref int mode,
	int ncnln,
	int n,
	int[] needc,
	double[] x,
	double[] ccon,
	double[,] cjac,
	int nstate
)
Visual Basic (Declaration)
Public Shared Sub e04wdp ( _
	ByRef mode As Integer, _
	ncnln As Integer, _
	n As Integer, _
	needc As Integer(), _
	x As Double(), _
	ccon As Double(), _
	cjac As Double(,), _
	nstate As Integer _
)
Visual C++
public:
static void e04wdp(
	int% mode, 
	int ncnln, 
	int n, 
	array<int>^ needc, 
	array<double>^ x, 
	array<double>^ ccon, 
	array<double,2>^ cjac, 
	int nstate
)
F#
static member e04wdp : 
        mode:int byref * 
        ncnln:int * 
        n:int * 
        needc:int[] * 
        x:float[] * 
        ccon:float[] * 
        cjac:float[,] * 
        nstate:int -> unit 

Parameters

mode
Type: System..::.Int32 %
On entry: is set by e04wdp to indicate which values must be assigned during each call of confun. Only the following values need be assigned, for each value of i such that needc[i-1]>0:
mode=0
The components of ccon corresponding to positive values in needc must be set. Other components and the array cjac are ignored.
mode=1
The known components of the rows of cjac corresponding to positive values in needc must be set. Other rows of cjac and the array ccon will be ignored.
mode=2
Only the elements of ccon corresponding to positive values of needc need to be set (and similarly for the known components of the rows of cjac).
On exit: may be used to indicate that you are unable or unwilling to evaluate the constraint functions at the current x .
During the linesearch, the constraint functions are evaluated at points of the form x=xk + αpk  after they have already been evaluated satisfactorily at xk . At any such α , if you set mode=-1 , e04wdp will evaluate the functions at some point closer to xk  (where they are more likely to be defined).
If for some reason you wish to terminate the current problem, set mode<-1 .
ncnln
Type: System..::.Int32
On entry: nN, the number of nonlinear constraints.
n
Type: System..::.Int32
On entry: n, the number of variables.
needc
Type: array< System..::.Int32 >[]()[]
An array of size [ncnln]
On entry: the indices of the elements of ccon and/or cjac that must be evaluated by confun. If needc[i-1]>0, the ith element of ccon and/or the available elements of the ith row of cjac (see parameter mode) must be evaluated at x.
x
Type: array< System..::.Double >[]()[]
An array of size [n]
On entry: x, the vector of variables at which the constraint functions and/or the available elements of the constraint Jacobian are to be evaluated.
ccon
Type: array< System..::.Double >[]()[]
An array of size [max1,ncnln]
On exit: if needc[i-1] > 0  and mode=0 or 2, ccon[i-1]  must contain the value of the ith constraint at x. The remaining elements of ccon, corresponding to the non-positive elements of needc, are ignored.
cjac
Type: array< System..::.Double ,2>[,](,)[,]
An array of size [ldcj, n]
Note: ldcj must satisfy the constraint:
On entry: the elements of cjac are set to special values that enable e04wdp to detect whether they are reset by confun.
On exit: if needc[i-1] > 0  and mode=1 or 2, the i th row of cjac must contain the available elements of the vector ci  given by
ci= ci x1 , ci x2 , , ci xn T ,
where ci xj  is the partial derivative of the ith constraint with respect to the jth variable, evaluated at the point x. See also the parameter nstate. The remaining rows of cjac, corresponding to non-positive elements of needc, are ignored.
If all elements of the constraint Jacobian are known (i.e., =2​ or ​3), any constant elements may be assigned to cjac one time only at the start of the optimization. An element of cjac that is not subsequently assigned in confun will retain its initial value throughout. Constant elements may be loaded into cjac during the first call to confun (signalled by the value nstate=1). The ability to preload constants is useful when many Jacobian elements are identically zero, in which case cjac may be initialized to zero and nonzero elements may be reset by confun.
Note that constant nonzero elements do affect the values of the constraints. Thus, if cjac[i-1,j-1]  is set to a constant value, it need not be reset in subsequent calls to confun, but the value cjac[i-1,j-1] × x[j-1]  must nonetheless be added to ccon[i-1] . For example, if cjac[0,0]=2  and cjac[0,1]=-5  then the term 2 × x[0] - 5 × x[1]  must be included in the definition of ccon[0] .
It must be emphasised that, if =0​ or ​1, unassigned elements of cjac are not treated as constant; they are estimated by finite differences, at nontrivial expense. If you do not supply a value for the optional parameter , an interval for each element of x is computed automatically at the start of the optimization. The automatic procedure can usually identify constant elements of cjac, which are then computed once only by finite differences.
nstate
Type: System..::.Int32
On entry: if nstate=1 then e04wdp 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.

Error Indicators and Warnings

Accuracy

Further Comments

See Also