154 SUBROUTINE slavsy( UPLO, TRANS, DIAG, N, NRHS, A, LDA, IPIV, B,
163 CHARACTER diag, trans, uplo
164 INTEGER info, lda, ldb, n, nrhs
168 REAL a( lda, * ), b( ldb, * )
175 parameter( one = 1.0e+0 )
180 REAL d11, d12, d21, d22, t1, t2
197 IF( .NOT.
lsame( uplo,
'U' ) .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
199 ELSE IF( .NOT.
lsame( trans,
'N' ) .AND. .NOT.
200 $
lsame( trans,
'T' ) .AND. .NOT.
lsame( trans,
'C' ) )
THEN
202 ELSE IF( .NOT.
lsame( diag,
'U' ) .AND. .NOT.
lsame( diag,
'N' ) )
205 ELSE IF( n.LT.0 )
THEN
207 ELSE IF( lda.LT.max( 1, n ) )
THEN
209 ELSE IF( ldb.LT.max( 1, n ) )
THEN
213 CALL
xerbla(
'SLAVSY ', -info )
222 nounit =
lsame( diag,
'N' )
228 IF(
lsame( trans,
'N' ) )
THEN
233 IF(
lsame( uplo,
'U' ) )
THEN
241 IF( ipiv( k ).GT.0 )
THEN
248 $ CALL
sscal( nrhs, a( k, k ), b( k, 1 ), ldb )
256 CALL
sger( k-1, nrhs, one, a( 1, k ), 1, b( k, 1 ),
257 $ ldb, b( 1, 1 ), ldb )
263 $ CALL
sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
280 b( k, j ) = d11*t1 + d12*t2
281 b( k+1, j ) = d21*t1 + d22*t2
291 CALL
sger( k-1, nrhs, one, a( 1, k ), 1, b( k, 1 ),
292 $ ldb, b( 1, 1 ), ldb )
293 CALL
sger( k-1, nrhs, one, a( 1, k+1 ), 1,
294 $ b( k+1, 1 ), ldb, b( 1, 1 ), ldb )
298 kp = abs( ipiv( k ) )
300 $ CALL
sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
322 IF( ipiv( k ).GT.0 )
THEN
329 $ CALL
sscal( nrhs, a( k, k ), b( k, 1 ), ldb )
338 CALL
sger( n-k, nrhs, one, a( k+1, k ), 1, b( k, 1 ),
339 $ ldb, b( k+1, 1 ), ldb )
345 $ CALL
sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
363 b( k-1, j ) = d11*t1 + d12*t2
364 b( k, j ) = d21*t1 + d22*t2
374 CALL
sger( n-k, nrhs, one, a( k+1, k ), 1, b( k, 1 ),
375 $ ldb, b( k+1, 1 ), ldb )
376 CALL
sger( n-k, nrhs, one, a( k+1, k-1 ), 1,
377 $ b( k-1, 1 ), ldb, b( k+1, 1 ), ldb )
382 kp = abs( ipiv( k ) )
384 $ CALL
sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
402 IF(
lsame( uplo,
'U' ) )
THEN
413 IF( ipiv( k ).GT.0 )
THEN
420 $ CALL
sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
424 CALL
sgemv(
'Transpose', k-1, nrhs, one, b, ldb,
425 $ a( 1, k ), 1, one, b( k, 1 ), ldb )
428 $ CALL
sscal( nrhs, a( k, k ), b( k, 1 ), ldb )
438 kp = abs( ipiv( k ) )
440 $ CALL
sswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
445 CALL
sgemv(
'Transpose', k-2, nrhs, one, b, ldb,
446 $ a( 1, k ), 1, one, b( k, 1 ), ldb )
447 CALL
sgemv(
'Transpose', k-2, nrhs, one, b, ldb,
448 $ a( 1, k-1 ), 1, one, b( k-1, 1 ), ldb )
461 b( k-1, j ) = d11*t1 + d12*t2
462 b( k, j ) = d21*t1 + d22*t2
485 IF( ipiv( k ).GT.0 )
THEN
492 $ CALL
sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
496 CALL
sgemv(
'Transpose', n-k, nrhs, one, b( k+1, 1 ),
497 $ ldb, a( k+1, k ), 1, one, b( k, 1 ), ldb )
500 $ CALL
sscal( nrhs, a( k, k ), b( k, 1 ), ldb )
510 kp = abs( ipiv( k ) )
512 $ CALL
sswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
517 CALL
sgemv(
'Transpose', n-k-1, nrhs, one,
518 $ b( k+2, 1 ), ldb, a( k+2, k+1 ), 1, one,
520 CALL
sgemv(
'Transpose', n-k-1, nrhs, one,
521 $ b( k+2, 1 ), ldb, a( k+2, k ), 1, one,
535 b( k, j ) = d11*t1 + d12*t2
536 b( k+1, j ) = d21*t1 + d22*t2