* F11MLF Example Program Text * Mark 21 Release. NAG Copyright 2004. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER LA, NMAX PARAMETER (LA=10000,NMAX=1000) * .. Local Scalars .. DOUBLE PRECISION ANORM INTEGER I, IFAIL, N, NNZ CHARACTER NORM * .. Local Arrays .. DOUBLE PRECISION A(LA) INTEGER ICOLZP(NMAX+1), IROWIX(LA) * .. External Subroutines .. EXTERNAL F11MLF * .. Executable Statements .. WRITE (NOUT,*) 'F11MLF Example Program Results' * Skip heading in data file READ (NIN,*) * * Read order of matrix and number of right hand sides * READ (NIN,*) N IF (N.LE.NMAX) THEN * * Read the matrix A * DO 20 I = 1, N + 1 READ (NIN,*) ICOLZP(I) 20 CONTINUE NNZ = ICOLZP(N+1) - 1 DO 40 I = 1, NNZ READ (NIN,*) A(I), IROWIX(I) 40 CONTINUE * * Calculate 1-norm * NORM = '1' IFAIL = 0 CALL F11MLF(NORM,ANORM,N,ICOLZP,IROWIX,A,IFAIL) * * Output norm * WRITE (NOUT,*) WRITE (NOUT,*) 'One-norm' WRITE (NOUT,'(F7.3)') ANORM * * Calculate M-norm * NORM = 'M' IFAIL = 0 CALL F11MLF(NORM,ANORM,N,ICOLZP,IROWIX,A,IFAIL) * * Output norm * WRITE (NOUT,*) WRITE (NOUT,*) 'Max' WRITE (NOUT,'(F7.3)') ANORM * * Calculate I-norm * NORM = 'I' IFAIL = 0 CALL F11MLF(NORM,ANORM,N,ICOLZP,IROWIX,A,IFAIL) * * Output norm * WRITE (NOUT,*) WRITE (NOUT,*) 'Infinity-norm' WRITE (NOUT,'(F7.3)') ANORM * END IF END