PROGRAM f16ubfe ! F16UBF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : f01zdf, f16ubf, nag_frobenius_norm, & nag_inf_norm, nag_max_norm, nag_one_norm, nag_wp ! .. 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, ifail, j, kl, ku, lda, ldab, m, n CHARACTER (1) :: job ! .. Local Arrays .. COMPLEX (KIND=nag_wp), ALLOCATABLE :: a(:,:), ab(:,:) ! .. Intrinsic Functions .. INTRINSIC max, min ! .. Executable Statements .. WRITE (nout,*) 'F16UBF Example Program Results' ! Skip heading in data file READ (nin,*) READ (nin,*) m, n, kl, ku lda = m ldab = kl + ku + 1 ALLOCATE (a(lda,n),ab(ldab,n)) ! Read A from data file into rectangular storage DO i = 1, m READ (nin,*) (a(i,j),j=max(1,i-kl),min(n,i+ku)) END DO ! Convert A to packed storage job = 'P' ifail = 0 CALL f01zdf(job,m,n,kl,ku,a,lda,ab,ldab,ifail) WRITE (nout,*) WRITE (nout,99999) 'Norms of banded matrix AB:' WRITE (nout,*) r_one = f16ubf(nag_one_norm,m,n,kl,ku,ab,ldab) WRITE (nout,99998) 'One norm = ', r_one r_inf = f16ubf(nag_inf_norm,m,n,kl,ku,ab,ldab) WRITE (nout,99998) 'Infinity norm = ', r_inf r_fro = f16ubf(nag_frobenius_norm,m,n,kl,ku,ab,ldab) WRITE (nout,99998) 'Frobenius norm = ', r_fro r_max = f16ubf(nag_max_norm,m,n,kl,ku,ab,ldab) WRITE (nout,99998) 'Maximum norm = ', r_max 99999 FORMAT (1X,A) 99998 FORMAT (1X,A,F9.4) END PROGRAM f16ubfe