198 SUBROUTINE zlamswlq( 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*16 A( LDA, * ), WORK( * ), C( LDC, * ),
218 LOGICAL LEFT, RIGHT, TRAN, NOTRAN, LQUERY
219 INTEGER I, II, KK, LW, CTR, MINMNK, LWMIN
233 lquery = ( lwork.EQ.-1 )
234 notran = lsame( trans,
'N' )
235 tran = lsame( trans,
'C' )
236 left = lsame( side,
'L' )
237 right = lsame( side,
'R' )
244 minmnk = min( m, n, k )
245 IF( minmnk.EQ.0 )
THEN
251 IF( .NOT.left .AND. .NOT.right )
THEN
253 ELSE IF( .NOT.tran .AND. .NOT.notran )
THEN
255 ELSE IF( k.LT.0 )
THEN
257 ELSE IF( m.LT.k )
THEN
259 ELSE IF( n.LT.0 )
THEN
261 ELSE IF( k.LT.mb .OR. mb.LT.1 )
THEN
263 ELSE IF( lda.LT.max( 1, k ) )
THEN
265 ELSE IF( ldt.LT.max( 1, mb ) )
THEN
267 ELSE IF( ldc.LT.max( 1, m ) )
THEN
269 ELSE IF( lwork.LT.lwmin .AND. (.NOT.lquery) )
THEN
277 CALL xerbla(
'ZLAMSWLQ', -info )
279 ELSE IF( lquery )
THEN
285 IF( minmnk.EQ.0 )
THEN
289 IF((nb.LE.k).OR.(nb.GE.max(m,n,k)))
THEN
290 CALL zgemlqt( side, trans, m, n, k, mb, a, lda,
291 $ t, ldt, c, ldc, work, info )
295 IF(left.AND.tran)
THEN
299 kk = mod((m-k),(nb-k))
304 CALL ztpmlqt(
'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 ztpmlqt(
'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 zgemlqt(
'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 zgemlqt(
'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 ztpmlqt(
'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 ztpmlqt(
'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 ztpmlqt(
'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 ztpmlqt(
'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 )
385 CALL zgemlqt(
'R',
'N',m , nb, k, mb, a(1,1), lda, t
386 $ ,ldt ,c(1,1), ldc, work, info )
388 ELSE IF (right.AND.tran)
THEN
392 kk = mod((n-k),(nb-k))
394 CALL zgemlqt(
'R',
'C',m , nb, k, mb, a(1,1), lda, t
395 $ ,ldt ,c(1,1), ldc, work, info )
398 DO i=nb+1,ii-nb+k,(nb-k)
402 CALL ztpmlqt(
'R',
'C',m , nb-k, k, 0,mb, a(1,i), lda,
403 $ t(1,ctr *k+1), ldt, c(1,1), ldc,
404 $ c(1,i), ldc, work, info )
412 CALL ztpmlqt(
'R',
'C',m , kk, k, 0,mb, a(1,ii), lda,
413 $ t(1, ctr * k + 1),ldt, c(1,1), ldc,
414 $ c(1,ii), ldc, work, info )