* F07JUF Example Program Text * Mark 21 Release. NAG Copyright 2004. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER NMAX PARAMETER (NMAX=50) * .. Local Scalars .. DOUBLE PRECISION ANORM, RCOND INTEGER I, INFO, N * .. Local Arrays .. COMPLEX *16 E(NMAX-1) DOUBLE PRECISION D(NMAX), RWORK(NMAX) * .. External Functions .. DOUBLE PRECISION F06UPF, X02AJF EXTERNAL F06UPF, X02AJF * .. External Subroutines .. EXTERNAL ZPTCON, ZPTTRF * .. Executable Statements .. WRITE (NOUT,*) 'F07JUF Example Program Results' WRITE (NOUT,*) * Skip heading in data file READ (NIN,*) READ (NIN,*) N IF (N.LE.NMAX) THEN * * Read the lower bidiagonal part of the tridiagonal matrix A from * data file * READ (NIN,*) (D(I),I=1,N) READ (NIN,*) (E(I),I=1,N-1) * * Compute the 1-norm of A * ANORM = F06UPF('1-norm',N,D,E) * * Factorize the tridiagonal matrix A * CALL ZPTTRF(N,D,E,INFO) * IF (INFO.EQ.0) THEN * * Estimate the condition number of A * CALL ZPTCON(N,D,E,ANORM,RCOND,RWORK,INFO) * * Print the estimated condition number * IF (RCOND.GE.X02AJF()) THEN WRITE (NOUT,99999) 'Estimate of condition number = ', + 1.0D0/RCOND ELSE WRITE (NOUT,99999) + 'A is singular to working precision. RCOND = ', RCOND END IF * ELSE WRITE (NOUT,99998) 'The leading minor of order ', INFO, + ' is not positive definite' END IF ELSE WRITE (NOUT,*) 'NMAX too small' END IF * 99999 FORMAT (1X,A,1P,E10.2) 99998 FORMAT (1X,A,I3,A) END