134 SUBROUTINE drqt02( M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK,
142 INTEGER K, LDA, LWORK, M, N
145 DOUBLE PRECISION A( LDA, * ), AF( LDA, * ), Q( LDA, * ),
146 $ r( lda, * ), result( * ), rwork( * ), tau( * ),
153 DOUBLE PRECISION ZERO, ONE
154 parameter( zero = 0.0d+0, one = 1.0d+0 )
155 DOUBLE PRECISION ROGUE
156 parameter( rogue = -1.0d+10 )
160 DOUBLE PRECISION ANORM, EPS, RESID
163 DOUBLE PRECISION DLAMCH, DLANGE, DLANSY
164 EXTERNAL dlamch, dlange, dlansy
176 COMMON / srnamc / srnamt
182 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
188 eps = dlamch(
'Epsilon' )
192 CALL dlaset(
'Full', m, n, rogue, rogue, q, lda )
194 $
CALL dlacpy(
'Full', k, n-k, af( m-k+1, 1 ), lda,
195 $ q( m-k+1, 1 ), lda )
197 $
CALL dlacpy(
'Lower', k-1, k-1, af( m-k+2, n-k+1 ), lda,
198 $ q( m-k+2, n-k+1 ), lda )
203 CALL dorgrq( m, n, k, q, lda, tau( m-k+1 ), work, lwork, info )
207 CALL dlaset(
'Full', k, m, zero, zero, r( m-k+1, n-m+1 ), lda )
208 CALL dlacpy(
'Upper', k, k, af( m-k+1, n-k+1 ), lda,
209 $ r( m-k+1, n-k+1 ), lda )
213 CALL dgemm(
'No transpose',
'Transpose', k, m, n, -one,
214 $ a( m-k+1, 1 ), lda, q, lda, one, r( m-k+1, n-m+1 ),
219 anorm = dlange(
'1', k, n, a( m-k+1, 1 ), lda, rwork )
220 resid = dlange(
'1', k, m, r( m-k+1, n-m+1 ), lda, rwork )
221 IF( anorm.GT.zero )
THEN
222 result( 1 ) = ( ( resid / dble( max( 1, n ) ) ) / anorm ) / eps
229 CALL dlaset(
'Full', m, m, zero, one, r, lda )
230 CALL dsyrk(
'Upper',
'No transpose', m, n, -one, q, lda, one, r,
235 resid = dlansy(
'1',
'Upper', m, r, lda, rwork )
237 result( 2 ) = ( resid / dble( max( 1, n ) ) ) / eps
subroutine drqt02(m, n, k, a, af, q, r, lda, tau, work, lwork, rwork, result)
DRQT02
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM