* First time call always init.
IJOB = 1
1 CONTINUE
CALL CGSREVCOM(N, B, X, WORK, LDW, ITER, RESID, INFO,
$ NDX1, NDX2, SCLR1, SCLR2, IJOB)
* On a return from REVCOM() we use the table
* to figure out what is reqd.
IF (IJOB .eq. -1) THEN
* revcom wants to terminate, so do it.
GOTO 2
ELSEIF (IJOB .eq. 1) THEN
* call matvec.
CALL MATVEC(SCLR1, WORK(NDX1), SCLR2, WORK(NDX2))
ELSEIF (IJOB .eq. 2) THEN
* call solve.
CALL PSOLVE(WORK(NDX1), WORK(NDX2))
ELSEIF (IJOB .eq. 3) THEN
* call matvec with X.
CALL MATVEC(SCLR1, X, SCLR2, WORK(NDX2))
ELSEIF (IJOB .EQ. 4) THEN
* do stopping test 2
* if FirstTime, set info so that BNRM2 is computed.
IF( FTFLG ) INFO = -1
CALL STOPTEST2(N, WORK(NDX1), B, BNRM2, RESID, TOL, INFO)
FTFLG = .FALSE.
ENDIF
* done what revcom asked, set IJOB & go back to it.
IJOB = 2
GOTO 1
* come here to terminate
2 CONTINUE
*
RETURN
* End of CGS
END
[Previous Page]
[First Page]
[Next Page]