212 parameter( zero = 0.0e+0, one = 1.0e+0 )
214 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
218 INTEGER I, IMAX, J, JMAX, ITEMP, K, KK, KP, KSTEP,
220 REAL ABSAKK, ALPHA, COLMAX, D11, D12, D21, D22,
221 $ ROWMAX, STEMP, T, WK, WKM1, WKP1, SFMIN
227 EXTERNAL lsame, isamax, slamch
233 INTRINSIC abs, max, sqrt
240 upper = lsame( uplo,
'U' )
241 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
243 ELSE IF( n.LT.0 )
THEN
245 ELSE IF( lda.LT.max( 1, n ) )
THEN
249 CALL xerbla(
'SSYTF2_ROOK', -info )
255 alpha = ( one+sqrt( sevten ) ) / eight
259 sfmin = slamch(
'S' )
281 absakk = abs( a( k, k ) )
288 imax = isamax( k-1, a( 1, k ), 1 )
289 colmax = abs( a( imax, k ) )
294 IF( (max( absakk, colmax ).EQ.zero) )
THEN
308 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
329 jmax = imax + isamax( k-imax, a( imax, imax+1 ),
331 rowmax = abs( a( imax, jmax ) )
337 itemp = isamax( imax-1, a( 1, imax ), 1 )
338 stemp = abs( a( itemp, imax ) )
339 IF( stemp.GT.rowmax )
THEN
348 IF( .NOT.( abs( a( imax, imax ) ).LT.alpha*rowmax ) )
360 ELSE IF( ( p.EQ.jmax ).OR.( rowmax.LE.colmax ) )
THEN
379 IF( .NOT. done )
GOTO 12
387 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
393 $
CALL sswap( p-1, a( 1, k ), 1, a( 1, p ), 1 )
395 $
CALL sswap( k-p-1, a( p+1, k ), 1, a( p, p+1 ),
398 a( k, k ) = a( p, p )
411 $
CALL sswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
412 IF( ( kk.GT.1 ) .AND. ( kp.LT.(kk-1) ) )
413 $
CALL sswap( kk-kp-1, a( kp+1, kk ), 1, a( kp, kp+1 ),
416 a( kk, kk ) = a( kp, kp )
418 IF( kstep.EQ.2 )
THEN
420 a( k-1, k ) = a( kp, k )
427 IF( kstep.EQ.1 )
THEN
440 IF( abs( a( k, k ) ).GE.sfmin )
THEN
446 d11 = one / a( k, k )
447 CALL ssyr( uplo, k-1, -d11, a( 1, k ), 1, a, lda )
451 CALL sscal( k-1, d11, a( 1, k ), 1 )
458 a( ii, k ) = a( ii, k ) / d11
466 CALL ssyr( uplo, k-1, -d11, a( 1, k ), 1, a, lda )
489 d22 = a( k-1, k-1 ) / d12
490 d11 = a( k, k ) / d12
491 t = one / ( d11*d22-one )
493 DO 30 j = k - 2, 1, -1
495 wkm1 = t*( d11*a( j, k-1 )-a( j, k ) )
496 wk = t*( d22*a( j, k )-a( j, k-1 ) )
499 a( i, j ) = a( i, j ) - (a( i, k ) / d12 )*wk -
500 $ ( a( i, k-1 ) / d12 )*wkm1
506 a( j, k-1 ) = wkm1 / d12
517 IF( kstep.EQ.1 )
THEN
549 absakk = abs( a( k, k ) )
556 imax = k + isamax( n-k, a( k+1, k ), 1 )
557 colmax = abs( a( imax, k ) )
562 IF( ( max( absakk, colmax ).EQ.zero ) )
THEN
576 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
596 jmax = k - 1 + isamax( imax-k, a( imax, k ), lda )
597 rowmax = abs( a( imax, jmax ) )
603 itemp = imax + isamax( n-imax, a( imax+1, imax ),
605 stemp = abs( a( itemp, imax ) )
606 IF( stemp.GT.rowmax )
THEN
615 IF( .NOT.( abs( a( imax, imax ) ).LT.alpha*rowmax ) )
627 ELSE IF( ( p.EQ.jmax ).OR.( rowmax.LE.colmax ) )
THEN
646 IF( .NOT. done )
GOTO 42
654 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
660 $
CALL sswap( n-p, a( p+1, k ), 1, a( p+1, p ), 1 )
662 $
CALL sswap( p-k-1, a( k+1, k ), 1, a( p, k+1 ), lda )
664 a( k, k ) = a( p, p )
677 $
CALL sswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
678 IF( ( kk.LT.n ) .AND. ( kp.GT.(kk+1) ) )
679 $
CALL sswap( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
682 a( kk, kk ) = a( kp, kp )
684 IF( kstep.EQ.2 )
THEN
686 a( k+1, k ) = a( kp, k )
693 IF( kstep.EQ.1 )
THEN
706 IF( abs( a( k, k ) ).GE.sfmin )
THEN
712 d11 = one / a( k, k )
713 CALL ssyr( uplo, n-k, -d11, a( k+1, k ), 1,
714 $ a( k+1, k+1 ), lda )
718 CALL sscal( n-k, d11, a( k+1, k ), 1 )
725 a( ii, k ) = a( ii, k ) / d11
733 CALL ssyr( uplo, n-k, -d11, a( k+1, k ), 1,
734 $ a( k+1, k+1 ), lda )
758 d11 = a( k+1, k+1 ) / d21
759 d22 = a( k, k ) / d21
760 t = one / ( d11*d22-one )
766 wk = t*( d11*a( j, k )-a( j, k+1 ) )
767 wkp1 = t*( d22*a( j, k+1 )-a( j, k ) )
772 a( i, j ) = a( i, j ) - ( a( i, k ) / d21 )*wk -
773 $ ( a( i, k+1 ) / d21 )*wkp1
779 a( j, k+1 ) = wkp1 / d21
790 IF( kstep.EQ.1 )
THEN
subroutine xerbla(srname, info)
subroutine ssyr(uplo, n, alpha, x, incx, a, lda)
SSYR
subroutine ssytf2_rook(uplo, n, a, lda, ipiv, info)
SSYTF2_ROOK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-...
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sswap(n, sx, incx, sy, incy)
SSWAP