c05zd checks the user-supplied gradients of a set of nonlinear functions in several variables, for consistency with the functions themselves. The method must be called twice.
Syntax
C# |
---|
public static void c05zd( int mode, int m, int n, double[] x, double[] fvec, double[,] fjac, double[] xp, double[] fvecp, double[] err, out int ifail ) |
Visual Basic |
---|
Public Shared Sub c05zd ( _ mode As Integer, _ m As Integer, _ n As Integer, _ x As Double(), _ fvec As Double(), _ fjac As Double(,), _ xp As Double(), _ fvecp As Double(), _ err As Double(), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void c05zd( int mode, int m, int n, array<double>^ x, array<double>^ fvec, array<double,2>^ fjac, array<double>^ xp, array<double>^ fvecp, array<double>^ err, [OutAttribute] int% ifail ) |
F# |
---|
static member c05zd : mode : int * m : int * n : int * x : float[] * fvec : float[] * fjac : float[,] * xp : float[] * fvecp : float[] * err : float[] * ifail : int byref -> unit |
Parameters
- mode
- Type: System..::..Int32On entry: the value on the first call and the value on the second call of c05zd.Constraint: or .
- m
- Type: System..::..Int32On entry: , the number of functions.Constraint: .
- n
- Type: System..::..Int32
Constraint: .
- x
- Type: array<System..::..Double>[]()[][]An array of size [n]On entry: the components of a point , at which the consistency check is to be made. (See [Accuracy].)
- fvec
- Type: array<System..::..Double>[]()[][]An array of size [m]
- fjac
- Type: array<System..::..Double,2>[,](,)[,][,]
- xp
- Type: array<System..::..Double>[]()[][]An array of size [n]
- fvecp
- Type: array<System..::..Double>[]()[][]An array of size [m]
- err
- Type: array<System..::..Double>[]()[][]An array of size [m]On exit: if , err contains measures of correctness of the respective gradients. If , err is undefined. If there is no loss of significance (see [Accuracy]), then if is the th user-supplied gradient , for is correct, whilst if is the th gradient is incorrect. For values of between and the categorisation is less certain. In general, a value of indicates that the th gradient is probably correct.
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
c05zd is based on the MINPACK routine CHKDER (see Moré et al. (1980)). It checks the th gradient for consistency with the th function by computing a forward-difference approximation along a suitably chosen direction and comparing this approximation with the user-supplied gradient along the same direction. The principal characteristic of c05zd is its invariance under changes in scale of the variables or functions.
References
Moré J J, Garbow B S and Hillstrom K E (1980) User guide for MINPACK-1 Technical Report ANL-80-74 Argonne National Laboratory
Error Indicators and Warnings
Errors or warnings detected by the method:
-
On entry, .
Constraint: or .
-
On entry, .
Constraint: .
-
On entry, .
Constraint: .
Accuracy
c05zd does not perform reliably if cancellation or rounding errors cause a severe loss of significance in the evaluation of a function. Therefore, none of the components of should be unusually small (in particular, zero) or any other value which may cause loss of significance. The relative differences between corresponding elements of fvecp and fvec should be at least two orders of magnitude greater than the machine precision returned by x02aj.
Parallelism and Performance
None.
Further Comments
Example
This example checks the Jacobian matrix for a problem with functions of variables (sometimes referred to as the Bard problem).