126 SUBROUTINE zqrt01( M, N, A, AF, Q, R, LDA, TAU, WORK, LWORK,
135 INTEGER lda, lwork, m, n
138 DOUBLE PRECISION result( * ), rwork( * )
139 COMPLEX*16 a( lda, * ), af( lda, * ), q( lda, * ),
140 $ r( lda, * ), tau( * ), work( lwork )
146 DOUBLE PRECISION zero, one
147 parameter( zero = 0.0d+0, one = 1.0d+0 )
149 parameter( rogue = ( -1.0d+10, -1.0d+10 ) )
153 DOUBLE PRECISION anorm, eps, resid
163 INTRINSIC dble, dcmplx, max, min
169 common / srnamc / srnamt
178 CALL
zlacpy(
'Full', m, n, a, lda, af, lda )
183 CALL
zgeqrf( m, n, af, lda, tau, work, lwork, info )
187 CALL
zlaset(
'Full', m, m, rogue, rogue, q, lda )
188 CALL
zlacpy(
'Lower', m-1, n, af( 2, 1 ), lda, q( 2, 1 ), lda )
193 CALL
zungqr( m, m, minmn, q, lda, tau, work, lwork, info )
197 CALL
zlaset(
'Full', m, n, dcmplx( zero ), dcmplx( zero ), r,
199 CALL
zlacpy(
'Upper', m, n, af, lda, r, lda )
203 CALL
zgemm(
'Conjugate transpose',
'No transpose', m, n, m,
204 $ dcmplx( -one ), q, lda, a, lda, dcmplx( one ), r,
209 anorm =
zlange(
'1', m, n, a, lda, rwork )
210 resid =
zlange(
'1', m, n, r, lda, rwork )
211 IF( anorm.GT.zero )
THEN
212 result( 1 ) = ( ( resid / dble( max( 1, m ) ) ) / anorm ) / eps
219 CALL
zlaset(
'Full', m, m, dcmplx( zero ), dcmplx( one ), r, lda )
220 CALL
zherk(
'Upper',
'Conjugate transpose', m, m, -one, q, lda,
225 resid =
zlansy(
'1',
'Upper', m, r, lda, rwork )
227 result( 2 ) = ( resid / dble( max( 1, m ) ) ) / eps