116 SUBROUTINE zsptrs( UPLO, N, NRHS, AP, IPIV, B, LDB, INFO )
125 INTEGER INFO, LDB, N, NRHS
129 COMPLEX*16 AP( * ), B( ldb, * )
136 parameter ( one = ( 1.0d+0, 0.0d+0 ) )
141 COMPLEX*16 AK, AKM1, AKM1K, BK, BKM1, DENOM
156 upper = lsame( uplo,
'U' )
157 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
159 ELSE IF( n.LT.0 )
THEN
161 ELSE IF( nrhs.LT.0 )
THEN
163 ELSE IF( ldb.LT.max( 1, n ) )
THEN
167 CALL xerbla(
'ZSPTRS', -info )
173 IF( n.EQ.0 .OR. nrhs.EQ.0 )
186 kc = n*( n+1 ) / 2 + 1
195 IF( ipiv( k ).GT.0 )
THEN
203 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
208 CALL zgeru( k-1, nrhs, -one, ap( kc ), 1, b( k, 1 ), ldb,
213 CALL zscal( nrhs, one / ap( kc+k-1 ), b( k, 1 ), ldb )
223 $
CALL zswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ), ldb )
228 CALL zgeru( k-2, nrhs, -one, ap( kc ), 1, b( k, 1 ), ldb,
230 CALL zgeru( k-2, nrhs, -one, ap( kc-( k-1 ) ), 1,
231 $ b( k-1, 1 ), ldb, b( 1, 1 ), ldb )
236 akm1 = ap( kc-1 ) / akm1k
237 ak = ap( kc+k-1 ) / akm1k
238 denom = akm1*ak - one
240 bkm1 = b( k-1, j ) / akm1k
241 bk = b( k, j ) / akm1k
242 b( k-1, j ) = ( ak*bkm1-bk ) / denom
243 b( k, j ) = ( akm1*bk-bkm1 ) / denom
266 IF( ipiv( k ).GT.0 )
THEN
273 CALL zgemv(
'Transpose', k-1, nrhs, -one, b, ldb, ap( kc ),
274 $ 1, one, b( k, 1 ), ldb )
280 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
290 CALL zgemv(
'Transpose', k-1, nrhs, -one, b, ldb, ap( kc ),
291 $ 1, one, b( k, 1 ), ldb )
292 CALL zgemv(
'Transpose', k-1, nrhs, -one, b, ldb,
293 $ ap( kc+k ), 1, one, b( k+1, 1 ), ldb )
299 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
325 IF( ipiv( k ).GT.0 )
THEN
333 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
339 $
CALL zgeru( n-k, nrhs, -one, ap( kc+1 ), 1, b( k, 1 ),
340 $ ldb, b( k+1, 1 ), ldb )
344 CALL zscal( nrhs, one / ap( kc ), b( k, 1 ), ldb )
355 $
CALL zswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ), ldb )
361 CALL zgeru( n-k-1, nrhs, -one, ap( kc+2 ), 1, b( k, 1 ),
362 $ ldb, b( k+2, 1 ), ldb )
363 CALL zgeru( n-k-1, nrhs, -one, ap( kc+n-k+2 ), 1,
364 $ b( k+1, 1 ), ldb, b( k+2, 1 ), ldb )
370 akm1 = ap( kc ) / akm1k
371 ak = ap( kc+n-k+1 ) / akm1k
372 denom = akm1*ak - one
374 bkm1 = b( k, j ) / akm1k
375 bk = b( k+1, j ) / akm1k
376 b( k, j ) = ( ak*bkm1-bk ) / denom
377 b( k+1, j ) = ( akm1*bk-bkm1 ) / denom
379 kc = kc + 2*( n-k ) + 1
392 kc = n*( n+1 ) / 2 + 1
401 IF( ipiv( k ).GT.0 )
THEN
409 $
CALL zgemv(
'Transpose', n-k, nrhs, -one, b( k+1, 1 ),
410 $ ldb, ap( kc+1 ), 1, one, b( k, 1 ), ldb )
416 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
426 CALL zgemv(
'Transpose', n-k, nrhs, -one, b( k+1, 1 ),
427 $ ldb, ap( kc+1 ), 1, one, b( k, 1 ), ldb )
428 CALL zgemv(
'Transpose', n-k, nrhs, -one, b( k+1, 1 ),
429 $ ldb, ap( kc-( n-k ) ), 1, one, b( k-1, 1 ),
437 $
CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
subroutine zgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
ZGEMV
subroutine zswap(N, ZX, INCX, ZY, INCY)
ZSWAP
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine zsptrs(UPLO, N, NRHS, AP, IPIV, B, LDB, INFO)
ZSPTRS
subroutine zgeru(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)
ZGERU
subroutine zscal(N, ZA, ZX, INCX)
ZSCAL