141 INTEGER INFO, LDA, LDB, N, NRHS
145 REAL A( LDA, * ), B( LDB, * )
152 parameter( one = 1.0e+0 )
157 REAL AK, AKM1, AKM1K, BK, BKM1, DENOM
172 upper = lsame( uplo,
'U' )
173 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
175 ELSE IF( n.LT.0 )
THEN
177 ELSE IF( nrhs.LT.0 )
THEN
179 ELSE IF( lda.LT.max( 1, n ) )
THEN
181 ELSE IF( ldb.LT.max( 1, n ) )
THEN
185 CALL xerbla(
'SSYTRS_ROOK', -info )
191 IF( n.EQ.0 .OR. nrhs.EQ.0 )
211 IF( ipiv( k ).GT.0 )
THEN
219 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
224 CALL sger( k-1, nrhs, -one, a( 1, k ), 1, b( k, 1 ), ldb,
229 CALL sscal( nrhs, one / a( k, k ), b( k, 1 ), ldb )
239 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
243 $
CALL sswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ), ldb )
249 CALL sger( k-2, nrhs, -one, a( 1, k ), 1, b( k, 1 ),
250 $ ldb, b( 1, 1 ), ldb )
251 CALL sger( k-2, nrhs, -one, a( 1, k-1 ), 1, b( k-1,
253 $ ldb, b( 1, 1 ), ldb )
259 akm1 = a( k-1, k-1 ) / akm1k
260 ak = a( k, k ) / akm1k
261 denom = akm1*ak - one
263 bkm1 = b( k-1, j ) / akm1k
264 bk = b( k, j ) / akm1k
265 b( k-1, j ) = ( ak*bkm1-bk ) / denom
266 b( k, j ) = ( akm1*bk-bkm1 ) / denom
287 IF( ipiv( k ).GT.0 )
THEN
295 $
CALL sgemv(
'Transpose', k-1, nrhs, -one, b,
296 $ ldb, a( 1, k ), 1, one, b( k, 1 ), ldb )
302 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
312 CALL sgemv(
'Transpose', k-1, nrhs, -one, b,
313 $ ldb, a( 1, k ), 1, one, b( k, 1 ), ldb )
314 CALL sgemv(
'Transpose', k-1, nrhs, -one, b,
315 $ ldb, a( 1, k+1 ), 1, one, b( k+1, 1 ), ldb )
322 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
326 $
CALL sswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ), ldb )
351 IF( ipiv( k ).GT.0 )
THEN
359 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
365 $
CALL sger( n-k, nrhs, -one, a( k+1, k ), 1, b( k, 1 ),
366 $ ldb, b( k+1, 1 ), ldb )
370 CALL sscal( nrhs, one / a( k, k ), b( k, 1 ), ldb )
380 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
384 $
CALL sswap( nrhs, b( k+1, 1 ), ldb, b( kp, 1 ), ldb )
390 CALL sger( n-k-1, nrhs, -one, a( k+2, k ), 1, b( k,
392 $ ldb, b( k+2, 1 ), ldb )
393 CALL sger( n-k-1, nrhs, -one, a( k+2, k+1 ), 1,
394 $ b( k+1, 1 ), ldb, b( k+2, 1 ), ldb )
400 akm1 = a( k, k ) / akm1k
401 ak = a( k+1, k+1 ) / akm1k
402 denom = akm1*ak - one
404 bkm1 = b( k, j ) / akm1k
405 bk = b( k+1, j ) / akm1k
406 b( k, j ) = ( ak*bkm1-bk ) / denom
407 b( k+1, j ) = ( akm1*bk-bkm1 ) / denom
428 IF( ipiv( k ).GT.0 )
THEN
436 $
CALL sgemv(
'Transpose', n-k, nrhs, -one, b( k+1, 1 ),
437 $ ldb, a( k+1, k ), 1, one, b( k, 1 ), ldb )
443 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
453 CALL sgemv(
'Transpose', n-k, nrhs, -one, b( k+1, 1 ),
454 $ ldb, a( k+1, k ), 1, one, b( k, 1 ), ldb )
455 CALL sgemv(
'Transpose', n-k, nrhs, -one, b( k+1, 1 ),
456 $ ldb, a( k+1, k-1 ), 1, one, b( k-1, 1 ),
464 $
CALL sswap( nrhs, b( k, 1 ), ldb, b( kp, 1 ), ldb )
468 $
CALL sswap( nrhs, b( k-1, 1 ), ldb, b( kp, 1 ), ldb )