134 SUBROUTINE zrqt02( M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK,
142 INTEGER K, LDA, LWORK, M, N
145 DOUBLE PRECISION RESULT( * ), RWORK( * )
146 COMPLEX*16 A( LDA, * ), AF( LDA, * ), Q( LDA, * ),
147 $ r( lda, * ), tau( * ), work( lwork )
153 DOUBLE PRECISION ZERO, ONE
154 parameter( zero = 0.0d+0, one = 1.0d+0 )
156 parameter( rogue = ( -1.0d+10, -1.0d+10 ) )
160 DOUBLE PRECISION ANORM, EPS, RESID
163 DOUBLE PRECISION DLAMCH, ZLANGE, ZLANSY
164 EXTERNAL dlamch, zlange, zlansy
170 INTRINSIC dble, dcmplx, max
176 COMMON / srnamc / srnamt
182 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
188 eps = dlamch(
'Epsilon' )
192 CALL zlaset(
'Full', m, n, rogue, rogue, q, lda )
194 $
CALL zlacpy(
'Full', k, n-k, af( m-k+1, 1 ), lda,
195 $ q( m-k+1, 1 ), lda )
197 $
CALL zlacpy(
'Lower', k-1, k-1, af( m-k+2, n-k+1 ), lda,
198 $ q( m-k+2, n-k+1 ), lda )
203 CALL zungrq( m, n, k, q, lda, tau( m-k+1 ), work, lwork, info )
207 CALL zlaset(
'Full', k, m, dcmplx( zero ), dcmplx( zero ),
208 $ r( m-k+1, n-m+1 ), lda )
209 CALL zlacpy(
'Upper', k, k, af( m-k+1, n-k+1 ), lda,
210 $ r( m-k+1, n-k+1 ), lda )
214 CALL zgemm(
'No transpose',
'Conjugate transpose', k, m, n,
215 $ dcmplx( -one ), a( m-k+1, 1 ), lda, q, lda,
216 $ dcmplx( one ), r( m-k+1, n-m+1 ), lda )
220 anorm = zlange(
'1', k, n, a( m-k+1, 1 ), lda, rwork )
221 resid = zlange(
'1', k, m, r( m-k+1, n-m+1 ), lda, rwork )
222 IF( anorm.GT.zero )
THEN
223 result( 1 ) = ( ( resid / dble( max( 1, n ) ) ) / anorm ) / eps
230 CALL zlaset(
'Full', m, m, dcmplx( zero ), dcmplx( one ), r, lda )
231 CALL zherk(
'Upper',
'No transpose', m, n, -one, q, lda, one, r,
236 resid = zlansy(
'1',
'Upper', m, r, lda, rwork )
238 result( 2 ) = ( resid / dble( max( 1, n ) ) ) / eps
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
ZHERK
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zungrq(m, n, k, a, lda, tau, work, lwork, info)
ZUNGRQ
subroutine zrqt02(m, n, k, a, af, q, r, lda, tau, work, lwork, rwork, result)
ZRQT02