* F11JPF Example Program Text * Mark 19 Release. NAG Copyright 1999. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER NMAX, LA, LIWORK PARAMETER (NMAX=1000,LA=10000,LIWORK=2*LA+7*NMAX+1) * .. Local Scalars .. DOUBLE PRECISION DSCALE, DTOL INTEGER I, IFAIL, LFILL, N, NNZ, NNZC, NPIVM CHARACTER CHECK, MIC, PSTRAT * .. Local Arrays .. COMPLEX *16 A(LA), X(NMAX), Y(NMAX) INTEGER ICOL(LA), IPIV(NMAX), IROW(LA), ISTR(NMAX+1), + IWORK(LIWORK) * .. External Subroutines .. EXTERNAL F11JNF, F11JPF * .. Executable Statements .. WRITE (NOUT,*) 'F11JPF 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 y * READ (NIN,*) (Y(I),I=1,N) * * Calculate Cholesky factorization * LFILL = -1 DTOL = 0.0D0 MIC = 'N' DSCALE = 0.0D0 PSTRAT = 'M' IFAIL = 1 * CALL F11JNF(N,NNZ,A,LA,IROW,ICOL,LFILL,DTOL,MIC,DSCALE,PSTRAT, + IPIV,ISTR,NNZC,NPIVM,IWORK,LIWORK,IFAIL) IF (IFAIL.EQ.0) THEN * * Check the output value of NPIVM * IF (NPIVM.NE.0) THEN * WRITE (NOUT,*) 'Factorization is not complete' * ELSE * H T * Solve P L D L P x = y * CHECK = 'C' * IFAIL = 0 CALL F11JPF(N,A,LA,IROW,ICOL,IPIV,ISTR,CHECK,Y,X,IFAIL) * * Output results * WRITE (NOUT,*) 'Solution of linear system' DO 40 I = 1, N WRITE (NOUT,99999) X(I) 40 CONTINUE * END IF ELSE WRITE (NOUT,99998) IFAIL END IF END IF * 99999 FORMAT (1X,'(',E16.4,',',E16.4,')') 99998 FORMAT (1X,/1X,' ** F11JNF returned with IFAIL = ',I5) END