165 SUBROUTINE ssytrs_3( UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB,
175 INTEGER INFO, LDA, LDB, N, NRHS
179 REAL A( lda, * ), B( ldb, * ), E( * )
186 parameter ( one = 1.0e+0 )
191 REAL AK, AKM1, AKM1K, BK, BKM1, DENOM
206 upper = lsame( uplo,
'U' )
207 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
209 ELSE IF( n.LT.0 )
THEN
211 ELSE IF( nrhs.LT.0 )
THEN
213 ELSE IF( lda.LT.max( 1, n ) )
THEN
215 ELSE IF( ldb.LT.max( 1, n ) )
THEN
219 CALL xerbla(
'SSYTRS_3', -info )
225 IF( n.EQ.0 .OR. nrhs.EQ.0 )
244 kp = abs( ipiv( k ) )
246 CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
252 CALL strsm(
'L',
'U',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
258 IF( ipiv( i ).GT.0 )
THEN
259 CALL sscal( nrhs, one / a( i, i ), b( i, 1 ), ldb )
260 ELSE IF ( i.GT.1 )
THEN
262 akm1 = a( i-1, i-1 ) / akm1k
263 ak = a( i, i ) / akm1k
264 denom = akm1*ak - one
266 bkm1 = b( i-1, j ) / akm1k
267 bk = b( i, j ) / akm1k
268 b( i-1, j ) = ( ak*bkm1-bk ) / denom
269 b( i, j ) = ( akm1*bk-bkm1 ) / denom
278 CALL strsm(
'L',
'U',
'T',
'U', n, nrhs, one, a, lda, b, ldb )
290 kp = abs( ipiv( k ) )
292 CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
311 kp = abs( ipiv( k ) )
313 CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
319 CALL strsm(
'L',
'L',
'N',
'U', n, nrhs, one, a, lda, b, ldb )
325 IF( ipiv( i ).GT.0 )
THEN
326 CALL sscal( nrhs, one / a( i, i ), b( i, 1 ), ldb )
327 ELSE IF( i.LT.n )
THEN
329 akm1 = a( i, i ) / akm1k
330 ak = a( i+1, i+1 ) / akm1k
331 denom = akm1*ak - one
333 bkm1 = b( i, j ) / 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 strsm(
'L',
'L',
'T',
'U', n, nrhs, one, a, lda, b, ldb )
357 kp = abs( ipiv( k ) )
359 CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
subroutine strsm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
STRSM
subroutine ssytrs_3(UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB, INFO)
SSYTRS_3
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine sscal(N, SA, SX, INCX)
SSCAL
subroutine sswap(N, SX, INCX, SY, INCY)
SSWAP