* F11MKF 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) DOUBLE PRECISION ONE, ZERO PARAMETER (ONE=1.D0,ZERO=0.D0) INTEGER MMAX PARAMETER (MMAX=5) * .. Local Scalars .. INTEGER I, IFAIL, J, M, N, NNZ CHARACTER TRANS * .. Local Arrays .. DOUBLE PRECISION A(LA), B(NMAX,MMAX), C(NMAX,MMAX) INTEGER ICOLZP(NMAX+1), IROWIX(LA) * .. External Subroutines .. EXTERNAL F11MKF, X04CAF * .. Executable Statements .. WRITE (NOUT,*) 'F11MKF Example Program Results' * Skip heading in data file READ (NIN,*) * * Read order of matrix * READ (NIN,*) N, M IF (N.LE.NMAX .AND. M.LE.MMAX) 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 * * Read the matrix B * DO 60 J = 1, M READ (NIN,*) (B(I,J),I=1,N) 60 CONTINUE * * Calculate matrix-matrix product * TRANS = 'N' IFAIL = 0 CALL F11MKF(TRANS,N,M,ONE,ICOLZP,IROWIX,A,B,NMAX,ZERO,C,NMAX, + IFAIL) * * Output results * WRITE (NOUT,*) CALL X04CAF('G',' ',N,M,C,NMAX,'Matrix-vector product',IFAIL) * * Calculate transposed matrix-matrix product * TRANS = 'T' IFAIL = 0 CALL F11MKF(TRANS,N,M,ONE,ICOLZP,IROWIX,A,B,NMAX,ZERO,C,NMAX, + IFAIL) * * Output results * WRITE (NOUT,*) CALL X04CAF('G',' ',N,M,C,NMAX, + 'Transposed matrix-vector product',IFAIL) * END IF END