163 SUBROUTINE zsytrs_3( UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB,
172 INTEGER INFO, LDA, LDB, N, NRHS
176 COMPLEX*16 A( LDA, * ), B( LDB, * ), E( * )
183 parameter( one = ( 1.0d+0,0.0d+0 ) )
188 COMPLEX*16 AK, AKM1, AKM1K, BK, BKM1, DENOM
203 upper = lsame( uplo,
'U' )
204 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
206 ELSE IF( n.LT.0 )
THEN
208 ELSE IF( nrhs.LT.0 )
THEN
210 ELSE IF( lda.LT.max( 1, n ) )
THEN
212 ELSE IF( ldb.LT.max( 1, n ) )
THEN
216 CALL xerbla(
'ZSYTRS_3', -info )
222 IF( n.EQ.0 .OR. nrhs.EQ.0 )
241 kp = abs( ipiv( k ) )
243 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
249 CALL ztrsm(
'L',
'U',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
255 IF( ipiv( i ).GT.0 )
THEN
256 CALL zscal( nrhs, one / a( i, i ), b( i, 1 ), ldb )
257 ELSE IF ( i.GT.1 )
THEN
259 akm1 = a( i-1, i-1 ) / akm1k
260 ak = a( i, i ) / akm1k
261 denom = akm1*ak - one
263 bkm1 = b( i-1, j ) / akm1k
264 bk = b( i, j ) / akm1k
265 b( i-1, j ) = ( ak*bkm1-bk ) / denom
266 b( i, j ) = ( akm1*bk-bkm1 ) / denom
275 CALL ztrsm(
'L',
'U',
'T',
'U', n, nrhs, one, a, lda, b, ldb )
287 kp = abs( ipiv( k ) )
289 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
308 kp = abs( ipiv( k ) )
310 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
316 CALL ztrsm(
'L',
'L',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
322 IF( ipiv( i ).GT.0 )
THEN
323 CALL zscal( nrhs, one / a( i, i ), b( i, 1 ), ldb )
324 ELSE IF( i.LT.n )
THEN
326 akm1 = a( i, i ) / akm1k
327 ak = a( i+1, i+1 ) / akm1k
328 denom = akm1*ak - one
330 bkm1 = b( i, j ) / akm1k
331 bk = b( i+1, j ) / akm1k
332 b( i, j ) = ( ak*bkm1-bk ) / denom
333 b( i+1, j ) = ( akm1*bk-bkm1 ) / denom
342 CALL ztrsm(
'L',
'L',
'T',
'U', n, nrhs, one, a, lda, b, ldb )
354 kp = abs( ipiv( k ) )
356 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
subroutine xerbla(srname, info)
subroutine zsytrs_3(uplo, n, nrhs, a, lda, e, ipiv, b, ldb, info)
ZSYTRS_3
subroutine zscal(n, za, zx, incx)
ZSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRSM