PROGRAM f07jdfe ! F07JDF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : dpttrf, nag_wp ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: nin = 5, nout = 6 ! .. Local Scalars .. INTEGER :: info, n ! .. Local Arrays .. REAL (KIND=nag_wp), ALLOCATABLE :: d(:), e(:) ! .. Executable Statements .. WRITE (nout,*) 'F07JDF Example Program Results' WRITE (nout,*) ! Skip heading in data file READ (nin,*) READ (nin,*) n ALLOCATE (d(n),e(n-1)) ! Read the lower bidiagonal part of the tridiagonal matrix A from ! data file READ (nin,*) d(1:n) READ (nin,*) e(1:n-1) ! Factorize the tridiagonal matrix A ! The NAG name equivalent of dpttrf is f07jdf CALL dpttrf(n,d,e,info) IF (info>0) THEN WRITE (nout,99999) 'The leading minor of order ', info, & ' is not positive definite' END IF ! Print details of the factorization WRITE (nout,*) 'Details of factorization' WRITE (nout,*) WRITE (nout,*) ' The diagonal elements of D' WRITE (nout,99998) d(1:n) WRITE (nout,*) WRITE (nout,*) ' Sub-diagonal elements of the Cholesky factor L' WRITE (nout,99998) e(1:n-1) 99999 FORMAT (1X,A,I3,A) 99998 FORMAT (1X,8F9.4) END PROGRAM f07jdfe