* F11MKF Example Program Text * Mark 21 Release. NAG Copyright 2004. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER LA, NMAX, LDB, LDC PARAMETER (LA=10000,NMAX=1000,LDB=NMAX,LDC=NMAX) DOUBLE PRECISION ALPHA, BETA PARAMETER (ALPHA=1.D0,BETA=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(LDB,MMAX), C(LDC,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 = 1 CALL F11MKF(TRANS,N,M,ALPHA,ICOLZP,IROWIX,A,B,LDB,BETA,C,LDC, + IFAIL) IF (IFAIL.EQ.0) THEN * * Output results * WRITE (NOUT,*) CALL X04CAF('G',' ',N,M,C,LDC,'Matrix-vector product',IFAIL) * * Calculate transposed matrix-matrix product * TRANS = 'T' IFAIL = 1 CALL F11MKF(TRANS,N,M,ALPHA,ICOLZP,IROWIX,A,B,LDB,BETA,C, + LDC,IFAIL) IF (IFAIL.EQ.0) THEN * * Output results * WRITE (NOUT,*) CALL X04CAF('G',' ',N,M,C,LDC, + 'Transposed matrix-vector product',IFAIL) END IF END IF IF (IFAIL.NE.0) THEN WRITE (NOUT,99999) IFAIL END IF * END IF * 99999 FORMAT (1X,/1X,' ** F11MKF returned with IFAIL = ',I5) END