* F08CWF Example Program Text * Mark 21 Release. NAG Copyright 2004. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER MMAX, NB, NMAX PARAMETER (MMAX=8,NB=64,NMAX=8) INTEGER LDA, LWORK PARAMETER (LDA=MMAX,LWORK=NB*MMAX) * .. Local Scalars .. INTEGER I, IFAIL, INFO, J, M, N CHARACTER*26 TITLE * .. Local Arrays .. COMPLEX *16 A(LDA,NMAX), TAU(NMAX), WORK(LWORK) CHARACTER CLABS(1), RLABS(1) * .. External Subroutines .. EXTERNAL X04DBF, ZGERQF, ZUNGRQ * .. Executable Statements .. WRITE (NOUT,*) 'F08CWF Example Program Results' WRITE (NOUT,*) * Skip heading in data file READ (NIN,*) READ (NIN,*) M, N IF (M.LE.MMAX .AND. N.LE.NMAX .AND. M.LE.N) THEN * * Read A from data file * READ (NIN,*) ((A(I,J),J=1,N),I=1,M) * * Compute the RQ factorization of A * CALL ZGERQF(M,N,A,LDA,TAU,WORK,LWORK,INFO) * * Form the leading M rows of Q explicitly * CALL ZUNGRQ(M,N,M,A,LDA,TAU,WORK,LWORK,INFO) * * Form the heading for X04DBF * WRITE (TITLE,99999) M * * Print the leading M rows of Q * IFAIL = 0 CALL X04DBF('General',' ',M,N,A,LDA,'Bracketed','F7.4',TITLE, + 'Integer',RLABS,'Integer',CLABS,80,0,IFAIL) * ELSE WRITE (NOUT,*) 'MMAX and/or NMAX is too small, and/or M.GT.N' END IF * 99999 FORMAT ('The leading ',I4,' rows of Q') END