PROGRAM f06wnfe ! F06WNF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : nag_wp, zlanhf, ztrttf ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: nin = 5, nout = 6 ! .. Local Scalars .. REAL (KIND=nag_wp) :: r_fro, r_inf, r_max, r_one INTEGER :: i, info, lda, n CHARACTER (1) :: transr, uplo ! .. Local Arrays .. COMPLEX (KIND=nag_wp), ALLOCATABLE :: a(:,:), af(:) REAL (KIND=nag_wp), ALLOCATABLE :: work(:) ! .. Executable Statements .. WRITE (nout,*) 'F06WNF Example Program Results' ! Skip heading in data file READ (nin,*) READ (nin,*) n, uplo, transr lda = n ALLOCATE (a(lda,n),af((n*(n+1))/2),work(n)) ! Read upper or lower triangle of matrix A from data file IF (uplo=='L' .OR. uplo=='l') THEN DO i = 1, n READ (nin,*) a(i,1:i) END DO ELSE DO i = 1, n READ (nin,*) a(i,i:n) END DO END IF ! Convert A to rectangular full packed storage in AF ! The NAG name equivalent of ztrttf is f01vef CALL ztrttf(transr,uplo,n,a,lda,af,info) WRITE (nout,*) WRITE (nout,99999) & 'Norms of Hermitian matrix stored in RFP format in AF:' WRITE (nout,*) ! The NAG name equivalent of zlanhf is f06wnf r_one = zlanhf('1-norm',transr,uplo,n,af,work) WRITE (nout,99998) 'One norm = ', r_one r_inf = zlanhf('Infinity',transr,uplo,n,af,work) WRITE (nout,99998) 'Infinity norm = ', r_inf r_fro = zlanhf('Frobenius',transr,uplo,n,af,work) WRITE (nout,99998) 'Frobenius norm = ', r_fro r_max = zlanhf('Max norm',transr,uplo,n,af,work) WRITE (nout,99998) 'Maximum norm = ', r_max 99999 FORMAT (1X,A) 99998 FORMAT (1X,A,F9.4) END PROGRAM f06wnfe