PROGRAM f08ahfe ! F08AHF Example Program Text ! Mark 23 Release. NAG Copyright 2011. ! .. Use Statements .. USE nag_library, ONLY : dgelqf, dormlq, dtrsm, nag_wp, x04caf ! .. Implicit None Statement .. IMPLICIT NONE ! .. Parameters .. REAL (KIND=nag_wp), PARAMETER :: one = 1.0E0_nag_wp REAL (KIND=nag_wp), PARAMETER :: zero = 0.0E0_nag_wp INTEGER, PARAMETER :: nin = 5, nout = 6 ! .. Local Scalars .. INTEGER :: i, ifail, info, lda, ldb, lwork, m, & n, nrhs ! .. Local Arrays .. REAL (KIND=nag_wp), ALLOCATABLE :: a(:,:), b(:,:), tau(:), work(:) ! .. Executable Statements .. WRITE (nout,*) 'F08AHF Example Program Results' ! Skip heading in data file READ (nin,*) READ (nin,*) m, n, nrhs lda = m ldb = n lwork = 64*n ALLOCATE (a(lda,n),b(ldb,nrhs),tau(n),work(lwork)) ! Read A and B from data file READ (nin,*) (a(i,1:n),i=1,m) READ (nin,*) (b(i,1:nrhs),i=1,m) ! Compute the LQ factorization of A ! The NAG name equivalent of dgelqf is f08ahf CALL dgelqf(m,n,a,lda,tau,work,lwork,info) ! Solve L*Y = B, storing the result in B ! The NAG name equivalent of dtrsm is f06yjf CALL dtrsm('Left','Lower','No transpose','Non-Unit',m,nrhs,one,a,lda,b, & ldb) ! Set rows (M+1) to N of B to zero IF (m