DITSOL_PCG (matvec, pcondl, pcondr, mstop, a, ia, x, b, n, ql, iql , qr, iqr, iparam, rparam, iwork, rwork, ierror)
DITSOL_PCG has the standard parameter list for an iterative solver.
DITSOL_PCG implements the conjugate gradient method [Hestenes and Stiefel 1952, Reid 1971] for the solution of a linear system of equations where the coefficient matrix A is symmetric positive definite or mildly nonsymmetric. This method requires the routine MATVEC to provide operations for job = 0. The routines MATVEC, PCONDL (if used) and MSTOP (if used) should be declared external in your calling (sub)program. PCONDR is not used by DITSOL_PCG and is therefore a dummy input parameter. CXML provides the following two forms of the method: • Unpreconditioned conjugate gradient method: This is the conjugate gradient method applied to A * x = b where A is a symmetric positive definite or a mildly nonsymmetric matrix. As no preconditioning is used, both PCONDL and PCONDR are dummy input parameters. For the unpreconditioned conjugate gradient method, the length of the real work space array, defined by the variable nrwk (IPARAM(4)), should be at least 3*n, where n is the order of the matrix A. The vector z, passed as an input argument to the routine MSTOP, is not defined. • Conjugate gradient method with symmetric positive definite split preconditioning: This is the conjugate gradient method applied to (inverse(QL) * A * inverse(transp(QL)) ) * (transp(QL) * x) = (inverse(QL) * b) where Q = QL * transp(QL) is the symmetric positive definite preconditioning matrix. The routine PCONDL, with job= 0 should evaluate v = inverse(Q) * u The routine PCONDR is not used and an explicit split of the preconditioner Q into QL and QR is not required. For the conjugate gradient method, with symmetric positive definite split preconditioning, the length of the real work space array, defined by the variable nrwk (IPARAM(4)), should be at least 4*n, where n is the order of the matrix A. This does not include the memory requirements of the preconditioner. The vector z, passed as an input argument to the routine MSTOP, is defined as z = inverse(Q) * r where r is the residual at the i-th iteration. This routine is available in both serial and parallel versions. The routine names and parameter list are identical for both versions. For information about linking to the serial or to the parallel library, refer to the CXML Reference Manual.