128 SUBROUTINE slavsp( UPLO, TRANS, DIAG, N, NRHS, A, IPIV, B, LDB,
136 CHARACTER DIAG, TRANS, UPLO
137 INTEGER INFO, LDB, N, NRHS
141 REAL A( * ), B( LDB, * )
148 parameter( one = 1.0e+0 )
152 INTEGER J, K, KC, KCNEXT, KP
153 REAL D11, D12, D21, D22, T1, T2
170 IF( .NOT.lsame( uplo,
'U' ) .AND. .NOT.lsame( uplo,
'L' ) )
THEN
172 ELSE IF( .NOT.lsame( trans,
'N' ) .AND. .NOT.
173 $ lsame( trans,
'T' ) .AND. .NOT.lsame( trans,
'C' ) )
THEN
175 ELSE IF( .NOT.lsame( diag,
'U' ) .AND. .NOT.lsame( diag,
'N' ) )
178 ELSE IF( n.LT.0 )
THEN
180 ELSE IF( ldb.LT.max( 1, n ) )
THEN
184 CALL xerbla(
'SLAVSP ', -info )
193 nounit = lsame( diag,
'N' )
199 IF( lsame( trans,
'N' ) )
THEN
204 IF( lsame( uplo,
'U' ) )
THEN
216 IF( ipiv( k ).GT.0 )
THEN
221 $
CALL sscal( nrhs, a( kc+k-1 ), b( k, 1 ), ldb )
229 CALL sger( k-1, nrhs, one, a( kc ), 1, b( k, 1 ), ldb,
236 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
251 d12 = a( kcnext+k-1 )
256 b( k, j ) = d11*t1 + d12*t2
257 b( k+1, j ) = d21*t1 + d22*t2
267 CALL sger( k-1, nrhs, one, a( kc ), 1, b( k, 1 ), ldb,
269 CALL sger( k-1, nrhs, one, a( kcnext ), 1,
270 $ b( k+1, 1 ), ldb, b( 1, 1 ), ldb )
274 kp = abs( ipiv( k ) )
276 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
292 kc = n*( n+1 ) / 2 + 1
301 IF( ipiv( k ).GT.0 )
THEN
308 $
CALL sscal( nrhs, a( kc ), b( k, 1 ), ldb )
317 CALL sger( n-k, nrhs, one, a( kc+1 ), 1, b( k, 1 ),
318 $ ldb, b( k+1, 1 ), ldb )
324 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
332 kcnext = kc - ( n-k+2 )
344 b( k-1, j ) = d11*t1 + d12*t2
345 b( k, j ) = d21*t1 + d22*t2
355 CALL sger( n-k, nrhs, one, a( kc+1 ), 1, b( k, 1 ),
356 $ ldb, b( k+1, 1 ), ldb )
357 CALL sger( n-k, nrhs, one, a( kcnext+2 ), 1,
358 $ b( k-1, 1 ), ldb, b( k+1, 1 ), ldb )
363 kp = abs( ipiv( k ) )
365 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
384 IF( lsame( uplo,
'U' ) )
THEN
389 kc = n*( n+1 ) / 2 + 1
397 IF( ipiv( k ).GT.0 )
THEN
404 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
408 CALL sgemv(
'Transpose', k-1, nrhs, one, b, ldb,
409 $ a( kc ), 1, one, b( k, 1 ), ldb )
412 $
CALL sscal( nrhs, a( kc+k-1 ), b( k, 1 ), ldb )
418 kcnext = kc - ( k-1 )
423 kp = abs( ipiv( k ) )
425 $
CALL sswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
430 CALL sgemv(
'Transpose', k-2, nrhs, one, b, ldb,
431 $ a( kc ), 1, one, b( k, 1 ), ldb )
432 CALL sgemv(
'Transpose', k-2, nrhs, one, b, ldb,
433 $ a( kcnext ), 1, one, b( k-1, 1 ), ldb )
446 b( k-1, j ) = d11*t1 + d12*t2
447 b( k, j ) = d21*t1 + d22*t2
472 IF( ipiv( k ).GT.0 )
THEN
479 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
483 CALL sgemv(
'Transpose', n-k, nrhs, one, b( k+1, 1 ),
484 $ ldb, a( kc+1 ), 1, one, b( k, 1 ), ldb )
487 $
CALL sscal( nrhs, a( kc ), b( k, 1 ), ldb )
494 kcnext = kc + n - k + 1
499 kp = abs( ipiv( k ) )
501 $
CALL sswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
506 CALL sgemv(
'Transpose', n-k-1, nrhs, one,
507 $ b( k+2, 1 ), ldb, a( kcnext+1 ), 1, one,
509 CALL sgemv(
'Transpose', n-k-1, nrhs, one,
510 $ b( k+2, 1 ), ldb, a( kc+2 ), 1, one,
524 b( k, j ) = d11*t1 + d12*t2
525 b( k+1, j ) = d21*t1 + d22*t2
528 kc = kcnext + ( n-k )
subroutine xerbla(srname, info)
subroutine sgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
SGEMV
subroutine sger(m, n, alpha, x, incx, y, incy, a, lda)
SGER
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sswap(n, sx, incx, sy, incy)
SSWAP
subroutine slavsp(uplo, trans, diag, n, nrhs, a, ipiv, b, ldb, info)
SLAVSP