191 INTEGER INFO, KB, LDA, LDW, N, NB
195 DOUBLE PRECISION A( LDA, * ), W( LDW, * )
201 DOUBLE PRECISION ZERO, ONE
202 parameter( zero = 0.0d+0, one = 1.0d+0 )
203 DOUBLE PRECISION EIGHT, SEVTEN
204 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
208 INTEGER IMAX, ITEMP, J, JB, JJ, JMAX, JP1, JP2, K, KK,
209 $ kw, kkw, kp, kstep, p, ii
211 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, D11, D12, D21, D22,
212 $ dtemp, r1, rowmax, t, sfmin
217 DOUBLE PRECISION DLAMCH
218 EXTERNAL lsame, idamax, dlamch
224 INTRINSIC abs, max, min, sqrt
232 alpha = ( one+sqrt( sevten ) ) / eight
236 sfmin = dlamch(
'S' )
238 IF( lsame( uplo,
'U' ) )
THEN
255 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
263 CALL dcopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
265 $
CALL dgemv(
'No transpose', k, n-k, -one, a( 1, k+1 ),
266 $ lda, w( k, kw+1 ), ldw, one, w( 1, kw ), 1 )
271 absakk = abs( w( k, kw ) )
278 imax = idamax( k-1, w( 1, kw ), 1 )
279 colmax = abs( w( imax, kw ) )
284 IF( max( absakk, colmax ).EQ.zero )
THEN
291 CALL dcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
301 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
320 CALL dcopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
321 CALL dcopy( k-imax, a( imax, imax+1 ), lda,
322 $ w( imax+1, kw-1 ), 1 )
325 $
CALL dgemv(
'No transpose', k, n-k, -one,
326 $ a( 1, k+1 ), lda, w( imax, kw+1 ), ldw,
327 $ one, w( 1, kw-1 ), 1 )
334 jmax = imax + idamax( k-imax, w( imax+1, kw-1 ),
336 rowmax = abs( w( jmax, kw-1 ) )
342 itemp = idamax( imax-1, w( 1, kw-1 ), 1 )
343 dtemp = abs( w( itemp, kw-1 ) )
344 IF( dtemp.GT.rowmax )
THEN
354 IF( .NOT.(abs( w( imax, kw-1 ) ).LT.alpha*rowmax ) )
364 CALL dcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
371 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
390 CALL dcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
396 IF( .NOT. done )
GOTO 12
408 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
412 CALL dcopy( k-p, a( p+1, k ), 1, a( p, p+1 ), lda )
413 CALL dcopy( p, a( 1, k ), 1, a( 1, p ), 1 )
418 CALL dswap( n-k+1, a( k, k ), lda, a( p, k ), lda )
419 CALL dswap( n-kk+1, w( k, kkw ), ldw, w( p, kkw ), ldw )
428 a( kp, k ) = a( kk, k )
429 CALL dcopy( k-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
431 CALL dcopy( kp, a( 1, kk ), 1, a( 1, kp ), 1 )
436 CALL dswap( n-kk+1, a( kk, kk ), lda, a( kp, kk ), lda )
437 CALL dswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
441 IF( kstep.EQ.1 )
THEN
451 CALL dcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
453 IF( abs( a( k, k ) ).GE.sfmin )
THEN
455 CALL dscal( k-1, r1, a( 1, k ), 1 )
456 ELSE IF( a( k, k ).NE.zero )
THEN
458 a( ii, k ) = a( ii, k ) / a( k, k )
478 d11 = w( k, kw ) / d12
479 d22 = w( k-1, kw-1 ) / d12
480 t = one / ( d11*d22-one )
482 a( j, k-1 ) = t*( (d11*w( j, kw-1 )-w( j, kw ) ) /
484 a( j, k ) = t*( ( d22*w( j, kw )-w( j, kw-1 ) ) /
491 a( k-1, k-1 ) = w( k-1, kw-1 )
492 a( k-1, k ) = w( k-1, kw )
493 a( k, k ) = w( k, kw )
499 IF( kstep.EQ.1 )
THEN
519 DO 50 j = ( ( k-1 ) / nb )*nb + 1, 1, -nb
520 jb = min( nb, k-j+1 )
524 DO 40 jj = j, j + jb - 1
525 CALL dgemv(
'No transpose', jj-j+1, n-k, -one,
526 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, one,
533 $
CALL dgemm(
'No transpose',
'Transpose', j-1, jb,
534 $ n-k, -one, a( 1, k+1 ), lda, w( j, kw+1 ), ldw,
535 $ one, a( 1, j ), lda )
556 IF( jp2.NE.jj .AND. j.LE.n )
557 $
CALL dswap( n-j+1, a( jp2, j ), lda, a( jj, j ), lda )
559 IF( jp1.NE.jj .AND. kstep.EQ.2 )
560 $
CALL dswap( n-j+1, a( jp1, j ), lda, a( jj, j ), lda )
581 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
589 CALL dcopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
591 $
CALL dgemv(
'No transpose', n-k+1, k-1, -one, a( k, 1 ),
592 $ lda, w( k, 1 ), ldw, one, w( k, k ), 1 )
597 absakk = abs( w( k, k ) )
604 imax = k + idamax( n-k, w( k+1, k ), 1 )
605 colmax = abs( w( imax, k ) )
610 IF( max( absakk, colmax ).EQ.zero )
THEN
617 CALL dcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
627 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
646 CALL dcopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1)
647 CALL dcopy( n-imax+1, a( imax, imax ), 1,
648 $ w( imax, k+1 ), 1 )
650 $
CALL dgemv(
'No transpose', n-k+1, k-1, -one,
651 $ a( k, 1 ), lda, w( imax, 1 ), ldw,
652 $ one, w( k, k+1 ), 1 )
659 jmax = k - 1 + idamax( imax-k, w( k, k+1 ), 1 )
660 rowmax = abs( w( jmax, k+1 ) )
666 itemp = imax + idamax( n-imax, w( imax+1, k+1 ), 1)
667 dtemp = abs( w( itemp, k+1 ) )
668 IF( dtemp.GT.rowmax )
THEN
678 IF( .NOT.( abs( w( imax, k+1 ) ).LT.alpha*rowmax ) )
688 CALL dcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
695 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
714 CALL dcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
720 IF( .NOT. done )
GOTO 72
728 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
732 CALL dcopy( p-k, a( k, k ), 1, a( p, k ), lda )
733 CALL dcopy( n-p+1, a( p, k ), 1, a( p, p ), 1 )
738 CALL dswap( k, a( k, 1 ), lda, a( p, 1 ), lda )
739 CALL dswap( kk, w( k, 1 ), ldw, w( p, 1 ), ldw )
748 a( kp, k ) = a( kk, k )
749 CALL dcopy( kp-k-1, a( k+1, kk ), 1, a( kp, k+1 ), lda )
750 CALL dcopy( n-kp+1, a( kp, kk ), 1, a( kp, kp ), 1 )
754 CALL dswap( kk, a( kk, 1 ), lda, a( kp, 1 ), lda )
755 CALL dswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
758 IF( kstep.EQ.1 )
THEN
768 CALL dcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
770 IF( abs( a( k, k ) ).GE.sfmin )
THEN
772 CALL dscal( n-k, r1, a( k+1, k ), 1 )
773 ELSE IF( a( k, k ).NE.zero )
THEN
775 a( ii, k ) = a( ii, k ) / a( k, k )
794 d11 = w( k+1, k+1 ) / d21
795 d22 = w( k, k ) / d21
796 t = one / ( d11*d22-one )
798 a( j, k ) = t*( ( d11*w( j, k )-w( j, k+1 ) ) /
800 a( j, k+1 ) = t*( ( d22*w( j, k+1 )-w( j, k ) ) /
807 a( k, k ) = w( k, k )
808 a( k+1, k ) = w( k+1, k )
809 a( k+1, k+1 ) = w( k+1, k+1 )
815 IF( kstep.EQ.1 )
THEN
836 jb = min( nb, n-j+1 )
840 DO 100 jj = j, j + jb - 1
841 CALL dgemv(
'No transpose', j+jb-jj, k-1, -one,
842 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, one,
849 $
CALL dgemm(
'No transpose',
'Transpose', n-j-jb+1, jb,
850 $ k-1, -one, a( j+jb, 1 ), lda, w( j, 1 ), ldw,
851 $ one, a( j+jb, j ), lda )
872 IF( jp2.NE.jj .AND. j.GE.1 )
873 $
CALL dswap( j, a( jp2, 1 ), lda, a( jj, 1 ), lda )
875 IF( jp1.NE.jj .AND. kstep.EQ.2 )
876 $
CALL dswap( j, a( jp1, 1 ), lda, a( jj, 1 ), 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_rook(uplo, n, nb, kb, a, lda, ipiv, w, ldw, info)
DLASYF_ROOK *> DLASYF_ROOK computes a partial factorization of a real symmetric matrix using the boun...
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dswap(n, dx, incx, dy, incy)
DSWAP