PROGRAM f01rgfe ! F01RGF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : f01rgf, nag_wp, x04dbf ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. INTEGER, PARAMETER :: nin = 5, nout = 6 ! .. Local Scalars .. INTEGER :: i, ifail, lda, m, n ! .. Local Arrays .. COMPLEX (KIND=nag_wp), ALLOCATABLE :: a(:,:), theta(:) CHARACTER (1) :: dummy(1) ! .. Executable Statements .. WRITE (nout,*) 'F01RGF Example Program Results' ! Skip heading in data file READ (nin,*) READ (nin,*) m, n WRITE (nout,*) lda = m ALLOCATE (a(lda,n),theta(m)) READ (nin,*) (a(i,1:n),i=1,m) ! ifail: behaviour on error exit ! =0 for hard exit, =1 for quiet-soft, =-1 for noisy-soft ifail = 0 ! Find the RQ factorization of A CALL f01rgf(m,n,a,lda,theta,ifail) WRITE (nout,*) WRITE (nout,*) 'RQ factorization of A' WRITE (nout,*) WRITE (nout,*) 'Vector THETA' WRITE (nout,99999) theta(1:m) WRITE (nout,*) FLUSH (nout) CALL x04dbf('G',' ',m,n,a,lda,'B','F7.4', & 'Matrix A after factorization (R is in left-hand upper triangle)', & 'N',dummy,'N',dummy,80,0,ifail) 99999 FORMAT (1X,4(' (',F7.4,',',F8.4,')':)) END PROGRAM f01rgfe