NAG Library Routine Document
F04ASF calculates the accurate solution of a set of real symmetric positive definite linear equations with a single right-hand side, , using a Cholesky factorization and iterative refinement.
||LDA, N, IFAIL
||A(LDA,*), B(max(1,N)), C(max(1,N)), WK1(max(1,N)), WK2(max(1,N))
Given a set of real linear equations , where is a symmetric positive definite matrix, F04ASF first computes a Cholesky factorization of as where is lower triangular. An approximation to is found by forward and backward substitution. The residual vector is then calculated using additional precision and a correction to is found by solving . is then replaced by , and this iterative refinement of the solution is repeated until machine accuracy is obtained.
Wilkinson J H and Reinsch C (1971) Handbook for Automatic Computation II, Linear Algebra Springer–Verlag
- 1: A(LDA,) – REAL (KIND=nag_wp) arrayInput/Output
the second dimension of the array A
must be at least
On entry: the upper triangle of the by positive definite symmetric matrix . The elements of the array below the diagonal need not be set.
On exit: the elements of the array below the diagonal are overwritten; the upper triangle of is unchanged.
- 2: LDA – INTEGERInput
: the first dimension of the array A
as declared in the (sub)program from which F04ASF is called.
- 3: B() – REAL (KIND=nag_wp) arrayInput
the dimension of the array B
must be at least
On entry: the right-hand side vector .
- 4: N – INTEGERInput
On entry: , the order of the matrix .
- 5: C() – REAL (KIND=nag_wp) arrayOutput
On exit: the solution vector .
- 6: WK1() – REAL (KIND=nag_wp) arrayWorkspace
- 7: WK2() – REAL (KIND=nag_wp) arrayWorkspace
- 8: IFAIL – INTEGERInput/Output
must be set to
. 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
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Errors or warnings detected by the routine:
The matrix is not positive definite, possibly due to rounding errors.
Iterative refinement fails to improve the solution, i.e., the matrix is too ill-conditioned.
The computed solutions should be correct to full machine accuracy. For a detailed error analysis see page 39 of Wilkinson and Reinsch (1971)
The time taken by F04ASF is approximately proportional to .
The routine must not
be called with the same name for parameters B
This example solves the set of linear equations
9.1 Program Text
Program Text (f04asfe.f90)
9.2 Program Data
Program Data (f04asfe.d)
9.3 Program Results
Program Results (f04asfe.r)