151 INTEGER M, NB, J1, LDA, LDH
155 COMPLEX*16 A( LDA, * ), H( LDH, * ), WORK( * )
161 parameter( zero = 0.0d+0, one = 1.0d+0 )
164 INTEGER J, K, K1, I1, I2, MJ
165 COMPLEX*16 PIV, ALPHA
169 INTEGER IZAMAX, ILAENV
170 EXTERNAL lsame, ilaenv, izamax
189 IF( lsame( uplo,
'U' ) )
THEN
196 IF ( j.GT.min(m, nb) )
225 CALL zgemv(
'No transpose', mj, j-k1,
226 $ -one, h( j, k1 ), ldh,
228 $ one, h( j, j ), 1 )
233 CALL zcopy( mj, h( j, j ), 1, work( 1 ), 1 )
241 CALL zaxpy( mj, alpha, a( k-2, j ), lda, work( 1 ), 1 )
246 a( k, j ) = work( 1 )
255 CALL zaxpy( m-j, alpha, a( k-1, j+1 ), lda,
261 i2 = izamax( m-j, work( 2 ), 1 ) + 1
266 IF( (i2.NE.2) .AND. (piv.NE.0) )
THEN
271 work( i2 ) = work( i1 )
278 CALL zswap( i2-i1-1, a( j1+i1-1, i1+1 ), lda,
279 $ a( j1+i1, i2 ), 1 )
284 $
CALL zswap( m-i2, a( j1+i1-1, i2+1 ), lda,
285 $ a( j1+i2-1, i2+1 ), lda )
289 piv = a( i1+j1-1, i1 )
290 a( j1+i1-1, i1 ) = a( j1+i2-1, i2 )
291 a( j1+i2-1, i2 ) = piv
295 CALL zswap( i1-1, h( i1, 1 ), ldh, h( i2, 1 ), ldh )
298 IF( i1.GT.(k1-1) )
THEN
303 CALL zswap( i1-k1+1, a( 1, i1 ), 1,
312 a( k, j+1 ) = work( 2 )
318 CALL zcopy( m-j, a( k+1, j+1 ), lda,
325 IF( j.LT.(m-1) )
THEN
326 IF( a( k, j+1 ).NE.zero )
THEN
327 alpha = one / a( k, j+1 )
328 CALL zcopy( m-j-1, work( 3 ), 1, a( k, j+2 ), lda )
329 CALL zscal( m-j-1, alpha, a( k, j+2 ), lda )
331 CALL zlaset(
'Full', 1, m-j-1, zero, zero,
347 IF( j.GT.min( m, nb ) )
376 CALL zgemv(
'No transpose', mj, j-k1,
377 $ -one, h( j, k1 ), ldh,
379 $ one, h( j, j ), 1 )
384 CALL zcopy( mj, h( j, j ), 1, work( 1 ), 1 )
392 CALL zaxpy( mj, alpha, a( j, k-2 ), 1, work( 1 ), 1 )
397 a( j, k ) = work( 1 )
406 CALL zaxpy( m-j, alpha, a( j+1, k-1 ), 1,
412 i2 = izamax( m-j, work( 2 ), 1 ) + 1
417 IF( (i2.NE.2) .AND. (piv.NE.0) )
THEN
422 work( i2 ) = work( i1 )
429 CALL zswap( i2-i1-1, a( i1+1, j1+i1-1 ), 1,
430 $ a( i2, j1+i1 ), lda )
435 $
CALL zswap( m-i2, a( i2+1, j1+i1-1 ), 1,
436 $ a( i2+1, j1+i2-1 ), 1 )
440 piv = a( i1, j1+i1-1 )
441 a( i1, j1+i1-1 ) = a( i2, j1+i2-1 )
442 a( i2, j1+i2-1 ) = piv
446 CALL zswap( i1-1, h( i1, 1 ), ldh, h( i2, 1 ), ldh )
449 IF( i1.GT.(k1-1) )
THEN
454 CALL zswap( i1-k1+1, a( i1, 1 ), lda,
463 a( j+1, k ) = work( 2 )
469 CALL zcopy( m-j, a( j+1, k+1 ), 1,
476 IF( j.LT.(m-1) )
THEN
477 IF( a( j+1, k ).NE.zero )
THEN
478 alpha = one / a( j+1, k )
479 CALL zcopy( m-j-1, work( 3 ), 1, a( j+2, k ), 1 )
480 CALL zscal( m-j-1, alpha, a( j+2, k ), 1 )
482 CALL zlaset(
'Full', m-j-1, 1, zero, zero,