174 SUBROUTINE zlasyf( UPLO, N, NB, KB, A, LDA, IPIV, W, LDW,
183 INTEGER INFO, KB, LDA, LDW, N, NB
187 COMPLEX*16 A( LDA, * ), W( LDW, * )
193 DOUBLE PRECISION ZERO, ONE
194 parameter( zero = 0.0d+0, one = 1.0d+0 )
195 DOUBLE PRECISION EIGHT, SEVTEN
196 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
198 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
201 INTEGER IMAX, J, JJ, JMAX, JP, K, KK, KKW, KP,
203 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, ROWMAX
204 COMPLEX*16 D11, D21, D22, R1, T, Z
209 EXTERNAL lsame, izamax
215 INTRINSIC abs, dble, dimag, max, min, sqrt
218 DOUBLE PRECISION CABS1
221 cabs1( z ) = abs( dble( z ) ) + abs( dimag( z ) )
229 alpha = ( one+sqrt( sevten ) ) / eight
231 IF( lsame( uplo,
'U' ) )
THEN
247 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
252 CALL zcopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
254 $
CALL zgemv(
'No transpose', k, n-k, -cone, a( 1, k+1 ),
256 $ w( k, kw+1 ), ldw, cone, w( 1, kw ), 1 )
263 absakk = cabs1( w( k, kw ) )
269 imax = izamax( k-1, w( 1, kw ), 1 )
270 colmax = cabs1( w( imax, kw ) )
275 IF( max( absakk, colmax ).EQ.zero )
THEN
283 IF( absakk.GE.alpha*colmax )
THEN
292 CALL zcopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
293 CALL zcopy( k-imax, a( imax, imax+1 ), lda,
294 $ w( imax+1, kw-1 ), 1 )
296 $
CALL zgemv(
'No transpose', k, n-k, -cone,
297 $ a( 1, k+1 ), lda, w( imax, kw+1 ), ldw,
298 $ cone, w( 1, kw-1 ), 1 )
303 jmax = imax + izamax( k-imax, w( imax+1, kw-1 ), 1 )
304 rowmax = cabs1( w( jmax, kw-1 ) )
306 jmax = izamax( imax-1, w( 1, kw-1 ), 1 )
307 rowmax = max( rowmax, cabs1( w( jmax, kw-1 ) ) )
310 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
315 ELSE IF( cabs1( w( imax, kw-1 ) ).GE.alpha*rowmax )
THEN
324 CALL zcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
355 a( kp, kp ) = a( kk, kk )
356 CALL zcopy( kk-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
359 $
CALL zcopy( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
367 $
CALL zswap( n-k, a( kk, k+1 ), lda, a( kp, k+1 ),
369 CALL zswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
373 IF( kstep.EQ.1 )
THEN
388 CALL zcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
389 r1 = cone / a( k, k )
390 CALL zscal( k-1, r1, a( 1, k ), 1 )
437 d11 = w( k, kw ) / d21
438 d22 = w( k-1, kw-1 ) / d21
439 t = cone / ( d11*d22-cone )
447 a( j, k-1 ) = d21*( d11*w( j, kw-1 )-w( j, kw ) )
448 a( j, k ) = d21*( d22*w( j, kw )-w( j, kw-1 ) )
454 a( k-1, k-1 ) = w( k-1, kw-1 )
455 a( k-1, k ) = w( k-1, kw )
456 a( k, k ) = w( k, kw )
464 IF( kstep.EQ.1 )
THEN
482 CALL zgemmtr(
'Upper',
'No transpose',
'Transpose', k, n-k,
483 $ -cone, a( 1, k+1 ), lda, w( 1, kw+1 ), ldw,
484 $ cone, a( 1, 1 ), lda )
506 IF( jp.NE.jj .AND. j.LE.n )
507 $
CALL zswap( n-j+1, a( jp, j ), lda, a( jj, j ), lda )
528 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
533 CALL zcopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
534 CALL zgemv(
'No transpose', n-k+1, k-1, -cone, a( k, 1 ),
536 $ w( k, 1 ), ldw, cone, w( k, k ), 1 )
543 absakk = cabs1( w( k, k ) )
549 imax = k + izamax( n-k, w( k+1, k ), 1 )
550 colmax = cabs1( w( imax, k ) )
555 IF( max( absakk, colmax ).EQ.zero )
THEN
563 IF( absakk.GE.alpha*colmax )
THEN
572 CALL zcopy( imax-k, a( imax, k ), lda, w( k, k+1 ),
574 CALL zcopy( n-imax+1, a( imax, imax ), 1, w( imax,
577 CALL zgemv(
'No transpose', n-k+1, k-1, -cone, a( k,
579 $ lda, w( imax, 1 ), ldw, cone, w( k, k+1 ),
585 jmax = k - 1 + izamax( imax-k, w( k, k+1 ), 1 )
586 rowmax = cabs1( w( jmax, k+1 ) )
588 jmax = imax + izamax( n-imax, w( imax+1, k+1 ), 1 )
589 rowmax = max( rowmax, cabs1( w( jmax, k+1 ) ) )
592 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
597 ELSE IF( cabs1( w( imax, k+1 ) ).GE.alpha*rowmax )
THEN
606 CALL zcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
633 a( kp, kp ) = a( kk, kk )
634 CALL zcopy( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
637 $
CALL zcopy( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ),
646 $
CALL zswap( k-1, a( kk, 1 ), lda, a( kp, 1 ), lda )
647 CALL zswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
650 IF( kstep.EQ.1 )
THEN
665 CALL zcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
667 r1 = cone / a( k, k )
668 CALL zscal( n-k, r1, a( k+1, k ), 1 )
716 d11 = w( k+1, k+1 ) / d21
717 d22 = w( k, k ) / d21
718 t = cone / ( d11*d22-cone )
726 a( j, k ) = d21*( d11*w( j, k )-w( j, k+1 ) )
727 a( j, k+1 ) = d21*( d22*w( j, k+1 )-w( j, k ) )
733 a( k, k ) = w( k, k )
734 a( k+1, k ) = w( k+1, k )
735 a( k+1, k+1 ) = w( k+1, k+1 )
743 IF( kstep.EQ.1 )
THEN
761 CALL zgemmtr(
'Lower',
'No transpose',
'Transpose', n-k+1,
762 $ k-1, -cone, a( k, 1 ), lda, w( k, 1 ), ldw,
763 $ cone, a( k, k ), lda )
785 IF( jp.NE.jj .AND. j.GE.1 )
786 $
CALL zswap( j, a( jp, 1 ), lda, a( jj, 1 ), lda )