You can optionally specify a lower bound on the eigenvalues, α, of the computed correlation matrix, forcing the matrix to be strictly positive definite, if 0<α<1.

Zero elements in H should be used when you wish to put no emphasis on the corresponding element of G. The algorithm scales H so that the maximum element is 1. It is this scaled matrix that is used in computing the norm above and for the stopping criteria described in Section 7.

Note that if the elements in H vary by several orders of magnitude from one another the algorithm may fail to converge.

On entry: the first dimension of the array X as declared in the (sub)program from which G02AJF is called.

Constraint:
LDX≥N.

11: ITER – INTEGEROutput

On exit: the number of iterations taken.

12: NORM – REAL (KIND=nag_wp)Output

On exit: the value of H∘G-XF after the final iteration.

13: IFAIL – INTEGERInput/Output

On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.

For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.

On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).

Errors or warnings detected by the routine:

IFAIL=1

On entry, N=value.
Constraint: N>0.

IFAIL=2

On entry, LDG=value and N=value.
Constraint: LDG≥N.

IFAIL=3

On entry, LDH=value and N=value.
Constraint: LDH≥N.

IFAIL=4

On entry, LDX=value and N=value.
Constraint: LDX≥N.

IFAIL=5

On entry, ALPHA=value.
Constraint: ALPHA<1.0.

IFAIL=6

On entry, one or more of the off-diagonal elements of H were negative.

IFAIL=7

Routine fails to converge in value iterations.
Increase MAXIT or check the call to the routine.

IFAIL=8

Failure to solve intermediate eigenproblem. This should not occur. Please contact NAG with details of your call.

IFAIL=-999

Dynamic memory allocation failed.

7 Accuracy

The returned accuracy is controlled by ERRTOL and limited by machine precision. If ei is the value of NORM at the ith iteration, that is

ei=H∘G-XF,

where H has been scaled as described above.

Then the algorithm terminates when:

ei-ei-11+maxei,ei-1≤ERRTOL.

8 Further Comments

Arrays are internally allocated by G02AJF. The total size of these arrays is 15×N+5×N×N+max2×N×N+6×N+1,120+9×N real elements and 5×N+3 integer elements. All allocated memory is freed before return of G02AJF.