152 SUBROUTINE clavsy( UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B,
161 CHARACTER diag, trans, uplo
162 INTEGER info, lda, ldb, n, nrhs
166 COMPLEX a( lda, * ), b( ldb, * )
173 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
178 COMPLEX 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(
'CLAVSY ', -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
cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
254 CALL
cgeru( k-1, nrhs, cone, a( 1, k ), 1, b( k, 1 ),
255 $ ldb, b( 1, 1 ), ldb )
261 $ CALL
cswap( 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
cgeru( k-1, nrhs, cone, a( 1, k ), 1, b( k, 1 ),
290 $ ldb, b( 1, 1 ), ldb )
291 CALL
cgeru( 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
cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
320 IF( ipiv( k ).GT.0 )
THEN
327 $ CALL
cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
336 CALL
cgeru( n-k, nrhs, cone, a( k+1, k ), 1,
337 $ b( k, 1 ), ldb, b( k+1, 1 ), ldb )
343 $ CALL
cswap( 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
cgeru( n-k, nrhs, cone, a( k+1, k ), 1,
373 $ b( k, 1 ), ldb, b( k+1, 1 ), ldb )
374 CALL
cgeru( 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
cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
394 ELSE IF(
lsame( trans,
'T' ) )
THEN
400 IF(
lsame( uplo,
'U' ) )
THEN
410 IF( ipiv( k ).GT.0 )
THEN
417 $ CALL
cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
421 CALL
cgemv(
'Transpose', k-1, nrhs, cone, b, ldb,
422 $ a( 1, k ), 1, cone, b( k, 1 ), ldb )
425 $ CALL
cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
435 kp = abs( ipiv( k ) )
437 $ CALL
cswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
442 CALL
cgemv(
'Transpose', k-2, nrhs, cone, b, ldb,
443 $ a( 1, k ), 1, cone, b( k, 1 ), ldb )
444 CALL
cgemv(
'Transpose', k-2, nrhs, cone, b, ldb,
445 $ a( 1, k-1 ), 1, cone, b( k-1, 1 ), ldb )
458 b( k-1, j ) = d11*t1 + d12*t2
459 b( k, j ) = d21*t1 + d22*t2
482 IF( ipiv( k ).GT.0 )
THEN
489 $ CALL
cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
493 CALL
cgemv(
'Transpose', n-k, nrhs, cone, b( k+1, 1 ),
494 $ ldb, a( k+1, k ), 1, cone, b( k, 1 ), ldb )
497 $ CALL
cscal( nrhs, a( k, k ), b( k, 1 ), ldb )
507 kp = abs( ipiv( k ) )
509 $ CALL
cswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
514 CALL
cgemv(
'Transpose', n-k-1, nrhs, cone,
515 $ b( k+2, 1 ), ldb, a( k+2, k+1 ), 1, cone,
517 CALL
cgemv(
'Transpose', n-k-1, nrhs, cone,
518 $ b( k+2, 1 ), ldb, a( k+2, k ), 1, cone,
532 b( k, j ) = d11*t1 + d12*t2
533 b( k+1, j ) = d21*t1 + d22*t2