205 DOUBLE PRECISION A( LDA, * )
211 DOUBLE PRECISION ZERO, ONE
212 parameter( zero = 0.0d+0, one = 1.0d+0 )
213 DOUBLE PRECISION EIGHT, SEVTEN
214 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
218 INTEGER I, IMAX, J, JMAX, ITEMP, K, KK, KP, KSTEP,
220 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, D11, D12, D21, D22,
221 $ ROWMAX, DTEMP, T, WK, WKM1, WKP1, SFMIN
226 DOUBLE PRECISION DLAMCH
227 EXTERNAL lsame, idamax, dlamch
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(
'DSYTF2_ROOK', -info )
255 alpha = ( one+sqrt( sevten ) ) / eight
259 sfmin = dlamch(
'S' )
281 absakk = abs( a( k, k ) )
288 imax = idamax( 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 + idamax( k-imax, a( imax, imax+1 ),
331 rowmax = abs( a( imax, jmax ) )
337 itemp = idamax( imax-1, a( 1, imax ), 1 )
338 dtemp = abs( a( itemp, imax ) )
339 IF( dtemp.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 dswap( p-1, a( 1, k ), 1, a( 1, p ), 1 )
395 $
CALL dswap( k-p-1, a( p+1, k ), 1, a( p, p+1 ),
398 a( k, k ) = a( p, p )
411 $
CALL dswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
412 IF( ( kk.GT.1 ) .AND. ( kp.LT.(kk-1) ) )
413 $
CALL dswap( 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 dsyr( uplo, k-1, -d11, a( 1, k ), 1, a, lda )
451 CALL dscal( k-1, d11, a( 1, k ), 1 )
458 a( ii, k ) = a( ii, k ) / d11
466 CALL dsyr( 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 + idamax( 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 + idamax( imax-k, a( imax, k ), lda )
597 rowmax = abs( a( imax, jmax ) )
603 itemp = imax + idamax( n-imax, a( imax+1, imax ),
605 dtemp = abs( a( itemp, imax ) )
606 IF( dtemp.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 dswap( n-p, a( p+1, k ), 1, a( p+1, p ), 1 )
662 $
CALL dswap( p-k-1, a( k+1, k ), 1, a( p, k+1 ), lda )
664 a( k, k ) = a( p, p )
677 $
CALL dswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
678 IF( ( kk.LT.n ) .AND. ( kp.GT.(kk+1) ) )
679 $
CALL dswap( 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 dsyr( uplo, n-k, -d11, a( k+1, k ), 1,
714 $ a( k+1, k+1 ), lda )
718 CALL dscal( n-k, d11, a( k+1, k ), 1 )
725 a( ii, k ) = a( ii, k ) / d11
733 CALL dsyr( 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 dsyr(uplo, n, alpha, x, incx, a, lda)
DSYR
subroutine dsytf2_rook(uplo, n, a, lda, ipiv, info)
DSYTF2_ROOK computes the factorization of a real symmetric indefinite matrix using the bounded Bunch-...
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dswap(n, dx, incx, dy, incy)
DSWAP