161 SUBROUTINE csytrs_3( UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB,
170 INTEGER INFO, LDA, LDB, N, NRHS
174 COMPLEX A( LDA, * ), B( LDB, * ), E( * )
181 parameter( one = ( 1.0e+0,0.0e+0 ) )
186 COMPLEX AK, AKM1, AKM1K, BK, BKM1, DENOM
201 upper = lsame( uplo,
'U' )
202 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
204 ELSE IF( n.LT.0 )
THEN
206 ELSE IF( nrhs.LT.0 )
THEN
208 ELSE IF( lda.LT.max( 1, n ) )
THEN
210 ELSE IF( ldb.LT.max( 1, n ) )
THEN
214 CALL xerbla(
'CSYTRS_3', -info )
220 IF( n.EQ.0 .OR. nrhs.EQ.0 )
239 kp = abs( ipiv( k ) )
241 CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
247 CALL ctrsm(
'L',
'U',
'N',
'U', n, nrhs, one, a, lda, b,
254 IF( ipiv( i ).GT.0 )
THEN
255 CALL cscal( nrhs, one / a( i, i ), b( i, 1 ), ldb )
256 ELSE IF ( i.GT.1 )
THEN
258 akm1 = a( i-1, i-1 ) / akm1k
259 ak = a( i, i ) / akm1k
260 denom = akm1*ak - one
262 bkm1 = b( i-1, j ) / akm1k
263 bk = b( i, j ) / akm1k
264 b( i-1, j ) = ( ak*bkm1-bk ) / denom
265 b( i, j ) = ( akm1*bk-bkm1 ) / denom
274 CALL ctrsm(
'L',
'U',
'T',
'U', n, nrhs, one, a, lda, b,
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,
323 IF( ipiv( i ).GT.0 )
THEN
324 CALL cscal( nrhs, one / a( i, i ), b( i, 1 ), ldb )
325 ELSE IF( i.LT.n )
THEN
327 akm1 = a( i, i ) / akm1k
328 ak = a( i+1, i+1 ) / akm1k
329 denom = akm1*ak - one
331 bkm1 = b( i, j ) / akm1k
332 bk = b( i+1, j ) / akm1k
333 b( i, j ) = ( ak*bkm1-bk ) / denom
334 b( i+1, j ) = ( akm1*bk-bkm1 ) / denom
343 CALL ctrsm(
'L',
'L',
'T',
'U', n, nrhs, one, a, lda, b,
356 kp = abs( ipiv( k ) )
358 CALL cswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
subroutine ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRSM