151 SUBROUTINE zlavsy( UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B,
159 CHARACTER DIAG, TRANS, UPLO
160 INTEGER INFO, LDA, LDB, N, NRHS
164 COMPLEX*16 A( LDA, * ), B( LDB, * )
171 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
176 COMPLEX*16 D11, D12, D21, D22, T1, T2
193 IF( .NOT.lsame( uplo,
'U' ) .AND. .NOT.lsame( uplo,
'L' ) )
THEN
195 ELSE IF( .NOT.lsame( trans,
'N' ) .AND. .NOT.lsame( trans,
'T' ) )
198 ELSE IF( .NOT.lsame( diag,
'U' ) .AND. .NOT.lsame( diag,
'N' ) )
201 ELSE IF( n.LT.0 )
THEN
203 ELSE IF( lda.LT.max( 1, n ) )
THEN
205 ELSE IF( ldb.LT.max( 1, n ) )
THEN
209 CALL xerbla(
'ZLAVSY ', -info )
218 nounit = lsame( diag,
'N' )
224 IF( lsame( trans,
'N' ) )
THEN
229 IF( lsame( uplo,
'U' ) )
THEN
237 IF( ipiv( k ).GT.0 )
THEN
244 $
CALL zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
252 CALL zgeru( k-1, nrhs, cone, a( 1, k ), 1, b( k, 1 ),
253 $ ldb, b( 1, 1 ), ldb )
259 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
276 b( k, j ) = d11*t1 + d12*t2
277 b( k+1, j ) = d21*t1 + d22*t2
287 CALL zgeru( k-1, nrhs, cone, a( 1, k ), 1, b( k, 1 ),
288 $ ldb, b( 1, 1 ), ldb )
289 CALL zgeru( k-1, nrhs, cone, a( 1, k+1 ), 1,
290 $ b( k+1, 1 ), ldb, b( 1, 1 ), ldb )
294 kp = abs( ipiv( k ) )
296 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
318 IF( ipiv( k ).GT.0 )
THEN
325 $
CALL zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
334 CALL zgeru( n-k, nrhs, cone, a( k+1, k ), 1,
335 $ b( k, 1 ), ldb, b( k+1, 1 ), ldb )
341 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
359 b( k-1, j ) = d11*t1 + d12*t2
360 b( k, j ) = d21*t1 + d22*t2
370 CALL zgeru( n-k, nrhs, cone, a( k+1, k ), 1,
371 $ b( k, 1 ), ldb, b( k+1, 1 ), ldb )
372 CALL zgeru( n-k, nrhs, cone, a( k+1, k-1 ), 1,
373 $ b( k-1, 1 ), ldb, b( k+1, 1 ), ldb )
378 kp = abs( ipiv( k ) )
380 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
392 ELSE IF( lsame( trans,
'T' ) )
THEN
398 IF( lsame( uplo,
'U' ) )
THEN
409 IF( ipiv( k ).GT.0 )
THEN
416 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
420 CALL zgemv(
'Transpose', k-1, nrhs, cone, b, ldb,
421 $ a( 1, k ), 1, cone, b( k, 1 ), ldb )
424 $
CALL zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
434 kp = abs( ipiv( k ) )
436 $
CALL zswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
441 CALL zgemv(
'Transpose', k-2, nrhs, cone, b, ldb,
442 $ a( 1, k ), 1, cone, b( k, 1 ), ldb )
443 CALL zgemv(
'Transpose', k-2, nrhs, cone, b, ldb,
444 $ a( 1, k-1 ), 1, cone, b( k-1, 1 ), ldb )
457 b( k-1, j ) = d11*t1 + d12*t2
458 b( k, j ) = d21*t1 + d22*t2
481 IF( ipiv( k ).GT.0 )
THEN
488 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
492 CALL zgemv(
'Transpose', n-k, nrhs, cone, b( k+1, 1 ),
493 $ ldb, a( k+1, k ), 1, cone, b( k, 1 ), ldb )
496 $
CALL zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
506 kp = abs( ipiv( k ) )
508 $
CALL zswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
513 CALL zgemv(
'Transpose', n-k-1, nrhs, cone,
514 $ b( k+2, 1 ), ldb, a( k+2, k+1 ), 1, cone,
516 CALL zgemv(
'Transpose', n-k-1, nrhs, cone,
517 $ b( k+2, 1 ), ldb, a( k+2, k ), 1, cone,
531 b( k, j ) = d11*t1 + d12*t2
532 b( k+1, j ) = d21*t1 + d22*t2
subroutine xerbla(srname, info)
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zgeru(m, n, alpha, x, incx, y, incy, a, lda)
ZGERU
subroutine zscal(n, za, zx, incx)
ZSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine zlavsy(uplo, trans, diag, n, nrhs, a, lda, ipiv, b, ldb, info)
ZLAVSY