PROGRAM f08lsfe ! F08LSF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : nag_wp, zgbbrd ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: nin = 5, nout = 6 CHARACTER (1), PARAMETER :: vect = 'N' ! .. Local Scalars .. INTEGER :: i, info, j, kl, ku, ldab, ldc, ldpt, & ldq, m, n, ncc ! .. Local Arrays .. COMPLEX (KIND=nag_wp), ALLOCATABLE :: ab(:,:), c(:,:), pt(:,:), q(:,:), & work(:) REAL (KIND=nag_wp), ALLOCATABLE :: d(:), e(:), rwork(:) ! .. Intrinsic Functions .. INTRINSIC max, min ! .. Executable Statements .. WRITE (nout,*) 'F08LSF Example Program Results' ! Skip heading in data file READ (nin,*) READ (nin,*) m, n, kl, ku, ncc ldab = kl + ku + 1 ldc = m ldpt = n ldq = m ALLOCATE (ab(ldab,n),c(m,ncc),pt(ldpt,n),q(ldq,m),work(m+n),d(n), & e(n-1),rwork(m+n)) ! Read A from data file READ (nin,*) ((ab(ku+1+i-j,j),j=max(i-kl,1),min(i+ku,n)),i=1,m) ! Reduce A to upper bidiagonal form ! The NAG name equivalent of zgbbrd is f08lsf CALL zgbbrd(vect,m,n,ncc,kl,ku,ab,ldab,d,e,q,ldq,pt,ldpt,c,ldc,work, & rwork,info) ! Print bidiagonal form WRITE (nout,*) WRITE (nout,*) 'Diagonal' WRITE (nout,99999) d(1:min(m,n)) WRITE (nout,*) 'Super-diagonal' WRITE (nout,99999) e(1:min(m,n)-1) 99999 FORMAT (1X,8F9.4) END PROGRAM f08lsfe