260 SUBROUTINE dlasyf_rk( UPLO, N, NB, KB, A, LDA, E, IPIV, W, LDW,
269 INTEGER INFO, KB, LDA, LDW, N, NB
273 DOUBLE PRECISION A( LDA, * ), E( * ), W( LDW, * )
279 DOUBLE PRECISION ZERO, ONE
280 parameter( zero = 0.0d+0, one = 1.0d+0 )
281 DOUBLE PRECISION EIGHT, SEVTEN
282 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
286 INTEGER IMAX, ITEMP, J, JB, JJ, JMAX, K, KK, KW, KKW,
288 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, D11, D12, D21, D22,
289 $ dtemp, r1, rowmax, t, sfmin
294 DOUBLE PRECISION DLAMCH
295 EXTERNAL lsame, idamax, dlamch
301 INTRINSIC abs, max, min, sqrt
309 alpha = ( one+sqrt( sevten ) ) / eight
313 sfmin = dlamch(
'S' )
315 IF( lsame( uplo,
'U' ) )
THEN
337 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
345 CALL dcopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
347 $
CALL dgemv(
'No transpose', k, n-k, -one, a( 1, k+1 ),
348 $ lda, w( k, kw+1 ), ldw, one, w( 1, kw ), 1 )
353 absakk = abs( w( k, kw ) )
360 imax = idamax( k-1, w( 1, kw ), 1 )
361 colmax = abs( w( imax, kw ) )
366 IF( max( absakk, colmax ).EQ.zero )
THEN
373 CALL dcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
389 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
408 CALL dcopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
409 CALL dcopy( k-imax, a( imax, imax+1 ), lda,
410 $ w( imax+1, kw-1 ), 1 )
413 $
CALL dgemv(
'No transpose', k, n-k, -one,
414 $ a( 1, k+1 ), lda, w( imax, kw+1 ), ldw,
415 $ one, w( 1, kw-1 ), 1 )
422 jmax = imax + idamax( k-imax, w( imax+1, kw-1 ),
424 rowmax = abs( w( jmax, kw-1 ) )
430 itemp = idamax( imax-1, w( 1, kw-1 ), 1 )
431 dtemp = abs( w( itemp, kw-1 ) )
432 IF( dtemp.GT.rowmax )
THEN
442 IF( .NOT.(abs( w( imax, kw-1 ) ).LT.alpha*rowmax ) )
452 CALL dcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
459 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
478 CALL dcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
484 IF( .NOT. done )
GOTO 12
496 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
500 CALL dcopy( k-p, a( p+1, k ), 1, a( p, p+1 ), lda )
501 CALL dcopy( p, a( 1, k ), 1, a( 1, p ), 1 )
506 CALL dswap( n-k+1, a( k, k ), lda, a( p, k ), lda )
507 CALL dswap( n-kk+1, w( k, kkw ), ldw, w( p, kkw ), ldw )
516 a( kp, k ) = a( kk, k )
517 CALL dcopy( k-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
519 CALL dcopy( kp, a( 1, kk ), 1, a( 1, kp ), 1 )
524 CALL dswap( n-kk+1, a( kk, kk ), lda, a( kp, kk ), lda )
525 CALL dswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
529 IF( kstep.EQ.1 )
THEN
539 CALL dcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
541 IF( abs( a( k, k ) ).GE.sfmin )
THEN
543 CALL dscal( k-1, r1, a( 1, k ), 1 )
544 ELSE IF( a( k, k ).NE.zero )
THEN
546 a( ii, k ) = a( ii, k ) / a( k, k )
571 d11 = w( k, kw ) / d12
572 d22 = w( k-1, kw-1 ) / d12
573 t = one / ( d11*d22-one )
575 a( j, k-1 ) = t*( (d11*w( j, kw-1 )-w( j, kw ) ) /
577 a( j, k ) = t*( ( d22*w( j, kw )-w( j, kw-1 ) ) /
586 a( k-1, k-1 ) = w( k-1, kw-1 )
588 a( k, k ) = w( k, kw )
589 e( k ) = w( k-1, kw )
600 IF( kstep.EQ.1 )
THEN
620 DO 50 j = ( ( k-1 ) / nb )*nb + 1, 1, -nb
621 jb = min( nb, k-j+1 )
625 DO 40 jj = j, j + jb - 1
626 CALL dgemv(
'No transpose', jj-j+1, n-k, -one,
627 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, one,
634 $
CALL dgemm(
'No transpose',
'Transpose', j-1, jb,
635 $ n-k, -one, a( 1, k+1 ), lda, w( j, kw+1 ),
636 $ ldw, one, a( 1, j ), lda )
660 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
668 CALL dcopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
670 $
CALL dgemv(
'No transpose', n-k+1, k-1, -one, a( k, 1 ),
671 $ lda, w( k, 1 ), ldw, one, w( k, k ), 1 )
676 absakk = abs( w( k, k ) )
683 imax = k + idamax( n-k, w( k+1, k ), 1 )
684 colmax = abs( w( imax, k ) )
689 IF( max( absakk, colmax ).EQ.zero )
THEN
696 CALL dcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
712 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
731 CALL dcopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1)
732 CALL dcopy( n-imax+1, a( imax, imax ), 1,
733 $ w( imax, k+1 ), 1 )
735 $
CALL dgemv(
'No transpose', n-k+1, k-1, -one,
736 $ a( k, 1 ), lda, w( imax, 1 ), ldw,
737 $ one, w( k, k+1 ), 1 )
744 jmax = k - 1 + idamax( imax-k, w( k, k+1 ), 1 )
745 rowmax = abs( w( jmax, k+1 ) )
751 itemp = imax + idamax( n-imax, w( imax+1, k+1 ), 1)
752 dtemp = abs( w( itemp, k+1 ) )
753 IF( dtemp.GT.rowmax )
THEN
763 IF( .NOT.( abs( w( imax, k+1 ) ).LT.alpha*rowmax ) )
773 CALL dcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
780 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
799 CALL dcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
805 IF( .NOT. done )
GOTO 72
813 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
817 CALL dcopy( p-k, a( k, k ), 1, a( p, k ), lda )
818 CALL dcopy( n-p+1, a( p, k ), 1, a( p, p ), 1 )
823 CALL dswap( k, a( k, 1 ), lda, a( p, 1 ), lda )
824 CALL dswap( kk, w( k, 1 ), ldw, w( p, 1 ), ldw )
833 a( kp, k ) = a( kk, k )
834 CALL dcopy( kp-k-1, a( k+1, kk ), 1, a( kp, k+1 ), lda )
835 CALL dcopy( n-kp+1, a( kp, kk ), 1, a( kp, kp ), 1 )
839 CALL dswap( kk, a( kk, 1 ), lda, a( kp, 1 ), lda )
840 CALL dswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
843 IF( kstep.EQ.1 )
THEN
853 CALL dcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
855 IF( abs( a( k, k ) ).GE.sfmin )
THEN
857 CALL dscal( n-k, r1, a( k+1, k ), 1 )
858 ELSE IF( a( k, k ).NE.zero )
THEN
860 a( ii, k ) = a( ii, k ) / a( k, k )
884 d11 = w( k+1, k+1 ) / d21
885 d22 = w( k, k ) / d21
886 t = one / ( d11*d22-one )
888 a( j, k ) = t*( ( d11*w( j, k )-w( j, k+1 ) ) /
890 a( j, k+1 ) = t*( ( d22*w( j, k+1 )-w( j, k ) ) /
899 a( k, k ) = w( k, k )
901 a( k+1, k+1 ) = w( k+1, k+1 )
913 IF( kstep.EQ.1 )
THEN
934 jb = min( nb, n-j+1 )
938 DO 100 jj = j, j + jb - 1
939 CALL dgemv(
'No transpose', j+jb-jj, k-1, -one,
940 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, one,
947 $
CALL dgemm(
'No transpose',
'Transpose', n-j-jb+1, jb,
948 $ k-1, -one, a( j+jb, 1 ), lda, w( j, 1 ),
949 $ ldw, one, a( j+jb, j ), lda )
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
DGEMV
subroutine dlasyf_rk(uplo, n, nb, kb, a, lda, e, ipiv, w, ldw, info)
DLASYF_RK computes a partial factorization of a real symmetric indefinite matrix using bounded Bunch-...
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dswap(n, dx, incx, dy, incy)
DSWAP