152 SUBROUTINE zlavsy( UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B,
161 CHARACTER diag, trans, uplo
162 INTEGER info, lda, ldb, n, nrhs
166 COMPLEX*16 a( lda, * ), b( ldb, * )
173 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
178 COMPLEX*16 d11, d12, d21, d22, t1, t2
195 IF( .NOT.
lsame( uplo,
'U' ) .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
197 ELSE IF( .NOT.
lsame( trans,
'N' ) .AND. .NOT.
lsame( trans,
'T' ) )
200 ELSE IF( .NOT.
lsame( diag,
'U' ) .AND. .NOT.
lsame( diag,
'N' ) )
203 ELSE IF( n.LT.0 )
THEN
205 ELSE IF( lda.LT.max( 1, n ) )
THEN
207 ELSE IF( ldb.LT.max( 1, n ) )
THEN
211 CALL
xerbla(
'ZLAVSY ', -info )
220 nounit =
lsame( diag,
'N' )
226 IF(
lsame( trans,
'N' ) )
THEN
231 IF(
lsame( uplo,
'U' ) )
THEN
239 IF( ipiv( k ).GT.0 )
THEN
246 $ CALL
zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
254 CALL
zgeru( k-1, nrhs, cone, a( 1, k ), 1, b( k, 1 ),
255 $ ldb, b( 1, 1 ), ldb )
261 $ CALL
zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
278 b( k, j ) = d11*t1 + d12*t2
279 b( k+1, j ) = d21*t1 + d22*t2
289 CALL
zgeru( k-1, nrhs, cone, a( 1, k ), 1, b( k, 1 ),
290 $ ldb, b( 1, 1 ), ldb )
291 CALL
zgeru( k-1, nrhs, cone, a( 1, k+1 ), 1,
292 $ b( k+1, 1 ), ldb, b( 1, 1 ), ldb )
296 kp = abs( ipiv( k ) )
298 $ CALL
zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
320 IF( ipiv( k ).GT.0 )
THEN
327 $ CALL
zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
336 CALL
zgeru( n-k, nrhs, cone, a( k+1, k ), 1,
337 $ b( k, 1 ), ldb, b( k+1, 1 ), ldb )
343 $ CALL
zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
361 b( k-1, j ) = d11*t1 + d12*t2
362 b( k, j ) = d21*t1 + d22*t2
372 CALL
zgeru( n-k, nrhs, cone, a( k+1, k ), 1,
373 $ b( k, 1 ), ldb, b( k+1, 1 ), ldb )
374 CALL
zgeru( n-k, nrhs, cone, a( k+1, k-1 ), 1,
375 $ b( k-1, 1 ), ldb, b( k+1, 1 ), ldb )
380 kp = abs( ipiv( k ) )
382 $ CALL
zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
394 ELSE IF(
lsame( trans,
'T' ) )
THEN
400 IF(
lsame( uplo,
'U' ) )
THEN
411 IF( ipiv( k ).GT.0 )
THEN
418 $ CALL
zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
422 CALL
zgemv(
'Transpose', k-1, nrhs, cone, b, ldb,
423 $ a( 1, k ), 1, cone, b( k, 1 ), ldb )
426 $ CALL
zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
436 kp = abs( ipiv( k ) )
438 $ CALL
zswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
443 CALL
zgemv(
'Transpose', k-2, nrhs, cone, b, ldb,
444 $ a( 1, k ), 1, cone, b( k, 1 ), ldb )
445 CALL
zgemv(
'Transpose', k-2, nrhs, cone, b, ldb,
446 $ a( 1, k-1 ), 1, cone, b( k-1, 1 ), ldb )
459 b( k-1, j ) = d11*t1 + d12*t2
460 b( k, j ) = d21*t1 + d22*t2
483 IF( ipiv( k ).GT.0 )
THEN
490 $ CALL
zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
494 CALL
zgemv(
'Transpose', n-k, nrhs, cone, b( k+1, 1 ),
495 $ ldb, a( k+1, k ), 1, cone, b( k, 1 ), ldb )
498 $ CALL
zscal( nrhs, a( k, k ), b( k, 1 ), ldb )
508 kp = abs( ipiv( k ) )
510 $ CALL
zswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
515 CALL
zgemv(
'Transpose', n-k-1, nrhs, cone,
516 $ b( k+2, 1 ), ldb, a( k+2, k+1 ), 1, cone,
518 CALL
zgemv(
'Transpose', n-k-1, nrhs, cone,
519 $ b( k+2, 1 ), ldb, a( k+2, k ), 1, cone,
533 b( k, j ) = d11*t1 + d12*t2
534 b( k+1, j ) = d21*t1 + d22*t2