163 SUBROUTINE csytrs_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 ) )
188 COMPLEX 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(
'CSYTRS_3', -info )
222 IF( n.EQ.0 .OR. nrhs.EQ.0 )
241 kp = abs( ipiv( k ) )
243 CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
249 CALL ctrsm(
'L',
'U',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
255 IF( ipiv( i ).GT.0 )
THEN
256 CALL cscal( 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 ctrsm(
'L',
'U',
'T',
'U', n, nrhs, one, a, lda, b, ldb )
287 kp = abs( ipiv( k ) )
289 CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
308 kp = abs( ipiv( k ) )
310 CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
316 CALL ctrsm(
'L',
'L',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
322 IF( ipiv( i ).GT.0 )
THEN
323 CALL cscal( 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 ctrsm(
'L',
'L',
'T',
'U', n, nrhs, one, a, lda, b, ldb )
354 kp = abs( ipiv( k ) )
356 CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
subroutine xerbla(srname, info)
subroutine csytrs_3(uplo, n, nrhs, a, lda, e, ipiv, b, ldb, info)
CSYTRS_3
subroutine cscal(n, ca, cx, incx)
CSCAL
subroutine cswap(n, cx, incx, cy, incy)
CSWAP
subroutine ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRSM