PROGRAM f07wkfe ! F07WKF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : dtftri, dtfttr, nag_wp, x04caf ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: nin = 5, nout = 6 ! .. Local Scalars .. INTEGER :: ifail, info, ldf, lena, n CHARACTER (1) :: diag, transr, uplo ! .. Local Arrays .. REAL (KIND=nag_wp), ALLOCATABLE :: a(:), f(:,:) ! .. Executable Statements .. WRITE (nout,*) 'F07WKF Example Program Results' ! Skip heading in data file READ (nin,*) READ (nin,*) n, uplo, transr, diag lena = n*(n+1)/2 ldf = n ALLOCATE (a(lena),f(ldf,n)) ! Read A from data file READ (nin,*) a(1:lena) ! Compute inverse of A ! The NAG name equivalent of dtftri is f07wkf CALL dtftri(transr,uplo,diag,n,a,info) WRITE (nout,*) FLUSH (nout) IF (info==0) THEN ! Convert inverse to full array form, and print it ! The NAG name equivalent of dtfttr is f01vgf CALL dtfttr(transr,uplo,n,a,f,ldf,info) ifail = 0 CALL x04caf(uplo,'Nonunit',n,n,f,ldf,'Inverse',ifail) ELSE WRITE (nout,*) 'A is singular' END IF END PROGRAM f07wkfe