163 SUBROUTINE chetrs_3( UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB,
172 INTEGER INFO, LDA, LDB, N, NRHS
176 COMPLEX A( LDA, * ), B( LDB, * ), E( * )
183 parameter( one = ( 1.0e+0,0.0e+0 ) )
189 COMPLEX AK, AKM1, AKM1K, BK, BKM1, DENOM
199 INTRINSIC abs, conjg, max, real
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(
'CHETRS_3', -info )
223 IF( n.EQ.0 .OR. nrhs.EQ.0 )
242 kp = abs( ipiv( k ) )
244 CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
250 CALL ctrsm(
'L',
'U',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
256 IF( ipiv( i ).GT.0 )
THEN
257 s = real( one ) / real( a( i, i ) )
258 CALL csscal( 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 ) / conjg( akm1k )
263 denom = akm1*ak - one
265 bkm1 = b( i-1, j ) / akm1k
266 bk = b( i, j ) / conjg( akm1k )
267 b( i-1, j ) = ( ak*bkm1-bk ) / denom
268 b( i, j ) = ( akm1*bk-bkm1 ) / denom
277 CALL ctrsm(
'L',
'U',
'C',
'U', n, nrhs, one, a, lda, b, ldb )
289 kp = abs( ipiv( k ) )
291 CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
310 kp = abs( ipiv( k ) )
312 CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
318 CALL ctrsm(
'L',
'L',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
324 IF( ipiv( i ).GT.0 )
THEN
325 s = real( one ) / real( a( i, i ) )
326 CALL csscal( nrhs, s, b( i, 1 ), ldb )
327 ELSE IF( i.LT.n )
THEN
329 akm1 = a( i, i ) / conjg( akm1k )
330 ak = a( i+1, i+1 ) / akm1k
331 denom = akm1*ak - one
333 bkm1 = b( i, j ) / conjg( 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 ctrsm(
'L',
'L',
'C',
'U', n, nrhs, one, a, lda, b, ldb )
357 kp = abs( ipiv( k ) )
359 CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
subroutine xerbla(srname, info)
subroutine chetrs_3(uplo, n, nrhs, a, lda, e, ipiv, b, ldb, info)
CHETRS_3
subroutine csscal(n, sa, cx, incx)
CSSCAL
subroutine cswap(n, cx, incx, cy, incy)
CSWAP
subroutine ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRSM