* F11XNF Example Program Text * Mark 20 Revised. NAG Copyright 2001. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER LA, NMAX PARAMETER (LA=10000,NMAX=1000) * .. Local Scalars .. INTEGER I, IFAIL, N, NNZ CHARACTER CHECK, TRANS * .. Local Arrays .. COMPLEX *16 A(LA), X(NMAX), Y(NMAX) INTEGER ICOL(LA), IROW(LA) * .. External Subroutines .. EXTERNAL F11XNF * .. Executable Statements .. WRITE (NOUT,*) 'F11XNF Example Program Results' * Skip heading in data file READ (NIN,*) * * Read order of matrix and number of non-zero entries * READ (NIN,*) N IF (N.LE.NMAX) THEN READ (NIN,*) NNZ * * Read the matrix A * DO 20 I = 1, NNZ READ (NIN,*) A(I), IROW(I), ICOL(I) 20 CONTINUE * * Read the vector x * READ (NIN,*) (X(I),I=1,N) * * Calculate matrix-vector product * TRANS = 'N' CHECK = 'C' IFAIL = 0 CALL F11XNF(TRANS,N,NNZ,A,IROW,ICOL,CHECK,X,Y,IFAIL) * * Output results * WRITE (NOUT,*) WRITE (NOUT,*) ' Matrix-vector product' DO 40 I = 1, N WRITE (NOUT,'(1X,''('',E16.4,'','',E16.4,'')'')') Y(I) 40 CONTINUE * * Calculate conjugate transposed matrix-vector product * TRANS = 'T' CHECK = 'N' IFAIL = 0 CALL F11XNF(TRANS,N,NNZ,A,IROW,ICOL,CHECK,X,Y,IFAIL) * * Output results * WRITE (NOUT,*) WRITE (NOUT,*) ' Conjugate transposed matrix-vector product' DO 60 I = 1, N WRITE (NOUT,'(1X,''('',E16.4,'','',E16.4,'')'')') Y(I) 60 CONTINUE * END IF STOP END