The syntax of the calling sequences for different layers of access to PCG is illustrated below.
The top-level calling sequence for the package is given by
CALL _PCG (IJOB,_<precon>,_<meth>,
IA,JA,A,U,UEXACT,B,
IWK,FWK,IPARM,FPARM,IER)
where ``_'' is either S, D, C or Z
depending
on whether single/double precision or real/complex arithmetic is desired,
IJOB specifies the requested task such as the solution of single or
multiple systems,
<precon> and <meth> denote externally-defined
preconditioner and iterative method names,
IA, JA and A store the matrix ,
U, UEXACT and B store the approximate solution,
(optional) true solution and right hand side vectors,
IWK and FWK denote integer and floating point workspace,
IPARM and FPARM are parameter arrays,
and IER is the error code.
The interface to a particular iterative method such as conjugate gradient is given by
CALL _<meth> (IJOB,<mysuba>,IA,JA,A,
<mysubq>,IQ,JQ,Q,U,UEXACT,B,
IWK,FWK,IPARM,FPARM,IER)
where <meth> is the desired iterative method, IQ, JQ and Q are used to store the preconditioner, and <mysuba> and <mysubq> are user-defined matrix-vector product and preconditioning routines with calling sequences of the form
CALL <mysuba> (IJOB,IA,JA,A,VI,VO) CALL <mysubq> (IJOB,IQ,JQ,Q,VI,VO)
where VI and VO are respectively the input and output vectors
and IJOB specifies the task requested, e.g. whether
or
is requested.
Similarly, a reverse communication layer call to iterative method <meth> is given by
CALL _<meth>R (IJOB,IREQ,U,UEXACT,B,
IVA,IVQL,IVQR,
IWK,FWK,IPARM,FPARM,IER)
where IJOB specifies the task requested by the calling routine, IREQ specifies the task requested by the reverse communication routine of the calling routine, and IVA, IVQL and IVQR refer to the input and output vectors to be used for the user's matrix-vector product or preconditioning step.
These three layers of access allow both ease of use via a simple top-level interface using a standardized matrix format, or alternatively a more general avenue of access for application matrix data structures which may not fit in to one of the supplied formats.