193 SUBROUTINE dsytf2( UPLO, N, A, LDA, IPIV, INFO )
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, K, KK, KP, KSTEP
219 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, D11, D12, D21, D22, R1,
220 $ ROWMAX, T, WK, WKM1, WKP1
223 LOGICAL LSAME, DISNAN
225 EXTERNAL lsame, idamax, disnan
231 INTRINSIC abs, max, sqrt
238 upper = lsame( uplo,
'U' )
239 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
241 ELSE IF( n.LT.0 )
THEN
243 ELSE IF( lda.LT.max( 1, n ) )
THEN
247 CALL xerbla(
'DSYTF2', -info )
253 alpha = ( one+sqrt( sevten ) ) / eight
274 absakk = abs( a( k, k ) )
281 imax = idamax( k-1, a( 1, k ), 1 )
282 colmax = abs( a( imax, k ) )
287 IF( (max( absakk, colmax ).EQ.zero) .OR. disnan(absakk) )
THEN
296 IF( absakk.GE.alpha*colmax )
THEN
306 jmax = imax + idamax( k-imax, a( imax, imax+1 ), lda )
307 rowmax = abs( a( imax, jmax ) )
309 jmax = idamax( imax-1, a( 1, imax ), 1 )
310 rowmax = max( rowmax, abs( a( jmax, imax ) ) )
313 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
318 ELSE IF( abs( a( imax, imax ) ).GE.alpha*rowmax )
THEN
340 CALL dswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
341 CALL dswap( kk-kp-1, a( kp+1, kk ), 1, a( kp, kp+1 ),
344 a( kk, kk ) = a( kp, kp )
346 IF( kstep.EQ.2 )
THEN
348 a( k-1, k ) = a( kp, k )
355 IF( kstep.EQ.1 )
THEN
368 CALL dsyr( uplo, k-1, -r1, a( 1, k ), 1, a, lda )
372 CALL dscal( k-1, r1, a( 1, k ), 1 )
390 d22 = a( k-1, k-1 ) / d12
391 d11 = a( k, k ) / d12
392 t = one / ( d11*d22-one )
395 DO 30 j = k - 2, 1, -1
396 wkm1 = d12*( d11*a( j, k-1 )-a( j, k ) )
397 wk = d12*( d22*a( j, k )-a( j, k-1 ) )
399 a( i, j ) = a( i, j ) - a( i, k )*wk -
413 IF( kstep.EQ.1 )
THEN
444 absakk = abs( a( k, k ) )
451 imax = k + idamax( n-k, a( k+1, k ), 1 )
452 colmax = abs( a( imax, k ) )
457 IF( (max( absakk, colmax ).EQ.zero) .OR. disnan(absakk) )
THEN
466 IF( absakk.GE.alpha*colmax )
THEN
476 jmax = k - 1 + idamax( imax-k, a( imax, k ), lda )
477 rowmax = abs( a( imax, jmax ) )
479 jmax = imax + idamax( n-imax, a( imax+1, imax ), 1 )
480 rowmax = max( rowmax, abs( a( jmax, imax ) ) )
483 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
488 ELSE IF( abs( a( imax, imax ) ).GE.alpha*rowmax )
THEN
511 $
CALL dswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
512 CALL dswap( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
515 a( kk, kk ) = a( kp, kp )
517 IF( kstep.EQ.2 )
THEN
519 a( k+1, k ) = a( kp, k )
526 IF( kstep.EQ.1 )
THEN
540 d11 = one / a( k, k )
541 CALL dsyr( uplo, n-k, -d11, a( k+1, k ), 1,
542 $ a( k+1, k+1 ), lda )
546 CALL dscal( n-k, d11, a( k+1, k ), 1 )
562 d11 = a( k+1, k+1 ) / d21
563 d22 = a( k, k ) / d21
564 t = one / ( d11*d22-one )
569 wk = d21*( d11*a( j, k )-a( j, k+1 ) )
570 wkp1 = d21*( d22*a( j, k+1 )-a( j, k ) )
573 a( i, j ) = a( i, j ) - a( i, k )*wk -
587 IF( kstep.EQ.1 )
THEN
subroutine xerbla(srname, info)
subroutine dsyr(uplo, n, alpha, x, incx, a, lda)
DSYR
subroutine dsytf2(uplo, n, a, lda, ipiv, info)
DSYTF2 computes the factorization of a real symmetric indefinite matrix, using the diagonal pivoting ...
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dswap(n, dx, incx, dy, incy)
DSWAP