IMSP_SP_CG IMSP_SP_CG
The IMSL_SP_CG function solves a real symmetric definite linear system using a
conjugate gradient method. A preconditioner can be supplied by using keywords.
The IMSL_SP_CG function solves the symmetric definite linear system Ax = b using the conjugate gradient method with optional preconditioning. This method is described in detail by Golub and Van Loan (1983, chapter 10), and in Hageman and Young (1981, chapter 7).
The preconditioning matrix M, is a matrix that approximates A, and for which the linear system Mz = r is easy to solve. These two properties are in conflict; balancing them is a topic of much current research. In the default usage of IMSL_SP_CG, M = I. If the keyword JACOBI is selected, M is set to the diagonal of A.
The number of iterations needed depends on the matrix and the error tolerance. As a rough guide:
Itmax = ân
for
n >> 1
See the academic references for details.
Let M be the preconditioning matrix, let b, p, r, x, and z be vectors and let t be the desired relative error. Then the algorithm used is as follows: