252 DOUBLE PRECISION A( LDA, * ), E( * )
258 DOUBLE PRECISION ZERO, ONE
259 parameter( zero = 0.0d+0, one = 1.0d+0 )
260 DOUBLE PRECISION EIGHT, SEVTEN
261 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
265 INTEGER I, IMAX, J, JMAX, ITEMP, K, KK, KP, KSTEP,
267 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, D11, D12, D21, D22,
268 $ ROWMAX, DTEMP, T, WK, WKM1, WKP1, SFMIN
273 DOUBLE PRECISION DLAMCH
274 EXTERNAL lsame, idamax, dlamch
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(
'DSYTF2_RK', -info )
302 alpha = ( one+sqrt( sevten ) ) / eight
306 sfmin = dlamch(
'S' )
333 absakk = abs( a( k, k ) )
340 imax = idamax( 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 + idamax( k-imax, a( imax, imax+1 ),
389 rowmax = abs( a( imax, jmax ) )
395 itemp = idamax( imax-1, a( 1, imax ), 1 )
396 dtemp = abs( a( itemp, imax ) )
397 IF( dtemp.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 dswap( p-1, a( 1, k ), 1, a( 1, p ), 1 )
453 $
CALL dswap( k-p-1, a( p+1, k ), 1, a( p, p+1 ),
456 a( k, k ) = a( p, p )
463 $
CALL dswap( n-k, a( k, k+1 ), lda, a( p, k+1 ), lda )
476 $
CALL dswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
477 IF( ( kk.GT.1 ) .AND. ( kp.LT.(kk-1) ) )
478 $
CALL dswap( 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 dswap( 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 dsyr( uplo, k-1, -d11, a( 1, k ), 1, a, lda )
524 CALL dscal( k-1, d11, a( 1, k ), 1 )
531 a( ii, k ) = a( ii, k ) / d11
539 CALL dsyr( 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 + idamax( 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 + idamax( imax-k, a( imax, k ), lda )
698 rowmax = abs( a( imax, jmax ) )
704 itemp = imax + idamax( n-imax, a( imax+1, imax ),
706 dtemp = abs( a( itemp, imax ) )
707 IF( dtemp.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 dswap( n-p, a( p+1, k ), 1, a( p+1, p ), 1 )
763 $
CALL dswap( p-k-1, a( k+1, k ), 1, a( p, k+1 ), lda )
765 a( k, k ) = a( p, p )
772 $
CALL dswap( k-1, a( k, 1 ), lda, a( p, 1 ), lda )
785 $
CALL dswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
786 IF( ( kk.LT.n ) .AND. ( kp.GT.(kk+1) ) )
787 $
CALL dswap( 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 dswap( 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 dsyr( uplo, n-k, -d11, a( k+1, k ), 1,
829 $ a( k+1, k+1 ), lda )
833 CALL dscal( n-k, d11, a( k+1, k ), 1 )
840 a( ii, k ) = a( ii, k ) / d11
848 CALL dsyr( 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 dsyr(uplo, n, alpha, x, incx, a, lda)
DSYR
subroutine dsytf2_rk(uplo, n, a, lda, e, ipiv, info)
DSYTF2_RK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-Ka...
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dswap(n, dx, incx, dy, incy)
DSWAP