165 SUBROUTINE zhetrs_3( UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB,
175 INTEGER INFO, LDA, LDB, N, NRHS
179 COMPLEX*16 A( lda, * ), B( ldb, * ), E( * )
186 parameter ( one = ( 1.0d+0,0.0d+0 ) )
192 COMPLEX*16 AK, AKM1, AKM1K, BK, BKM1, DENOM
202 INTRINSIC abs, dble, dconjg, max
207 upper = lsame( uplo,
'U' )
208 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
210 ELSE IF( n.LT.0 )
THEN
212 ELSE IF( nrhs.LT.0 )
THEN
214 ELSE IF( lda.LT.max( 1, n ) )
THEN
216 ELSE IF( ldb.LT.max( 1, n ) )
THEN
220 CALL xerbla(
'ZHETRS_3', -info )
226 IF( n.EQ.0 .OR. nrhs.EQ.0 )
245 kp = abs( ipiv( k ) )
247 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
253 CALL ztrsm(
'L',
'U',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
259 IF( ipiv( i ).GT.0 )
THEN
260 s = dble( one ) / dble( a( i, i ) )
261 CALL zdscal( nrhs, s, b( i, 1 ), ldb )
262 ELSE IF ( i.GT.1 )
THEN
264 akm1 = a( i-1, i-1 ) / akm1k
265 ak = a( i, i ) / dconjg( akm1k )
266 denom = akm1*ak - one
268 bkm1 = b( i-1, j ) / akm1k
269 bk = b( i, j ) / dconjg( akm1k )
270 b( i-1, j ) = ( ak*bkm1-bk ) / denom
271 b( i, j ) = ( akm1*bk-bkm1 ) / denom
280 CALL ztrsm(
'L',
'U',
'C',
'U', n, nrhs, one, a, lda, b, ldb )
292 kp = abs( ipiv( k ) )
294 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
313 kp = abs( ipiv( k ) )
315 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
321 CALL ztrsm(
'L',
'L',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
327 IF( ipiv( i ).GT.0 )
THEN
328 s = dble( one ) / dble( a( i, i ) )
329 CALL zdscal( nrhs, s, b( i, 1 ), ldb )
330 ELSE IF( i.LT.n )
THEN
332 akm1 = a( i, i ) / dconjg( akm1k )
333 ak = a( i+1, i+1 ) / akm1k
334 denom = akm1*ak - one
336 bkm1 = b( i, j ) / dconjg( akm1k )
337 bk = b( i+1, j ) / akm1k
338 b( i, j ) = ( ak*bkm1-bk ) / denom
339 b( i+1, j ) = ( akm1*bk-bkm1 ) / denom
348 CALL ztrsm(
'L',
'L',
'C',
'U', n, nrhs, one, a, lda, b, ldb )
360 kp = abs( ipiv( k ) )
362 CALL zswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
subroutine zswap(N, ZX, INCX, ZY, INCY)
ZSWAP
subroutine zhetrs_3(UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB, INFO)
ZHETRS_3
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine zdscal(N, DA, ZX, INCX)
ZDSCAL
subroutine ztrsm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
ZTRSM