252 REAL A( LDA, * ), E( * )
259 parameter( zero = 0.0e+0, one = 1.0e+0 )
261 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
265 INTEGER I, IMAX, J, JMAX, ITEMP, K, KK, KP, KSTEP,
267 REAL ABSAKK, ALPHA, COLMAX, D11, D12, D21, D22,
268 $ ROWMAX, STEMP, T, WK, WKM1, WKP1, SFMIN
274 EXTERNAL lsame, isamax, slamch
280 INTRINSIC abs, max, sqrt
287 upper = lsame( uplo,
'U' )
288 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
290 ELSE IF( n.LT.0 )
THEN
292 ELSE IF( lda.LT.max( 1, n ) )
THEN
296 CALL xerbla(
'SSYTF2_RK', -info )
302 alpha = ( one+sqrt( sevten ) ) / eight
306 sfmin = slamch(
'S' )
333 absakk = abs( a( k, k ) )
340 imax = isamax( k-1, a( 1, k ), 1 )
341 colmax = abs( a( imax, k ) )
346 IF( (max( absakk, colmax ).EQ.zero) )
THEN
366 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
387 jmax = imax + isamax( k-imax, a( imax, imax+1 ),
389 rowmax = abs( a( imax, jmax ) )
395 itemp = isamax( imax-1, a( 1, imax ), 1 )
396 stemp = abs( a( itemp, imax ) )
397 IF( stemp.GT.rowmax )
THEN
406 IF( .NOT.( abs( a( imax, imax ) ).LT.alpha*rowmax ) )
418 ELSE IF( ( p.EQ.jmax ).OR.( rowmax.LE.colmax ) )
THEN
437 IF( .NOT. done )
GOTO 12
445 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
451 $
CALL sswap( p-1, a( 1, k ), 1, a( 1, p ), 1 )
453 $
CALL sswap( k-p-1, a( p+1, k ), 1, a( p, p+1 ),
456 a( k, k ) = a( p, p )
463 $
CALL sswap( n-k, a( k, k+1 ), lda, a( p, k+1 ), lda )
476 $
CALL sswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
477 IF( ( kk.GT.1 ) .AND. ( kp.LT.(kk-1) ) )
478 $
CALL sswap( kk-kp-1, a( kp+1, kk ), 1, a( kp, kp+1 ),
481 a( kk, kk ) = a( kp, kp )
483 IF( kstep.EQ.2 )
THEN
485 a( k-1, k ) = a( kp, k )
493 $
CALL sswap( n-k, a( kk, k+1 ), lda, a( kp, k+1 ),
500 IF( kstep.EQ.1 )
THEN
513 IF( abs( a( k, k ) ).GE.sfmin )
THEN
519 d11 = one / a( k, k )
520 CALL ssyr( uplo, k-1, -d11, a( 1, k ), 1, a, lda )
524 CALL sscal( k-1, d11, a( 1, k ), 1 )
531 a( ii, k ) = a( ii, k ) / d11
539 CALL ssyr( uplo, k-1, -d11, a( 1, k ), 1, a, lda )
567 d22 = a( k-1, k-1 ) / d12
568 d11 = a( k, k ) / d12
569 t = one / ( d11*d22-one )
571 DO 30 j = k - 2, 1, -1
573 wkm1 = t*( d11*a( j, k-1 )-a( j, k ) )
574 wk = t*( d22*a( j, k )-a( j, k-1 ) )
577 a( i, j ) = a( i, j ) - (a( i, k ) / d12 )*wk -
578 $ ( a( i, k-1 ) / d12 )*wkm1
584 a( j, k-1 ) = wkm1 / d12
605 IF( kstep.EQ.1 )
THEN
643 absakk = abs( a( k, k ) )
650 imax = k + isamax( n-k, a( k+1, k ), 1 )
651 colmax = abs( a( imax, k ) )
656 IF( ( max( absakk, colmax ).EQ.zero ) )
THEN
676 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
697 jmax = k - 1 + isamax( imax-k, a( imax, k ), lda )
698 rowmax = abs( a( imax, jmax ) )
704 itemp = imax + isamax( n-imax, a( imax+1, imax ),
706 stemp = abs( a( itemp, imax ) )
707 IF( stemp.GT.rowmax )
THEN
716 IF( .NOT.( abs( a( imax, imax ) ).LT.alpha*rowmax ) )
728 ELSE IF( ( p.EQ.jmax ).OR.( rowmax.LE.colmax ) )
THEN
747 IF( .NOT. done )
GOTO 42
755 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
761 $
CALL sswap( n-p, a( p+1, k ), 1, a( p+1, p ), 1 )
763 $
CALL sswap( p-k-1, a( k+1, k ), 1, a( p, k+1 ), lda )
765 a( k, k ) = a( p, p )
772 $
CALL sswap( k-1, a( k, 1 ), lda, a( p, 1 ), lda )
785 $
CALL sswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
786 IF( ( kk.LT.n ) .AND. ( kp.GT.(kk+1) ) )
787 $
CALL sswap( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
790 a( kk, kk ) = a( kp, kp )
792 IF( kstep.EQ.2 )
THEN
794 a( k+1, k ) = a( kp, k )
802 $
CALL sswap( k-1, a( kk, 1 ), lda, a( kp, 1 ), lda )
808 IF( kstep.EQ.1 )
THEN
821 IF( abs( a( k, k ) ).GE.sfmin )
THEN
827 d11 = one / a( k, k )
828 CALL ssyr( uplo, n-k, -d11, a( k+1, k ), 1,
829 $ a( k+1, k+1 ), lda )
833 CALL sscal( n-k, d11, a( k+1, k ), 1 )
840 a( ii, k ) = a( ii, k ) / d11
848 CALL ssyr( uplo, n-k, -d11, a( k+1, k ), 1,
849 $ a( k+1, k+1 ), lda )
878 d11 = a( k+1, k+1 ) / d21
879 d22 = a( k, k ) / d21
880 t = one / ( d11*d22-one )
886 wk = t*( d11*a( j, k )-a( j, k+1 ) )
887 wkp1 = t*( d22*a( j, k+1 )-a( j, k ) )
892 a( i, j ) = a( i, j ) - ( a( i, k ) / d21 )*wk -
893 $ ( a( i, k+1 ) / d21 )*wkp1
899 a( j, k+1 ) = wkp1 / d21
920 IF( kstep.EQ.1 )
THEN
subroutine xerbla(srname, info)
subroutine ssyr(uplo, n, alpha, x, incx, a, lda)
SSYR
subroutine ssytf2_rk(uplo, n, a, lda, e, ipiv, info)
SSYTF2_RK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Ka...
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sswap(n, sx, incx, sy, incy)
SSWAP