* F08CFF 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*NMAX) * .. Local Scalars .. INTEGER I, IFAIL, INFO, J, M, N CHARACTER*30 TITLE * .. Local Arrays .. DOUBLE PRECISION A(LDA,NMAX), TAU(NMAX), WORK(LWORK) * .. External Subroutines .. EXTERNAL DGEQLF, DORGQL, X04CAF * .. Executable Statements .. WRITE (NOUT,*) 'F08CFF 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.GE.N) THEN * * Read A from data file * READ (NIN,*) ((A(I,J),J=1,N),I=1,M) * * Compute the QL factorization of A * CALL DGEQLF(M,N,A,LDA,TAU,WORK,LWORK,INFO) * * Form the leading N columns of Q explicitly * CALL DORGQL(M,N,N,A,LDA,TAU,WORK,LWORK,INFO) * * Form the heading for X04CAF * WRITE (TITLE,99999) N * * Print the leading N columns of Q * IFAIL = 0 CALL X04CAF('General',' ',M,N,A,LDA,TITLE,IFAIL) * ELSE WRITE (NOUT,*) 'MMAX and/or NMAX is too small, and/or M.LT.N' END IF STOP * 99999 FORMAT ('The leading ',I4,' columns of Q') END