135 SUBROUTINE zqrt02( M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK,
144 INTEGER k, lda, lwork, m, n
147 DOUBLE PRECISION result( * ), rwork( * )
148 COMPLEX*16 a( lda, * ), af( lda, * ), q( lda, * ),
149 $ r( lda, * ), tau( * ), work( lwork )
155 DOUBLE PRECISION zero, one
156 parameter( zero = 0.0d+0, one = 1.0d+0 )
158 parameter( rogue = ( -1.0d+10, -1.0d+10 ) )
162 DOUBLE PRECISION anorm, eps, resid
172 INTRINSIC dble, dcmplx, max
178 common / srnamc / srnamt
186 CALL
zlaset(
'Full', m, n, rogue, rogue, q, lda )
187 CALL
zlacpy(
'Lower', m-1, k, af( 2, 1 ), lda, q( 2, 1 ), lda )
192 CALL
zungqr( m, n, k, q, lda, tau, work, lwork, info )
196 CALL
zlaset(
'Full', n, k, dcmplx( zero ), dcmplx( zero ), r,
198 CALL
zlacpy(
'Upper', n, k, af, lda, r, lda )
202 CALL
zgemm(
'Conjugate transpose',
'No transpose', n, k, m,
203 $ dcmplx( -one ), q, lda, a, lda, dcmplx( one ), r,
208 anorm =
zlange(
'1', m, k, a, lda, rwork )
209 resid =
zlange(
'1', n, k, r, lda, rwork )
210 IF( anorm.GT.zero )
THEN
211 result( 1 ) = ( ( resid / dble( max( 1, m ) ) ) / anorm ) / eps
218 CALL
zlaset(
'Full', n, n, dcmplx( zero ), dcmplx( one ), r, lda )
219 CALL
zherk(
'Upper',
'Conjugate transpose', n, m, -one, q, lda,
224 resid =
zlansy(
'1',
'Upper', n, r, lda, rwork )
226 result( 2 ) = ( resid / dble( max( 1, m ) ) ) / eps