PROGRAM f07wxfe ! F07WXF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : nag_wp, x04dbf, ztftri, ztfttr ! .. 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 .. COMPLEX (KIND=nag_wp), ALLOCATABLE :: a(:), f(:,:) CHARACTER (1) :: clabs(1), rlabs(1) ! .. Executable Statements .. WRITE (nout,*) 'F07WXF 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(1:lena),f(ldf,n)) ! Read A from data file READ (nin,*) a(1:lena) ! Compute inverse of A ! The NAG name equivalent of ztftri is f07wxf CALL ztftri(transr,uplo,diag,n,a,info) WRITE (nout,*) FLUSH (nout) IF (info==0) THEN ! Convert and print inverse ! The NAG name equivalent of ztfttr is f01vhf CALL ztfttr(transr,uplo,n,a,f,ldf,info) ifail = 0 CALL x04dbf(uplo,'Nonunit',n,n,f,ldf,'Bracketed','F7.4','Inverse', & 'Integer',rlabs,'Integer',clabs,80,0,ifail) ELSE WRITE (nout,*) 'A is singular' END IF END PROGRAM f07wxfe