128 SUBROUTINE dlavsp( UPLO, TRANS, DIAG, N, NRHS, A, IPIV, B, LDB,
136 CHARACTER DIAG, TRANS, UPLO
137 INTEGER INFO, LDB, N, NRHS
141 DOUBLE PRECISION A( * ), B( LDB, * )
148 parameter( one = 1.0d+0 )
152 INTEGER J, K, KC, KCNEXT, KP
153 DOUBLE PRECISION 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(
'DLAVSP ', -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 dscal( nrhs, a( kc+k-1 ), b( k, 1 ), ldb )
229 CALL dger( k-1, nrhs, one, a( kc ), 1, b( k, 1 ), ldb,
236 $
CALL dswap( 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 dger( k-1, nrhs, one, a( kc ), 1, b( k, 1 ), ldb,
269 CALL dger( k-1, nrhs, one, a( kcnext ), 1,
270 $ b( k+1, 1 ), ldb, b( 1, 1 ), ldb )
274 kp = abs( ipiv( k ) )
276 $
CALL dswap( 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 dscal( nrhs, a( kc ), b( k, 1 ), ldb )
317 CALL dger( n-k, nrhs, one, a( kc+1 ), 1, b( k, 1 ),
318 $ ldb, b( k+1, 1 ), ldb )
324 $
CALL dswap( 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 dger( n-k, nrhs, one, a( kc+1 ), 1, b( k, 1 ),
356 $ ldb, b( k+1, 1 ), ldb )
357 CALL dger( 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 dswap( 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 dswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
408 CALL dgemv(
'Transpose', k-1, nrhs, one, b, ldb,
409 $ a( kc ), 1, one, b( k, 1 ), ldb )
412 $
CALL dscal( nrhs, a( kc+k-1 ), b( k, 1 ), ldb )
418 kcnext = kc - ( k-1 )
423 kp = abs( ipiv( k ) )
425 $
CALL dswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
430 CALL dgemv(
'Transpose', k-2, nrhs, one, b, ldb,
431 $ a( kc ), 1, one, b( k, 1 ), ldb )
432 CALL dgemv(
'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 dswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
483 CALL dgemv(
'Transpose', n-k, nrhs, one, b( k+1, 1 ),
484 $ ldb, a( kc+1 ), 1, one, b( k, 1 ), ldb )
487 $
CALL dscal( nrhs, a( kc ), b( k, 1 ), ldb )
494 kcnext = kc + n - k + 1
499 kp = abs( ipiv( k ) )
501 $
CALL dswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
506 CALL dgemv(
'Transpose', n-k-1, nrhs, one,
507 $ b( k+2, 1 ), ldb, a( kcnext+1 ), 1, one,
509 CALL dgemv(
'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 dlavsp(uplo, trans, diag, n, nrhs, a, ipiv, b, ldb, info)
DLAVSP
subroutine dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
DGEMV
subroutine dger(m, n, alpha, x, incx, y, incy, a, lda)
DGER
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dswap(n, dx, incx, dy, incy)
DSWAP