191 INTEGER INFO, KB, LDA, LDW, N, NB
195 REAL A( LDA, * ), W( LDW, * )
202 parameter( zero = 0.0e+0, one = 1.0e+0 )
204 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
208 INTEGER IMAX, ITEMP, J, JB, JJ, JMAX, JP1, JP2, K, KK,
209 $ kw, kkw, kp, kstep, p, ii
211 REAL ABSAKK, ALPHA, COLMAX, D11, D12, D21, D22,
212 $ stemp, r1, rowmax, t, sfmin
218 EXTERNAL lsame, isamax, slamch
224 INTRINSIC abs, max, min, sqrt
232 alpha = ( one+sqrt( sevten ) ) / eight
236 sfmin = slamch(
'S' )
238 IF( lsame( uplo,
'U' ) )
THEN
255 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
263 CALL scopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
265 $
CALL sgemv(
'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 = isamax( k-1, w( 1, kw ), 1 )
279 colmax = abs( w( imax, kw ) )
284 IF( max( absakk, colmax ).EQ.zero )
THEN
291 CALL scopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
301 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
320 CALL scopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
321 CALL scopy( k-imax, a( imax, imax+1 ), lda,
322 $ w( imax+1, kw-1 ), 1 )
325 $
CALL sgemv(
'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 + isamax( k-imax, w( imax+1, kw-1 ),
336 rowmax = abs( w( jmax, kw-1 ) )
342 itemp = isamax( imax-1, w( 1, kw-1 ), 1 )
343 stemp = abs( w( itemp, kw-1 ) )
344 IF( stemp.GT.rowmax )
THEN
354 IF( .NOT.(abs( w( imax, kw-1 ) ).LT.alpha*rowmax ) )
364 CALL scopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
371 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
390 CALL scopy( 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 scopy( k-p, a( p+1, k ), 1, a( p, p+1 ), lda )
413 CALL scopy( p, a( 1, k ), 1, a( 1, p ), 1 )
418 CALL sswap( n-k+1, a( k, k ), lda, a( p, k ), lda )
419 CALL sswap( n-kk+1, w( k, kkw ), ldw, w( p, kkw ), ldw )
428 a( kp, k ) = a( kk, k )
429 CALL scopy( k-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
431 CALL scopy( kp, a( 1, kk ), 1, a( 1, kp ), 1 )
436 CALL sswap( n-kk+1, a( kk, kk ), lda, a( kp, kk ), lda )
437 CALL sswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
441 IF( kstep.EQ.1 )
THEN
451 CALL scopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
453 IF( abs( a( k, k ) ).GE.sfmin )
THEN
455 CALL sscal( 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 sgemv(
'No transpose', jj-j+1, n-k, -one,
526 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, one,
533 $
CALL sgemm(
'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 sswap( n-j+1, a( jp2, j ), lda, a( jj, j ), lda )
559 IF( jp1.NE.jj .AND. kstep.EQ.2 )
560 $
CALL sswap( 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 scopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
591 $
CALL sgemv(
'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 + isamax( n-k, w( k+1, k ), 1 )
605 colmax = abs( w( imax, k ) )
610 IF( max( absakk, colmax ).EQ.zero )
THEN
617 CALL scopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
627 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
646 CALL scopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1)
647 CALL scopy( n-imax+1, a( imax, imax ), 1,
648 $ w( imax, k+1 ), 1 )
650 $
CALL sgemv(
'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 + isamax( imax-k, w( k, k+1 ), 1 )
660 rowmax = abs( w( jmax, k+1 ) )
666 itemp = imax + isamax( n-imax, w( imax+1, k+1 ), 1)
667 stemp = abs( w( itemp, k+1 ) )
668 IF( stemp.GT.rowmax )
THEN
678 IF( .NOT.( abs( w( imax, k+1 ) ).LT.alpha*rowmax ) )
688 CALL scopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
695 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
714 CALL scopy( 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 scopy( p-k, a( k, k ), 1, a( p, k ), lda )
733 CALL scopy( n-p+1, a( p, k ), 1, a( p, p ), 1 )
738 CALL sswap( k, a( k, 1 ), lda, a( p, 1 ), lda )
739 CALL sswap( kk, w( k, 1 ), ldw, w( p, 1 ), ldw )
748 a( kp, k ) = a( kk, k )
749 CALL scopy( kp-k-1, a( k+1, kk ), 1, a( kp, k+1 ), lda )
750 CALL scopy( n-kp+1, a( kp, kk ), 1, a( kp, kp ), 1 )
754 CALL sswap( kk, a( kk, 1 ), lda, a( kp, 1 ), lda )
755 CALL sswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
758 IF( kstep.EQ.1 )
THEN
768 CALL scopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
770 IF( abs( a( k, k ) ).GE.sfmin )
THEN
772 CALL sscal( 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 sgemv(
'No transpose', j+jb-jj, k-1, -one,
842 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, one,
849 $
CALL sgemm(
'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 sswap( j, a( jp2, 1 ), lda, a( jj, 1 ), lda )
875 IF( jp1.NE.jj .AND. kstep.EQ.2 )
876 $
CALL sswap( j, a( jp1, 1 ), lda, a( jj, 1 ), lda )
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine sgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
SGEMV
subroutine slasyf_rook(uplo, n, nb, kb, a, lda, ipiv, w, ldw, info)
SLASYF_ROOK computes a partial factorization of a real symmetric matrix using the bounded Bunch-Kaufm...
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sswap(n, sx, incx, sy, incy)
SSWAP