134 SUBROUTINE sqlt02( M, N, K, A, AF, Q, L, LDA, TAU, WORK, LWORK,
142 INTEGER K, LDA, LWORK, M, N
145 REAL A( LDA, * ), AF( LDA, * ), L( LDA, * ),
146 $ q( 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', m-k, k, af( 1, n-k+1 ), lda,
195 $ q( 1, n-k+1 ), lda )
197 $
CALL slacpy(
'Upper', k-1, k-1, af( m-k+1, n-k+2 ), lda,
198 $ q( m-k+1, n-k+2 ), lda )
203 CALL sorgql( m, n, k, q, lda, tau( n-k+1 ), work, lwork, info )
207 CALL slaset(
'Full', n, k, zero, zero, l( m-n+1, n-k+1 ), lda )
208 CALL slacpy(
'Lower', k, k, af( m-k+1, n-k+1 ), lda,
209 $ l( m-k+1, n-k+1 ), lda )
213 CALL sgemm(
'Transpose',
'No transpose', n, k, m, -one, q, lda,
214 $ a( 1, n-k+1 ), lda, one, l( m-n+1, n-k+1 ), lda )
218 anorm = slange(
'1', m, k, a( 1, n-k+1 ), lda, rwork )
219 resid = slange(
'1', n, k, l( m-n+1, n-k+1 ), lda, rwork )
220 IF( anorm.GT.zero )
THEN
221 result( 1 ) = ( ( resid / real( max( 1, m ) ) ) / anorm ) / eps
228 CALL slaset(
'Full', n, n, zero, one, l, lda )
229 CALL ssyrk(
'Upper',
'Transpose', n, m, -one, q, lda, one, l,
234 resid = slansy(
'1',
'Upper', n, l, lda, rwork )
236 result( 2 ) = ( resid / real( max( 1, m ) ) ) / 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 sorgql(m, n, k, a, lda, tau, work, lwork, info)
SORGQL
subroutine sqlt02(m, n, k, a, af, q, l, lda, tau, work, lwork, rwork, result)
SQLT02