186 SUBROUTINE dsytf2( UPLO, N, A, LDA, IPIV, INFO )
199 DOUBLE PRECISION a( lda, * )
205 DOUBLE PRECISION zero, one
206 parameter( zero = 0.0d+0, one = 1.0d+0 )
207 DOUBLE PRECISION eight, sevten
208 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
212 INTEGER i, imax, j, jmax, k, kk, kp, kstep
213 DOUBLE PRECISION absakk, alpha, colmax, d11, d12, d21, d22, r1,
214 $ rowmax, t, wk, wkm1, wkp1
225 INTRINSIC abs, max, sqrt
232 upper =
lsame( uplo,
'U' )
233 IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
235 ELSE IF( n.LT.0 )
THEN
237 ELSE IF( lda.LT.max( 1, n ) )
THEN
241 CALL
xerbla(
'DSYTF2', -info )
247 alpha = ( one+sqrt( sevten ) ) / eight
268 absakk = abs( a( k, k ) )
274 imax =
idamax( k-1, a( 1, k ), 1 )
275 colmax = abs( a( imax, k ) )
280 IF( (max( absakk, colmax ).EQ.zero) .OR.
disnan(absakk) )
THEN
288 IF( absakk.GE.alpha*colmax )
THEN
298 jmax = imax +
idamax( k-imax, a( imax, imax+1 ), lda )
299 rowmax = abs( a( imax, jmax ) )
301 jmax =
idamax( imax-1, a( 1, imax ), 1 )
302 rowmax = max( rowmax, abs( a( jmax, imax ) ) )
305 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
310 ELSE IF( abs( a( imax, imax ) ).GE.alpha*rowmax )
THEN
332 CALL
dswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
333 CALL
dswap( kk-kp-1, a( kp+1, kk ), 1, a( kp, kp+1 ),
336 a( kk, kk ) = a( kp, kp )
338 IF( kstep.EQ.2 )
THEN
340 a( k-1, k ) = a( kp, k )
347 IF( kstep.EQ.1 )
THEN
360 CALL
dsyr( uplo, k-1, -r1, a( 1, k ), 1, a, lda )
364 CALL
dscal( k-1, r1, a( 1, k ), 1 )
382 d22 = a( k-1, k-1 ) / d12
383 d11 = a( k, k ) / d12
384 t = one / ( d11*d22-one )
387 DO 30 j = k - 2, 1, -1
388 wkm1 = d12*( d11*a( j, k-1 )-a( j, k ) )
389 wk = d12*( d22*a( j, k )-a( j, k-1 ) )
391 a( i, j ) = a( i, j ) - a( i, k )*wk -
405 IF( kstep.EQ.1 )
THEN
436 absakk = abs( a( k, k ) )
442 imax = k +
idamax( n-k, a( k+1, k ), 1 )
443 colmax = abs( a( imax, k ) )
448 IF( (max( absakk, colmax ).EQ.zero) .OR.
disnan(absakk) )
THEN
456 IF( absakk.GE.alpha*colmax )
THEN
466 jmax = k - 1 +
idamax( imax-k, a( imax, k ), lda )
467 rowmax = abs( a( imax, jmax ) )
469 jmax = imax +
idamax( n-imax, a( imax+1, imax ), 1 )
470 rowmax = max( rowmax, abs( a( jmax, imax ) ) )
473 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
478 ELSE IF( abs( a( imax, imax ) ).GE.alpha*rowmax )
THEN
501 $ CALL
dswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
502 CALL
dswap( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
505 a( kk, kk ) = a( kp, kp )
507 IF( kstep.EQ.2 )
THEN
509 a( k+1, k ) = a( kp, k )
516 IF( kstep.EQ.1 )
THEN
530 d11 = one / a( k, k )
531 CALL
dsyr( uplo, n-k, -d11, a( k+1, k ), 1,
532 $ a( k+1, k+1 ), lda )
536 CALL
dscal( n-k, d11, a( k+1, k ), 1 )
552 d11 = a( k+1, k+1 ) / d21
553 d22 = a( k, k ) / d21
554 t = one / ( d11*d22-one )
559 wk = d21*( d11*a( j, k )-a( j, k+1 ) )
560 wkp1 = d21*( d22*a( j, k+1 )-a( j, k ) )
563 a( i, j ) = a( i, j ) - a( i, k )*wk -
577 IF( kstep.EQ.1 )
THEN