PROGRAM f01vdfe ! F01VDF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : nag_wp, x04dbf, ztpttr ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: inc1 = 1, indent = 0, ncols = 80, & nin = 5, nout = 6 CHARACTER (1), PARAMETER :: brac = 'B', diag = 'N', & intlabel = 'I', matrix = 'G', & nolabel = 'N' CHARACTER (4), PARAMETER :: form = 'F5.2' ! .. Local Scalars .. INTEGER :: i, ifail, info, lda, lenap, n CHARACTER (18) :: title CHARACTER (1) :: uplo ! .. Local Arrays .. COMPLEX (KIND=nag_wp), ALLOCATABLE :: a(:,:), ap(:) CHARACTER (1) :: clabs(1), rlabs(1) ! .. Executable Statements .. WRITE (nout,*) 'F01VDF Example Program Results' ! Skip heading in data file READ (nin,*) WRITE (nout,*) FLUSH (nout) READ (nin,*) n, uplo lda = n lenap = (n*(n+1))/2 ALLOCATE (a(lda,n),ap(lenap)) ! Read a packed vector of order n DO i = 1, lenap READ (nin,*) ap(i) END DO ! Print the packed vector title = 'Packed Matrix AP: ' ifail = 0 CALL x04dbf(matrix,diag,lenap,inc1,ap,lenap,brac,form,title,intlabel, & rlabs,nolabel,clabs,ncols,indent,ifail) WRITE (nout,*) FLUSH (nout) ! Convert to triangular form info = 0 ! The NAG name equivalent of ztpttr is f01vdf CALL ztpttr(uplo,n,ap,a,lda,info) ! Print the unpacked matrix title = 'Unpacked Matrix A:' ifail = 0 CALL x04dbf(uplo,diag,n,n,a,lda,brac,form,title,intlabel,rlabs, & intlabel,clabs,ncols,indent,ifail) END PROGRAM f01vdfe