136 SUBROUTINE zrqt02( M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK,
145 INTEGER k, lda, lwork, m, n
148 DOUBLE PRECISION result( * ), rwork( * )
149 COMPLEX*16 a( lda, * ), af( lda, * ), q( lda, * ),
150 $ r( lda, * ), tau( * ), work( lwork )
156 DOUBLE PRECISION zero, one
157 parameter( zero = 0.0d+0, one = 1.0d+0 )
159 parameter( rogue = ( -1.0d+10, -1.0d+10 ) )
163 DOUBLE PRECISION anorm, eps, resid
173 INTRINSIC dble, dcmplx, max
179 common / srnamc / srnamt
185 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
195 CALL
zlaset(
'Full', m, n, rogue, rogue, q, lda )
197 $ CALL
zlacpy(
'Full', k, n-k, af( m-k+1, 1 ), lda,
198 $ q( m-k+1, 1 ), lda )
200 $ CALL
zlacpy(
'Lower', k-1, k-1, af( m-k+2, n-k+1 ), lda,
201 $ q( m-k+2, n-k+1 ), lda )
206 CALL
zungrq( m, n, k, q, lda, tau( m-k+1 ), work, lwork, info )
210 CALL
zlaset(
'Full', k, m, dcmplx( zero ), dcmplx( zero ),
211 $ r( m-k+1, n-m+1 ), lda )
212 CALL
zlacpy(
'Upper', k, k, af( m-k+1, n-k+1 ), lda,
213 $ r( m-k+1, n-k+1 ), lda )
217 CALL
zgemm(
'No transpose',
'Conjugate transpose', k, m, n,
218 $ dcmplx( -one ), a( m-k+1, 1 ), lda, q, lda,
219 $ dcmplx( one ), r( m-k+1, n-m+1 ), lda )
223 anorm =
zlange(
'1', k, n, a( m-k+1, 1 ), lda, rwork )
224 resid =
zlange(
'1', k, m, r( m-k+1, n-m+1 ), lda, rwork )
225 IF( anorm.GT.zero )
THEN
226 result( 1 ) = ( ( resid / dble( max( 1, n ) ) ) / anorm ) / eps
233 CALL
zlaset(
'Full', m, m, dcmplx( zero ), dcmplx( one ), r, lda )
234 CALL
zherk(
'Upper',
'No transpose', m, n, -one, q, lda, one, r,
239 resid =
zlansy(
'1',
'Upper', m, r, lda, rwork )
241 result( 2 ) = ( resid / dble( max( 1, n ) ) ) / eps