197 SUBROUTINE clamtsqr( 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 COMPLEX A( LDA, * ), WORK( * ), C(LDC, * ),
217 LOGICAL LEFT, RIGHT, TRAN, NOTRAN, LQUERY
218 INTEGER I, II, KK, LW, CTR, Q
223 EXTERNAL lsame, sroundup_lwork
232 notran = lsame( trans,
'N' )
233 tran = lsame( trans,
'C' )
234 left = lsame( side,
'L' )
235 right = lsame( side,
'R' )
245 IF( .NOT.left .AND. .NOT.right )
THEN
247 ELSE IF( .NOT.tran .AND. .NOT.notran )
THEN
249 ELSE IF( m.LT.k )
THEN
251 ELSE IF( n.LT.0 )
THEN
253 ELSE IF( k.LT.0 )
THEN
255 ELSE IF( k.LT.nb .OR. nb.LT.1 )
THEN
257 ELSE IF( lda.LT.max( 1, q ) )
THEN
259 ELSE IF( ldt.LT.max( 1, nb) )
THEN
261 ELSE IF( ldc.LT.max( 1, m ) )
THEN
263 ELSE IF(( lwork.LT.max(1,lw)).AND.(.NOT.lquery))
THEN
270 work(1) = sroundup_lwork(lw)
274 CALL xerbla(
'CLAMTSQR', -info )
276 ELSE IF (lquery)
THEN
282 IF( min(m,n,k).EQ.0 )
THEN
286 IF((mb.LE.k).OR.(mb.GE.max(m,n,k)))
THEN
287 CALL cgemqrt( side, trans, m, n, k, nb, a, lda,
288 $ t, ldt, c, ldc, work, info)
292 IF(left.AND.notran)
THEN
296 kk = mod((m-k),(mb-k))
300 CALL ctpmqrt(
'L',
'N',kk , n, k, 0, nb, a(ii,1), lda,
301 $ t(1, ctr*k+1),ldt , c(1,1), ldc,
302 $ c(ii,1), ldc, work, info )
307 DO i=ii-(mb-k),mb+1,-(mb-k)
312 CALL ctpmqrt(
'L',
'N',mb-k , n, k, 0,nb, a(i,1), lda,
313 $ t(1,ctr*k+1),ldt, c(1,1), ldc,
314 $ c(i,1), ldc, work, info )
320 CALL cgemqrt(
'L',
'N',mb , n, k, nb, a(1,1), lda, t
321 $ ,ldt ,c(1,1), ldc, work, info )
323 ELSE IF (left.AND.tran)
THEN
327 kk = mod((m-k),(mb-k))
330 CALL cgemqrt(
'L',
'C',mb , n, k, nb, a(1,1), lda, t
331 $ ,ldt ,c(1,1), ldc, work, info )
333 DO i=mb+1,ii-mb+k,(mb-k)
337 CALL ctpmqrt(
'L',
'C',mb-k , n, k, 0,nb, a(i,1), lda,
338 $ t(1, ctr*k+1),ldt, c(1,1), ldc,
339 $ c(i,1), ldc, work, info )
347 CALL ctpmqrt(
'L',
'C',kk , n, k, 0,nb, a(ii,1), lda,
348 $ t(1,ctr*k+1), ldt, c(1,1), ldc,
349 $ c(ii,1), ldc, work, info )
353 ELSE IF(right.AND.tran)
THEN
357 kk = mod((n-k),(mb-k))
361 CALL ctpmqrt(
'R',
'C',m , kk, k, 0, nb, a(ii,1), lda,
362 $ t(1, ctr*k+1), ldt, c(1,1), ldc,
363 $ c(1,ii), ldc, work, info )
368 DO i=ii-(mb-k),mb+1,-(mb-k)
373 CALL ctpmqrt(
'R',
'C',m , mb-k, k, 0,nb, a(i,1), lda,
374 $ t(1,ctr*k+1), ldt, c(1,1), ldc,
375 $ c(1,i), ldc, work, info )
380 CALL cgemqrt(
'R',
'C',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 cgemqrt(
'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 ctpmqrt(
'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 ctpmqrt(
'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 )
415 work(1) = sroundup_lwork(lw)
subroutine xerbla(srname, info)
subroutine cgemqrt(side, trans, m, n, k, nb, v, ldv, t, ldt, c, ldc, work, info)
CGEMQRT
subroutine clamtsqr(side, trans, m, n, k, mb, nb, a, lda, t, ldt, c, ldc, work, lwork, info)
CLAMTSQR
subroutine ctpmqrt(side, trans, m, n, k, l, nb, v, ldv, t, ldt, a, lda, b, ldb, work, info)
CTPMQRT