* F08LSF Example Program Text * Mark 19 Release. NAG Copyright 1999. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER MMAX, NMAX, NCCMAX, KLMAX, KUMAX, LDAB, LDQ, + LDPT, LDC PARAMETER (MMAX=8,NMAX=8,NCCMAX=8,KLMAX=8,KUMAX=8, + LDAB=KLMAX+KUMAX+1,LDQ=MMAX,LDPT=NMAX,LDC=MMAX) CHARACTER VECT PARAMETER (VECT='N') * .. Local Scalars .. INTEGER I, INFO, J, KL, KU, M, N, NCC * .. Local Arrays .. COMPLEX *16 AB(LDAB,NMAX), C(MMAX,NCCMAX), PT(LDPT,NMAX), + Q(LDQ,MMAX), WORK(MMAX+NMAX) DOUBLE PRECISION D(NMAX), E(NMAX-1), RWORK(MMAX+NMAX) * .. External Subroutines .. EXTERNAL ZGBBRD * .. 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 IF (M.LE.MMAX .AND. N.LE.NMAX .AND. KL.LE.KLMAX .AND. KU.LE. + KUMAX .AND. NCC.LE.NCCMAX) THEN * * 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 * 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(I),I=1,MIN(M,N)) WRITE (NOUT,*) 'Super-diagonal' WRITE (NOUT,99999) (E(I),I=1,MIN(M,N)-1) END IF * 99999 FORMAT (1X,8F9.4) END