134 SUBROUTINE srqt02( M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK,
142 INTEGER K, LDA, LWORK, M, N
145 REAL A( LDA, * ), AF( LDA, * ), Q( LDA, * ),
146 $ r( lda, * ), result( * ), rwork( * ), tau( * ),
154 parameter( zero = 0.0e+0, one = 1.0e+0 )
156 parameter( rogue = -1.0e+10 )
160 REAL ANORM, EPS, RESID
163 REAL SLAMCH, SLANGE, SLANSY
164 EXTERNAL slamch, slange, slansy
176 COMMON / srnamc / srnamt
182 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
188 eps = slamch(
'Epsilon' )
192 CALL slaset(
'Full', m, n, rogue, rogue, q, lda )
194 $
CALL slacpy(
'Full', k, n-k, af( m-k+1, 1 ), lda,
195 $ q( m-k+1, 1 ), lda )
197 $
CALL slacpy(
'Lower', k-1, k-1, af( m-k+2, n-k+1 ), lda,
198 $ q( m-k+2, n-k+1 ), lda )
203 CALL sorgrq( m, n, k, q, lda, tau( m-k+1 ), work, lwork, info )
207 CALL slaset(
'Full', k, m, zero, zero, r( m-k+1, n-m+1 ), lda )
208 CALL slacpy(
'Upper', k, k, af( m-k+1, n-k+1 ), lda,
209 $ r( m-k+1, n-k+1 ), lda )
213 CALL sgemm(
'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 = slange(
'1', k, n, a( m-k+1, 1 ), lda, rwork )
220 resid = slange(
'1', k, m, r( m-k+1, n-m+1 ), lda, rwork )
221 IF( anorm.GT.zero )
THEN
222 result( 1 ) = ( ( resid / real( max( 1, n ) ) ) / anorm ) / eps
229 CALL slaset(
'Full', m, m, zero, one, r, lda )
230 CALL ssyrk(
'Upper',
'No transpose', m, n, -one, q, lda, one, r,
235 resid = slansy(
'1',
'Upper', m, r, lda, rwork )
237 result( 2 ) = ( resid / real( max( 1, n ) ) ) / eps
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine ssyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
SSYRK
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine sorgrq(m, n, k, a, lda, tau, work, lwork, info)
SORGRQ
subroutine srqt02(m, n, k, a, af, q, r, lda, tau, work, lwork, rwork, result)
SRQT02