136 SUBROUTINE sqlt02( M, N, K, A, AF, Q, L, LDA, TAU, WORK, LWORK,
145 INTEGER k, lda, lwork, m, n
148 REAL a( lda, * ), af( lda, * ), l( lda, * ),
149 $ q( lda, * ), result( * ), rwork( * ), tau( * ),
157 parameter( zero = 0.0e+0, one = 1.0e+0 )
159 parameter( rogue = -1.0e+10 )
163 REAL anorm, eps, resid
179 common / srnamc / srnamt
185 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
195 CALL
slaset(
'Full', m, n, rogue, rogue, q, lda )
197 $ CALL
slacpy(
'Full', m-k, k, af( 1, n-k+1 ), lda,
198 $ q( 1, n-k+1 ), lda )
200 $ CALL
slacpy(
'Upper', k-1, k-1, af( m-k+1, n-k+2 ), lda,
201 $ q( m-k+1, n-k+2 ), lda )
206 CALL
sorgql( m, n, k, q, lda, tau( n-k+1 ), work, lwork, info )
210 CALL
slaset(
'Full', n, k, zero, zero, l( m-n+1, n-k+1 ), lda )
211 CALL
slacpy(
'Lower', k, k, af( m-k+1, n-k+1 ), lda,
212 $ l( m-k+1, n-k+1 ), lda )
216 CALL
sgemm(
'Transpose',
'No transpose', n, k, m, -one, q, lda,
217 $ a( 1, n-k+1 ), lda, one, l( m-n+1, n-k+1 ), lda )
221 anorm =
slange(
'1', m, k, a( 1, n-k+1 ), lda, rwork )
222 resid =
slange(
'1', n, k, l( m-n+1, n-k+1 ), lda, rwork )
223 IF( anorm.GT.zero )
THEN
224 result( 1 ) = ( ( resid /
REAL( MAX( 1, M ) ) ) / anorm ) / eps
231 CALL
slaset(
'Full', n, n, zero, one, l, lda )
232 CALL
ssyrk(
'Upper',
'Transpose', n, m, -one, q, lda, one, l,
237 resid =
slansy(
'1',
'Upper', n, l, lda, rwork )
239 result( 2 ) = ( resid /
REAL( MAX( 1, M ) ) ) / eps