198 SUBROUTINE clamswlq( SIDE, TRANS, M, N, K, MB, NB, A, LDA, T,
199 $ LDT, C, LDC, WORK, LWORK, INFO )
206 CHARACTER SIDE, TRANS
207 INTEGER INFO, LDA, M, N, K, MB, NB, LDT, LWORK, LDC
210 COMPLEX A( LDA, * ), WORK( * ), C( LDC, * ),
218 LOGICAL LEFT, RIGHT, TRAN, NOTRAN, LQUERY
219 INTEGER I, II, KK, LW, CTR, MINMNK, LWMIN
224 EXTERNAL lsame, sroundup_lwork
234 lquery = ( lwork.EQ.-1 )
235 notran = lsame( trans,
'N' )
236 tran = lsame( trans,
'C' )
237 left = lsame( side,
'L' )
238 right = lsame( side,
'R' )
245 minmnk = min( m, n, k )
246 IF( minmnk.EQ.0 )
THEN
252 IF( .NOT.left .AND. .NOT.right )
THEN
254 ELSE IF( .NOT.tran .AND. .NOT.notran )
THEN
256 ELSE IF( k.LT.0 )
THEN
258 ELSE IF( m.LT.k )
THEN
260 ELSE IF( n.LT.0 )
THEN
262 ELSE IF( k.LT.mb .OR. mb.LT.1 )
THEN
264 ELSE IF( lda.LT.max( 1, k ) )
THEN
266 ELSE IF( ldt.LT.max( 1, mb ) )
THEN
268 ELSE IF( ldc.LT.max( 1, m ) )
THEN
270 ELSE IF( lwork.LT.lwmin .AND. (.NOT.lquery) )
THEN
275 work( 1 ) = sroundup_lwork( lwmin )
278 CALL xerbla(
'CLAMSWLQ', -info )
280 ELSE IF( lquery )
THEN
286 IF( minmnk.EQ.0 )
THEN
290 IF((nb.LE.k).OR.(nb.GE.max(m,n,k)))
THEN
291 CALL cgemlqt( side, trans, m, n, k, mb, a, lda,
292 $ t, ldt, c, ldc, work, info )
296 IF(left.AND.tran)
THEN
300 kk = mod((m-k),(nb-k))
304 CALL ctpmlqt(
'L',
'C',kk , n, k, 0, mb, a(1,ii), lda,
305 $ t(1,ctr*k+1), ldt, c(1,1), ldc,
306 $ c(ii,1), ldc, work, info )
311 DO i=ii-(nb-k),nb+1,-(nb-k)
316 CALL ctpmlqt(
'L',
'C',nb-k , n, k, 0,mb, a(1,i), lda,
317 $ t(1,ctr*k+1),ldt, c(1,1), ldc,
318 $ c(i,1), ldc, work, info )
324 CALL cgemlqt(
'L',
'C',nb , n, k, mb, a(1,1), lda, t
325 $ ,ldt ,c(1,1), ldc, work, info )
327 ELSE IF (left.AND.notran)
THEN
331 kk = mod((m-k),(nb-k))
334 CALL cgemlqt(
'L',
'N',nb , n, k, mb, a(1,1), lda, t
335 $ ,ldt ,c(1,1), ldc, work, info )
337 DO i=nb+1,ii-nb+k,(nb-k)
341 CALL ctpmlqt(
'L',
'N',nb-k , n, k, 0,mb, a(1,i), lda,
342 $ t(1, ctr *k+1), ldt, c(1,1), ldc,
343 $ c(i,1), ldc, work, info )
351 CALL ctpmlqt(
'L',
'N',kk , n, k, 0, mb, a(1,ii), lda,
352 $ t(1, ctr*k+1), ldt, c(1,1), ldc,
353 $ c(ii,1), ldc, work, info )
357 ELSE IF(right.AND.notran)
THEN
361 kk = mod((n-k),(nb-k))
365 CALL ctpmlqt(
'R',
'N',m , kk, k, 0, mb, a(1, ii), lda,
366 $ t(1,ctr*k+1), ldt, c(1,1), ldc,
367 $ c(1,ii), ldc, work, info )
372 DO i=ii-(nb-k),nb+1,-(nb-k)
377 CALL ctpmlqt(
'R',
'N', m, nb-k, k, 0, mb, a(1, i), lda,
378 $ t(1,ctr*k+1), ldt, c(1,1), ldc,
379 $ c(1,i), ldc, work, info )
384 CALL cgemlqt(
'R',
'N',m , nb, k, mb, a(1,1), lda, t
385 $ ,ldt ,c(1,1), ldc, work, info )
387 ELSE IF (right.AND.tran)
THEN
391 kk = mod((n-k),(nb-k))
394 CALL cgemlqt(
'R',
'C',m , nb, k, mb, a(1,1), lda, t
395 $ ,ldt ,c(1,1), ldc, work, info )
397 DO i=nb+1,ii-nb+k,(nb-k)
401 CALL ctpmlqt(
'R',
'C',m , nb-k, k, 0,mb, a(1,i), lda,
402 $ t(1,ctr*k+1), ldt, c(1,1), ldc,
403 $ c(1,i), ldc, work, info )
411 CALL ctpmlqt(
'R',
'C',m , kk, k, 0,mb, a(1,ii), lda,
412 $ t(1,ctr*k+1),ldt, c(1,1), ldc,
413 $ c(1,ii), ldc, work, info )
419 work( 1 ) = sroundup_lwork( lwmin )