197 SUBROUTINE slamtsqr( SIDE, TRANS, M, N, K, MB, NB, A, LDA, T,
198 $ LDT, C, LDC, WORK, LWORK, INFO )
205 CHARACTER SIDE, TRANS
206 INTEGER INFO, LDA, M, N, K, MB, NB, LDT, LWORK, LDC
209 REAL A( LDA, * ), WORK( * ), C(LDC, * ),
217 LOGICAL LEFT, RIGHT, TRAN, NOTRAN, LQUERY
218 INTEGER I, II, KK, LW, CTR, Q
231 notran = lsame( trans,
'N' )
232 tran = lsame( trans,
'T' )
233 left = lsame( side,
'L' )
234 right = lsame( side,
'R' )
244 IF( .NOT.left .AND. .NOT.right )
THEN
246 ELSE IF( .NOT.tran .AND. .NOT.notran )
THEN
248 ELSE IF( m.LT.k )
THEN
250 ELSE IF( n.LT.0 )
THEN
252 ELSE IF( k.LT.0 )
THEN
254 ELSE IF( k.LT.nb .OR. nb.LT.1 )
THEN
256 ELSE IF( lda.LT.max( 1, q ) )
THEN
258 ELSE IF( ldt.LT.max( 1, nb) )
THEN
260 ELSE IF( ldc.LT.max( 1, m ) )
THEN
262 ELSE IF(( lwork.LT.max(1,lw)).AND.(.NOT.lquery))
THEN
273 CALL xerbla(
'SLAMTSQR', -info )
275 ELSE IF (lquery)
THEN
281 IF( min(m,n,k).EQ.0 )
THEN
285 IF((mb.LE.k).OR.(mb.GE.max(m,n,k)))
THEN
286 CALL sgemqrt( side, trans, m, n, k, nb, a, lda,
287 $ t, ldt, c, ldc, work, info)
291 IF(left.AND.notran)
THEN
295 kk = mod((m-k),(mb-k))
299 CALL stpmqrt(
'L',
'N',kk , n, k, 0, nb, a(ii,1), lda,
300 $ t(1,ctr*k+1),ldt , c(1,1), ldc,
301 $ c(ii,1), ldc, work, info )
306 DO i=ii-(mb-k),mb+1,-(mb-k)
311 CALL stpmqrt(
'L',
'N',mb-k , n, k, 0,nb, a(i,1), lda,
312 $ t(1, ctr * k + 1), ldt, c(1,1), ldc,
313 $ c(i,1), ldc, work, info )
319 CALL sgemqrt(
'L',
'N',mb , n, k, nb, a(1,1), lda, t
320 $ ,ldt ,c(1,1), ldc, work, info )
322 ELSE IF (left.AND.tran)
THEN
326 kk = mod((m-k),(mb-k))
329 CALL sgemqrt(
'L',
'T',mb , n, k, nb, a(1,1), lda, t
330 $ ,ldt ,c(1,1), ldc, work, info )
332 DO i=mb+1,ii-mb+k,(mb-k)
336 CALL stpmqrt(
'L',
'T',mb-k , n, k, 0,nb, a(i,1), lda,
337 $ t(1,ctr * k + 1),ldt, c(1,1), ldc,
338 $ c(i,1), ldc, work, info )
346 CALL stpmqrt(
'L',
'T',kk , n, k, 0,nb, a(ii,1), lda,
347 $ t(1, ctr * k + 1), ldt, c(1,1), ldc,
348 $ c(ii,1), ldc, work, info )
352 ELSE IF(right.AND.tran)
THEN
356 kk = mod((n-k),(mb-k))
360 CALL stpmqrt(
'R',
'T',m , kk, k, 0, nb, a(ii,1), lda,
361 $ t(1, ctr * k + 1), ldt, c(1,1), ldc,
362 $ c(1,ii), ldc, work, info )
367 DO i=ii-(mb-k),mb+1,-(mb-k)
372 CALL stpmqrt(
'R',
'T',m , mb-k, k, 0,nb, a(i,1), lda,
373 $ t(1, ctr * k + 1), ldt, c(1,1), ldc,
374 $ c(1,i), ldc, work, info )
380 CALL sgemqrt(
'R',
'T',m , mb, k, nb, a(1,1), lda, t
381 $ ,ldt ,c(1,1), ldc, work, info )
383 ELSE IF (right.AND.notran)
THEN
387 kk = mod((n-k),(mb-k))
390 CALL sgemqrt(
'R',
'N', m, mb , k, nb, a(1,1), lda, t
391 $ ,ldt ,c(1,1), ldc, work, info )
393 DO i=mb+1,ii-mb+k,(mb-k)
397 CALL stpmqrt(
'R',
'N', m, mb-k, k, 0,nb, a(i,1), lda,
398 $ t(1, ctr * k + 1),ldt, c(1,1), ldc,
399 $ c(1,i), ldc, work, info )
407 CALL stpmqrt(
'R',
'N', m, kk , k, 0,nb, a(ii,1), lda,
408 $ t(1, ctr * k + 1),ldt, c(1,1), ldc,
409 $ c(1,ii), ldc, work, info )
subroutine xerbla(srname, info)
subroutine sgemqrt(side, trans, m, n, k, nb, v, ldv, t, ldt, c, ldc, work, info)
SGEMQRT
subroutine slamtsqr(side, trans, m, n, k, mb, nb, a, lda, t, ldt, c, ldc, work, lwork, info)
SLAMTSQR
subroutine stpmqrt(side, trans, m, n, k, l, nb, v, ldv, t, ldt, a, lda, b, ldb, work, info)
STPMQRT