175 SUBROUTINE slasyf( UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO )
183 INTEGER INFO, KB, LDA, LDW, N, NB
187 REAL A( LDA, * ), W( LDW, * )
194 parameter( zero = 0.0e+0, one = 1.0e+0 )
196 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
199 INTEGER IMAX, J, JB, JJ, JMAX, JP, K, KK, KKW, KP,
201 REAL ABSAKK, ALPHA, COLMAX, D11, D21, D22, R1,
207 EXTERNAL lsame, isamax
213 INTRINSIC abs, max, min, sqrt
221 alpha = ( one+sqrt( sevten ) ) / eight
223 IF( lsame( uplo,
'U' ) )
THEN
239 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
244 CALL scopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
246 $
CALL sgemv(
'No transpose', k, n-k, -one, a( 1, k+1 ), lda,
247 $ w( k, kw+1 ), ldw, one, w( 1, kw ), 1 )
254 absakk = abs( w( k, kw ) )
261 imax = isamax( k-1, w( 1, kw ), 1 )
262 colmax = abs( w( imax, kw ) )
267 IF( max( absakk, colmax ).EQ.zero )
THEN
275 IF( absakk.GE.alpha*colmax )
THEN
284 CALL scopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
285 CALL scopy( k-imax, a( imax, imax+1 ), lda,
286 $ w( imax+1, kw-1 ), 1 )
288 $
CALL sgemv(
'No transpose', k, n-k, -one, a( 1, k+1 ),
289 $ lda, w( imax, kw+1 ), ldw, one,
295 jmax = imax + isamax( k-imax, w( imax+1, kw-1 ), 1 )
296 rowmax = abs( w( jmax, kw-1 ) )
298 jmax = isamax( imax-1, w( 1, kw-1 ), 1 )
299 rowmax = max( rowmax, abs( w( jmax, kw-1 ) ) )
302 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
307 ELSE IF( abs( w( imax, kw-1 ) ).GE.alpha*rowmax )
THEN
316 CALL scopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
347 a( kp, kp ) = a( kk, kk )
348 CALL scopy( kk-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
351 $
CALL scopy( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
359 $
CALL sswap( n-k, a( kk, k+1 ), lda, a( kp, k+1 ),
361 CALL sswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
365 IF( kstep.EQ.1 )
THEN
380 CALL scopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
382 CALL sscal( k-1, r1, a( 1, k ), 1 )
429 d11 = w( k, kw ) / d21
430 d22 = w( k-1, kw-1 ) / d21
431 t = one / ( d11*d22-one )
439 a( j, k-1 ) = d21*( d11*w( j, kw-1 )-w( j, kw ) )
440 a( j, k ) = d21*( d22*w( j, kw )-w( j, kw-1 ) )
446 a( k-1, k-1 ) = w( k-1, kw-1 )
447 a( k-1, k ) = w( k-1, kw )
448 a( k, k ) = w( k, kw )
456 IF( kstep.EQ.1 )
THEN
476 DO 50 j = ( ( k-1 ) / nb )*nb + 1, 1, -nb
477 jb = min( nb, k-j+1 )
481 DO 40 jj = j, j + jb - 1
482 CALL sgemv(
'No transpose', jj-j+1, n-k, -one,
483 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, one,
489 CALL sgemm(
'No transpose',
'Transpose', j-1, jb, n-k, -one,
490 $ a( 1, k+1 ), lda, w( j, kw+1 ), ldw, one,
514 IF( jp.NE.jj .AND. j.LE.n )
515 $
CALL sswap( n-j+1, a( jp, j ), lda, a( jj, j ), lda )
536 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
541 CALL scopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
542 CALL sgemv(
'No transpose', n-k+1, k-1, -one, a( k, 1 ), lda,
543 $ w( k, 1 ), ldw, one, w( k, k ), 1 )
550 absakk = abs( w( k, k ) )
557 imax = k + isamax( n-k, w( k+1, k ), 1 )
558 colmax = abs( w( imax, k ) )
563 IF( max( absakk, colmax ).EQ.zero )
THEN
571 IF( absakk.GE.alpha*colmax )
THEN
580 CALL scopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1 )
581 CALL scopy( n-imax+1, a( imax, imax ), 1, w( imax, k+1 ),
583 CALL sgemv(
'No transpose', n-k+1, k-1, -one, a( k, 1 ),
584 $ lda, w( imax, 1 ), ldw, one, w( k, k+1 ), 1 )
589 jmax = k - 1 + isamax( imax-k, w( k, k+1 ), 1 )
590 rowmax = abs( w( jmax, k+1 ) )
592 jmax = imax + isamax( n-imax, w( imax+1, k+1 ), 1 )
593 rowmax = max( rowmax, abs( w( jmax, k+1 ) ) )
596 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
601 ELSE IF( abs( w( imax, k+1 ) ).GE.alpha*rowmax )
THEN
610 CALL scopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
637 a( kp, kp ) = a( kk, kk )
638 CALL scopy( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
641 $
CALL scopy( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
649 $
CALL sswap( k-1, a( kk, 1 ), lda, a( kp, 1 ), lda )
650 CALL sswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
653 IF( kstep.EQ.1 )
THEN
668 CALL scopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
671 CALL sscal( n-k, r1, a( k+1, k ), 1 )
719 d11 = w( k+1, k+1 ) / d21
720 d22 = w( k, k ) / d21
721 t = one / ( d11*d22-one )
729 a( j, k ) = d21*( d11*w( j, k )-w( j, k+1 ) )
730 a( j, k+1 ) = d21*( d22*w( j, k+1 )-w( j, k ) )
736 a( k, k ) = w( k, k )
737 a( k+1, k ) = w( k+1, k )
738 a( k+1, k+1 ) = w( k+1, k+1 )
746 IF( kstep.EQ.1 )
THEN
767 jb = min( nb, n-j+1 )
771 DO 100 jj = j, j + jb - 1
772 CALL sgemv(
'No transpose', j+jb-jj, k-1, -one,
773 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, one,
780 $
CALL sgemm(
'No transpose',
'Transpose', n-j-jb+1, jb,
781 $ k-1, -one, a( j+jb, 1 ), lda, w( j, 1 ), ldw,
782 $ one, a( j+jb, j ), lda )
805 IF( jp.NE.jj .AND. j.GE.1 )
806 $
CALL sswap( j, a( jp, 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(uplo, n, nb, kb, a, lda, ipiv, w, ldw, info)
SLASYF computes a partial factorization of a real symmetric matrix using the Bunch-Kaufman diagonal p...
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sswap(n, sx, incx, sy, incy)
SSWAP