197 SUBROUTINE dlamtsqr( 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 DOUBLE PRECISION 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(
'DLAMTSQR', -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 dgemqrt( 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 dtpmqrt(
'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 dtpmqrt(
'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 dgemqrt(
'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 dgemqrt(
'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 dtpmqrt(
'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 dtpmqrt(
'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 dtpmqrt(
'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 dtpmqrt(
'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 dgemqrt(
'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 dgemqrt(
'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 dtpmqrt(
'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 dtpmqrt(
'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 dgemqrt(side, trans, m, n, k, nb, v, ldv, t, ldt, c, ldc, work, info)
DGEMQRT
subroutine dlamtsqr(side, trans, m, n, k, mb, nb, a, lda, t, ldt, c, ldc, work, lwork, info)
DLAMTSQR
subroutine dtpmqrt(side, trans, m, n, k, l, nb, v, ldv, t, ldt, a, lda, b, ldb, work, info)
DTPMQRT