163 SUBROUTINE zhetrs_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 ) )
189 COMPLEX*16 AK, AKM1, AKM1K, BK, BKM1, DENOM
199 INTRINSIC abs, dble, dconjg, max
204 upper = lsame( uplo,
'U' )
205 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
207 ELSE IF( n.LT.0 )
THEN
209 ELSE IF( nrhs.LT.0 )
THEN
211 ELSE IF( lda.LT.max( 1, n ) )
THEN
213 ELSE IF( ldb.LT.max( 1, n ) )
THEN
217 CALL xerbla(
'ZHETRS_3', -info )
223 IF( n.EQ.0 .OR. nrhs.EQ.0 )
242 kp = abs( ipiv( k ) )
244 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
250 CALL ztrsm(
'L',
'U',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
256 IF( ipiv( i ).GT.0 )
THEN
257 s = dble( one ) / dble( a( i, i ) )
258 CALL zdscal( nrhs, s, b( i, 1 ), ldb )
259 ELSE IF ( i.GT.1 )
THEN
261 akm1 = a( i-1, i-1 ) / akm1k
262 ak = a( i, i ) / dconjg( akm1k )
263 denom = akm1*ak - one
265 bkm1 = b( i-1, j ) / akm1k
266 bk = b( i, j ) / dconjg( akm1k )
267 b( i-1, j ) = ( ak*bkm1-bk ) / denom
268 b( i, j ) = ( akm1*bk-bkm1 ) / denom
277 CALL ztrsm(
'L',
'U',
'C',
'U', n, nrhs, one, a, lda, b, ldb )
289 kp = abs( ipiv( k ) )
291 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
310 kp = abs( ipiv( k ) )
312 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
318 CALL ztrsm(
'L',
'L',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
324 IF( ipiv( i ).GT.0 )
THEN
325 s = dble( one ) / dble( a( i, i ) )
326 CALL zdscal( nrhs, s, b( i, 1 ), ldb )
327 ELSE IF( i.LT.n )
THEN
329 akm1 = a( i, i ) / dconjg( akm1k )
330 ak = a( i+1, i+1 ) / akm1k
331 denom = akm1*ak - one
333 bkm1 = b( i, j ) / dconjg( akm1k )
334 bk = b( i+1, j ) / akm1k
335 b( i, j ) = ( ak*bkm1-bk ) / denom
336 b( i+1, j ) = ( akm1*bk-bkm1 ) / denom
345 CALL ztrsm(
'L',
'L',
'C',
'U', n, nrhs, one, a, lda, b, ldb )
357 kp = abs( ipiv( k ) )
359 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
subroutine xerbla(srname, info)
subroutine zhetrs_3(uplo, n, nrhs, a, lda, e, ipiv, b, ldb, info)
ZHETRS_3
subroutine zdscal(n, da, zx, incx)
ZDSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRSM