190 SUBROUTINE zhetf2( UPLO, N, A, LDA, IPIV, INFO )
202 COMPLEX*16 A( LDA, * )
208 DOUBLE PRECISION ZERO, ONE
209 parameter( zero = 0.0d+0, one = 1.0d+0 )
210 DOUBLE PRECISION EIGHT, SEVTEN
211 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
215 INTEGER I, IMAX, J, JMAX, K, KK, KP, KSTEP
216 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, D, D11, D22, R1, ROWMAX,
218 COMPLEX*16 D12, D21, T, WK, WKM1, WKP1, ZDUM
221 LOGICAL LSAME, DISNAN
223 DOUBLE PRECISION DLAPY2
224 EXTERNAL lsame, izamax, dlapy2, disnan
230 INTRINSIC abs, dble, dcmplx, dconjg, dimag, max, sqrt
233 DOUBLE PRECISION CABS1
236 cabs1( zdum ) = abs( dble( zdum ) ) + abs( dimag( zdum ) )
243 upper = lsame( uplo,
'U' )
244 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
246 ELSE IF( n.LT.0 )
THEN
248 ELSE IF( lda.LT.max( 1, n ) )
THEN
252 CALL xerbla(
'ZHETF2', -info )
258 alpha = ( one+sqrt( sevten ) ) / eight
279 absakk = abs( dble( a( k, k ) ) )
286 imax = izamax( k-1, a( 1, k ), 1 )
287 colmax = cabs1( a( imax, k ) )
292 IF( (max( absakk, colmax ).EQ.zero) .OR. disnan(absakk) )
THEN
300 a( k, k ) = dble( a( k, k ) )
307 IF( absakk.GE.alpha*colmax )
THEN
318 jmax = imax + izamax( k-imax, a( imax, imax+1 ), lda )
319 rowmax = cabs1( a( imax, jmax ) )
321 jmax = izamax( imax-1, a( 1, imax ), 1 )
322 rowmax = max( rowmax, cabs1( a( jmax, imax ) ) )
325 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
331 ELSE IF( abs( dble( a( imax, imax ) ) ).GE.alpha*rowmax )
357 CALL zswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
358 DO 20 j = kp + 1, kk - 1
359 t = dconjg( a( j, kk ) )
360 a( j, kk ) = dconjg( a( kp, j ) )
363 a( kp, kk ) = dconjg( a( kp, kk ) )
364 r1 = dble( a( kk, kk ) )
365 a( kk, kk ) = dble( a( kp, kp ) )
367 IF( kstep.EQ.2 )
THEN
368 a( k, k ) = dble( a( k, k ) )
370 a( k-1, k ) = a( kp, k )
374 a( k, k ) = dble( a( k, k ) )
376 $ a( k-1, k-1 ) = dble( a( k-1, k-1 ) )
381 IF( kstep.EQ.1 )
THEN
393 r1 = one / dble( a( k, k ) )
394 CALL zher( uplo, k-1, -r1, a( 1, k ), 1, a, lda )
398 CALL zdscal( k-1, r1, a( 1, k ), 1 )
415 d = dlapy2( dble( a( k-1, k ) ),
416 $ dimag( a( k-1, k ) ) )
417 d22 = dble( a( k-1, k-1 ) ) / d
418 d11 = dble( a( k, k ) ) / d
419 tt = one / ( d11*d22-one )
420 d12 = a( k-1, k ) / d
423 DO 40 j = k - 2, 1, -1
424 wkm1 = d*( d11*a( j, k-1 )-dconjg( d12 )*
426 wk = d*( d22*a( j, k )-d12*a( j, k-1 ) )
428 a( i, j ) = a( i, j ) - a( i, k )*dconjg( wk ) -
429 $ a( i, k-1 )*dconjg( wkm1 )
433 a( j, j ) = dcmplx( dble( a( j, j ) ), 0.0d+0 )
443 IF( kstep.EQ.1 )
THEN
474 absakk = abs( dble( a( k, k ) ) )
481 imax = k + izamax( n-k, a( k+1, k ), 1 )
482 colmax = cabs1( a( imax, k ) )
487 IF( (max( absakk, colmax ).EQ.zero) .OR. disnan(absakk) )
THEN
495 a( k, k ) = dble( a( k, k ) )
502 IF( absakk.GE.alpha*colmax )
THEN
513 jmax = k - 1 + izamax( imax-k, a( imax, k ), lda )
514 rowmax = cabs1( a( imax, jmax ) )
516 jmax = imax + izamax( n-imax, a( imax+1, imax ), 1 )
517 rowmax = max( rowmax, cabs1( a( jmax, imax ) ) )
520 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
526 ELSE IF( abs( dble( a( imax, imax ) ) ).GE.alpha*rowmax )
553 $
CALL zswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
554 DO 60 j = kk + 1, kp - 1
555 t = dconjg( a( j, kk ) )
556 a( j, kk ) = dconjg( a( kp, j ) )
559 a( kp, kk ) = dconjg( a( kp, kk ) )
560 r1 = dble( a( kk, kk ) )
561 a( kk, kk ) = dble( a( kp, kp ) )
563 IF( kstep.EQ.2 )
THEN
564 a( k, k ) = dble( a( k, k ) )
566 a( k+1, k ) = a( kp, k )
570 a( k, k ) = dble( a( k, k ) )
572 $ a( k+1, k+1 ) = dble( a( k+1, k+1 ) )
577 IF( kstep.EQ.1 )
THEN
591 r1 = one / dble( a( k, k ) )
592 CALL zher( uplo, n-k, -r1, a( k+1, k ), 1,
593 $ a( k+1, k+1 ), lda )
597 CALL zdscal( n-k, r1, a( k+1, k ), 1 )
613 d = dlapy2( dble( a( k+1, k ) ),
614 $ dimag( a( k+1, k ) ) )
615 d11 = dble( a( k+1, k+1 ) ) / d
616 d22 = dble( a( k, k ) ) / d
617 tt = one / ( d11*d22-one )
618 d21 = a( k+1, k ) / d
622 wk = d*( d11*a( j, k )-d21*a( j, k+1 ) )
623 wkp1 = d*( d22*a( j, k+1 )-dconjg( d21 )*
626 a( i, j ) = a( i, j ) - a( i, k )*dconjg( wk ) -
627 $ a( i, k+1 )*dconjg( wkp1 )
631 a( j, j ) = dcmplx( dble( a( j, j ) ), 0.0d+0 )
639 IF( kstep.EQ.1 )
THEN
subroutine xerbla(srname, info)
subroutine zher(uplo, n, alpha, x, incx, a, lda)
ZHER
subroutine zhetf2(uplo, n, a, lda, ipiv, info)
ZHETF2 computes the factorization of a complex Hermitian matrix, using the diagonal pivoting method (...
subroutine zdscal(n, da, zx, incx)
ZDSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP