* F04AEF Example Program Text * Mark 15 Revised. NAG Copyright 1991. * .. Parameters .. INTEGER NMAX, LDA, LDB, LDC, LDAA, LDBB PARAMETER (NMAX=8,LDA=NMAX,LDB=NMAX,LDC=NMAX,LDAA=NMAX, + LDBB=NMAX) INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) * .. Local Scalars .. INTEGER I, IFAIL, J, M, N * .. Local Arrays .. DOUBLE PRECISION A(LDA,NMAX), AA(LDAA,NMAX), B(LDB,1), BB(LDBB,1), + C(LDC,1), WKSPCE(NMAX) * .. External Subroutines .. EXTERNAL F04AEF * .. Executable Statements .. WRITE (NOUT,*) 'F04AEF Example Program Results' * Skip heading in data file READ (NIN,*) READ (NIN,*) N WRITE (NOUT,*) M = 1 IF (N.GE.0 .AND. N.LE.NMAX) THEN READ (NIN,*) ((A(I,J),J=1,N),I=1,N), (B(I,1),I=1,N) IFAIL = 1 * CALL F04AEF(A,LDA,B,LDB,N,M,C,LDC,WKSPCE,AA,LDAA,BB,LDBB,IFAIL) * IF (IFAIL.EQ.0) THEN WRITE (NOUT,*) ' Solution' WRITE (NOUT,99998) (C(I,1),I=1,N) ELSE WRITE (NOUT,99997) IFAIL END IF ELSE WRITE (NOUT,99999) 'N is out of range: N = ', N END IF * 99999 FORMAT (1X,A,I5) 99998 FORMAT (1X,F9.4) 99997 FORMAT (1X,' ** F04AEF returned with IFAIL = ',I5) END