158 SUBROUTINE zlasyf( UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO )
167 INTEGER info, kb, lda, ldw, n, nb
171 COMPLEX*16 a( lda, * ), w( ldw, * )
177 DOUBLE PRECISION zero, one
178 parameter( zero = 0.0d+0, one = 1.0d+0 )
179 DOUBLE PRECISION eight, sevten
180 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
182 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
185 INTEGER imax, j, jb, jj, jmax, jp, k, kk, kkw, kp,
187 DOUBLE PRECISION absakk, alpha, colmax, rowmax
188 COMPLEX*16 d11, d21, d22, r1, t, z
199 INTRINSIC abs, dble, dimag, max, min, sqrt
202 DOUBLE PRECISION cabs1
205 cabs1( z ) = abs( dble( z ) ) + abs( dimag( z ) )
213 alpha = ( one+sqrt( sevten ) ) / eight
215 IF(
lsame( uplo,
'U' ) )
THEN
231 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
236 CALL
zcopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
238 $ CALL
zgemv(
'No transpose', k, n-k, -cone, a( 1, k+1 ), lda,
239 $ w( k, kw+1 ), ldw, cone, w( 1, kw ), 1 )
246 absakk = cabs1( w( k, kw ) )
252 imax =
izamax( k-1, w( 1, kw ), 1 )
253 colmax = cabs1( w( imax, kw ) )
258 IF( max( absakk, colmax ).EQ.zero )
THEN
266 IF( absakk.GE.alpha*colmax )
THEN
275 CALL
zcopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
276 CALL
zcopy( k-imax, a( imax, imax+1 ), lda,
277 $ w( imax+1, kw-1 ), 1 )
279 $ CALL
zgemv(
'No transpose', k, n-k, -cone,
280 $ a( 1, k+1 ), lda, w( imax, kw+1 ), ldw,
281 $ cone, w( 1, kw-1 ), 1 )
286 jmax = imax +
izamax( k-imax, w( imax+1, kw-1 ), 1 )
287 rowmax = cabs1( w( jmax, kw-1 ) )
289 jmax =
izamax( imax-1, w( 1, kw-1 ), 1 )
290 rowmax = max( rowmax, cabs1( w( jmax, kw-1 ) ) )
293 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
298 ELSE IF( cabs1( w( imax, kw-1 ) ).GE.alpha*rowmax )
THEN
307 CALL
zcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
327 a( kp, k ) = a( kk, k )
328 CALL
zcopy( k-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
330 CALL
zcopy( kp, a( 1, kk ), 1, a( 1, kp ), 1 )
334 CALL
zswap( n-kk+1, a( kk, kk ), lda, a( kp, kk ), lda )
335 CALL
zswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
339 IF( kstep.EQ.1 )
THEN
349 CALL
zcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
350 r1 = cone / a( k, k )
351 CALL
zscal( k-1, r1, a( 1, k ), 1 )
367 d11 = w( k, kw ) / d21
368 d22 = w( k-1, kw-1 ) / d21
369 t = cone / ( d11*d22-cone )
372 a( j, k-1 ) = d21*( d11*w( j, kw-1 )-w( j, kw ) )
373 a( j, k ) = d21*( d22*w( j, kw )-w( j, kw-1 ) )
379 a( k-1, k-1 ) = w( k-1, kw-1 )
380 a( k-1, k ) = w( k-1, kw )
381 a( k, k ) = w( k, kw )
387 IF( kstep.EQ.1 )
THEN
407 DO 50 j = ( ( k-1 ) / nb )*nb + 1, 1, -nb
408 jb = min( nb, k-j+1 )
412 DO 40 jj = j, j + jb - 1
413 CALL
zgemv(
'No transpose', jj-j+1, n-k, -cone,
414 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, cone,
420 CALL
zgemm(
'No transpose',
'Transpose', j-1, jb, n-k,
421 $ -cone, a( 1, k+1 ), lda, w( j, kw+1 ), ldw,
422 $ cone, a( 1, j ), lda )
437 IF( jp.NE.jj .AND. j.LE.n )
438 $ CALL
zswap( n-j+1, a( jp, j ), lda, a( jj, j ), lda )
459 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
464 CALL
zcopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
465 CALL
zgemv(
'No transpose', n-k+1, k-1, -cone, a( k, 1 ), lda,
466 $ w( k, 1 ), ldw, cone, w( k, k ), 1 )
473 absakk = cabs1( w( k, k ) )
479 imax = k +
izamax( n-k, w( k+1, k ), 1 )
480 colmax = cabs1( w( imax, k ) )
485 IF( max( absakk, colmax ).EQ.zero )
THEN
493 IF( absakk.GE.alpha*colmax )
THEN
502 CALL
zcopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1 )
503 CALL
zcopy( n-imax+1, a( imax, imax ), 1, w( imax, k+1 ),
505 CALL
zgemv(
'No transpose', n-k+1, k-1, -cone, a( k, 1 ),
506 $ lda, w( imax, 1 ), ldw, cone, w( k, k+1 ),
512 jmax = k - 1 +
izamax( imax-k, w( k, k+1 ), 1 )
513 rowmax = cabs1( w( jmax, k+1 ) )
515 jmax = imax +
izamax( n-imax, w( imax+1, k+1 ), 1 )
516 rowmax = max( rowmax, cabs1( w( jmax, k+1 ) ) )
519 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
524 ELSE IF( cabs1( w( imax, k+1 ) ).GE.alpha*rowmax )
THEN
533 CALL
zcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
552 a( kp, k ) = a( kk, k )
553 CALL
zcopy( kp-k-1, a( k+1, kk ), 1, a( kp, k+1 ), lda )
554 CALL
zcopy( n-kp+1, a( kp, kk ), 1, a( kp, kp ), 1 )
558 CALL
zswap( kk, a( kk, 1 ), lda, a( kp, 1 ), lda )
559 CALL
zswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
562 IF( kstep.EQ.1 )
THEN
572 CALL
zcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
574 r1 = cone / a( k, k )
575 CALL
zscal( n-k, r1, a( k+1, k ), 1 )
591 d11 = w( k+1, k+1 ) / d21
592 d22 = w( k, k ) / d21
593 t = cone / ( d11*d22-cone )
596 a( j, k ) = d21*( d11*w( j, k )-w( j, k+1 ) )
597 a( j, k+1 ) = d21*( d22*w( j, k+1 )-w( j, k ) )
603 a( k, k ) = w( k, k )
604 a( k+1, k ) = w( k+1, k )
605 a( k+1, k+1 ) = w( k+1, k+1 )
611 IF( kstep.EQ.1 )
THEN
632 jb = min( nb, n-j+1 )
636 DO 100 jj = j, j + jb - 1
637 CALL
zgemv(
'No transpose', j+jb-jj, k-1, -cone,
638 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, cone,
645 $ CALL
zgemm(
'No transpose',
'Transpose', n-j-jb+1, jb,
646 $ k-1, -cone, a( j+jb, 1 ), lda, w( j, 1 ),
647 $ ldw, cone, a( j+jb, j ), lda )
662 IF( jp.NE.jj .AND. j.GE.1 )
663 $ CALL
zswap( j, a( jp, 1 ), lda, a( jj, 1 ), lda )