129 SUBROUTINE zlavsp( UPLO, TRANS, DIAG, N, NRHS, A, IPIV, B, LDB,
137 CHARACTER DIAG, TRANS, UPLO
138 INTEGER INFO, LDB, N, NRHS
142 COMPLEX*16 A( * ), B( LDB, * )
149 parameter( one = ( 1.0d+0, 0.0d+0 ) )
153 INTEGER J, K, KC, KCNEXT, KP
154 COMPLEX*16 D11, D12, D21, D22, T1, T2
171 IF( .NOT.lsame( uplo,
'U' ) .AND. .NOT.lsame( uplo,
'L' ) )
THEN
173 ELSE IF( .NOT.lsame( trans,
'N' ) .AND. .NOT.lsame( trans,
'T' ) )
176 ELSE IF( .NOT.lsame( diag,
'U' ) .AND. .NOT.lsame( diag,
'N' ) )
179 ELSE IF( n.LT.0 )
THEN
181 ELSE IF( ldb.LT.max( 1, n ) )
THEN
185 CALL xerbla(
'ZLAVSP ', -info )
194 nounit = lsame( diag,
'N' )
200 IF( lsame( trans,
'N' ) )
THEN
205 IF( lsame( uplo,
'U' ) )
THEN
217 IF( ipiv( k ).GT.0 )
THEN
222 $
CALL zscal( nrhs, a( kc+k-1 ), b( k, 1 ), ldb )
230 CALL zgeru( k-1, nrhs, one, a( kc ), 1, b( k, 1 ),
231 $ ldb, b( 1, 1 ), ldb )
237 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
252 d12 = a( kcnext+k-1 )
257 b( k, j ) = d11*t1 + d12*t2
258 b( k+1, j ) = d21*t1 + d22*t2
268 CALL zgeru( k-1, nrhs, one, a( kc ), 1, b( k, 1 ),
269 $ ldb, b( 1, 1 ), ldb )
270 CALL zgeru( k-1, nrhs, one, a( kcnext ), 1,
271 $ b( k+1, 1 ), ldb, b( 1, 1 ), ldb )
275 kp = abs( ipiv( k ) )
277 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
293 kc = n*( n+1 ) / 2 + 1
302 IF( ipiv( k ).GT.0 )
THEN
309 $
CALL zscal( nrhs, a( kc ), b( k, 1 ), ldb )
318 CALL zgeru( n-k, nrhs, one, a( kc+1 ), 1, b( k, 1 ),
319 $ ldb, b( k+1, 1 ), ldb )
325 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
333 kcnext = kc - ( n-k+2 )
345 b( k-1, j ) = d11*t1 + d12*t2
346 b( k, j ) = d21*t1 + d22*t2
356 CALL zgeru( n-k, nrhs, one, a( kc+1 ), 1, b( k, 1 ),
357 $ ldb, b( k+1, 1 ), ldb )
358 CALL zgeru( n-k, nrhs, one, a( kcnext+2 ), 1,
359 $ b( k-1, 1 ), ldb, b( k+1, 1 ), ldb )
364 kp = abs( ipiv( k ) )
366 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
385 IF( lsame( uplo,
'U' ) )
THEN
390 kc = n*( n+1 ) / 2 + 1
398 IF( ipiv( k ).GT.0 )
THEN
405 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
411 CALL zgemv(
'Transpose', k-1, nrhs, one, b, ldb,
412 $ a( kc ), 1, one, b( k, 1 ), ldb )
415 $
CALL zscal( nrhs, a( kc+k-1 ), b( k, 1 ), ldb )
421 kcnext = kc - ( k-1 )
426 kp = abs( ipiv( k ) )
428 $
CALL zswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ),
433 CALL zgemv(
'Transpose', k-2, nrhs, one, b, ldb,
434 $ a( kc ), 1, one, b( k, 1 ), ldb )
436 CALL zgemv(
'Transpose', k-2, nrhs, one, b, ldb,
437 $ a( kcnext ), 1, one, b( k-1, 1 ), ldb )
450 b( k-1, j ) = d11*t1 + d12*t2
451 b( k, j ) = d21*t1 + d22*t2
476 IF( ipiv( k ).GT.0 )
THEN
483 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
487 CALL zgemv(
'Transpose', n-k, nrhs, one, b( k+1, 1 ),
488 $ ldb, a( kc+1 ), 1, one, b( k, 1 ), ldb )
491 $
CALL zscal( nrhs, a( kc ), b( k, 1 ), ldb )
498 kcnext = kc + n - k + 1
503 kp = abs( ipiv( k ) )
505 $
CALL zswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ),
510 CALL zgemv(
'Transpose', n-k-1, nrhs, one,
511 $ b( k+2, 1 ), ldb, a( kcnext+1 ), 1, one,
514 CALL zgemv(
'Transpose', n-k-1, nrhs, one,
515 $ b( k+2, 1 ), ldb, a( kc+2 ), 1, one,
529 b( k, j ) = d11*t1 + d12*t2
530 b( k+1, j ) = d21*t1 + d22*t2
533 kc = kcnext + ( n-k )
subroutine xerbla(srname, info)
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zgeru(m, n, alpha, x, incx, y, incy, a, lda)
ZGERU
subroutine zscal(n, za, zx, incx)
ZSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine zlavsp(uplo, trans, diag, n, nrhs, a, ipiv, b, ldb, info)
ZLAVSP