153 INTEGER M, NB, J1, LDA, LDH
157 COMPLEX*16 A( LDA, * ), H( LDH, * ), WORK( * )
163 parameter( zero = (0.0d+0, 0.0d+0), one = (1.0d+0, 0.0d+0) )
166 INTEGER J, K, K1, I1, I2, MJ
167 COMPLEX*16 PIV, ALPHA
171 INTEGER IZAMAX, ILAENV
172 EXTERNAL lsame, ilaenv, izamax
179 INTRINSIC dble, dconjg, max
190 IF( lsame( uplo,
'U' ) )
THEN
197 IF ( j.GT.min(m, nb) )
226 CALL zlacgv( j-k1, a( 1, j ), 1 )
227 CALL zgemv(
'No transpose', mj, j-k1,
228 $ -one, h( j, k1 ), ldh,
230 $ one, h( j, j ), 1 )
231 CALL zlacgv( j-k1, a( 1, j ), 1 )
236 CALL zcopy( mj, h( j, j ), 1, work( 1 ), 1 )
243 alpha = -dconjg( a( k-1, j ) )
244 CALL zaxpy( mj, alpha, a( k-2, j ), lda, work( 1 ), 1 )
249 a( k, j ) = dble( work( 1 ) )
258 CALL zaxpy( m-j, alpha, a( k-1, j+1 ), lda,
264 i2 = izamax( m-j, work( 2 ), 1 ) + 1
269 IF( (i2.NE.2) .AND. (piv.NE.0) )
THEN
274 work( i2 ) = work( i1 )
281 CALL zswap( i2-i1-1, a( j1+i1-1, i1+1 ), lda,
282 $ a( j1+i1, i2 ), 1 )
283 CALL zlacgv( i2-i1, a( j1+i1-1, i1+1 ), lda )
284 CALL zlacgv( i2-i1-1, a( j1+i1, i2 ), 1 )
289 $
CALL zswap( m-i2, a( j1+i1-1, i2+1 ), lda,
290 $ a( j1+i2-1, i2+1 ), lda )
294 piv = a( i1+j1-1, i1 )
295 a( j1+i1-1, i1 ) = a( j1+i2-1, i2 )
296 a( j1+i2-1, i2 ) = piv
300 CALL zswap( i1-1, h( i1, 1 ), ldh, h( i2, 1 ), ldh )
303 IF( i1.GT.(k1-1) )
THEN
308 CALL zswap( i1-k1+1, a( 1, i1 ), 1,
317 a( k, j+1 ) = work( 2 )
323 CALL zcopy( m-j, a( k+1, j+1 ), lda,
330 IF( j.LT.(m-1) )
THEN
331 IF( a( k, j+1 ).NE.zero )
THEN
332 alpha = one / a( k, j+1 )
333 CALL zcopy( m-j-1, work( 3 ), 1, a( k, j+2 ), lda )
334 CALL zscal( m-j-1, alpha, a( k, j+2 ), lda )
336 CALL zlaset(
'Full', 1, m-j-1, zero, zero,
352 IF( j.GT.min( m, nb ) )
381 CALL zlacgv( j-k1, a( j, 1 ), lda )
382 CALL zgemv(
'No transpose', mj, j-k1,
383 $ -one, h( j, k1 ), ldh,
385 $ one, h( j, j ), 1 )
386 CALL zlacgv( j-k1, a( j, 1 ), lda )
391 CALL zcopy( mj, h( j, j ), 1, work( 1 ), 1 )
398 alpha = -dconjg( a( j, k-1 ) )
399 CALL zaxpy( mj, alpha, a( j, k-2 ), 1, work( 1 ), 1 )
404 a( j, k ) = dble( work( 1 ) )
413 CALL zaxpy( m-j, alpha, a( j+1, k-1 ), 1,
419 i2 = izamax( m-j, work( 2 ), 1 ) + 1
424 IF( (i2.NE.2) .AND. (piv.NE.0) )
THEN
429 work( i2 ) = work( i1 )
436 CALL zswap( i2-i1-1, a( i1+1, j1+i1-1 ), 1,
437 $ a( i2, j1+i1 ), lda )
438 CALL zlacgv( i2-i1, a( i1+1, j1+i1-1 ), 1 )
439 CALL zlacgv( i2-i1-1, a( i2, j1+i1 ), lda )
444 $
CALL zswap( m-i2, a( i2+1, j1+i1-1 ), 1,
445 $ a( i2+1, j1+i2-1 ), 1 )
449 piv = a( i1, j1+i1-1 )
450 a( i1, j1+i1-1 ) = a( i2, j1+i2-1 )
451 a( i2, j1+i2-1 ) = piv
455 CALL zswap( i1-1, h( i1, 1 ), ldh, h( i2, 1 ), ldh )
458 IF( i1.GT.(k1-1) )
THEN
463 CALL zswap( i1-k1+1, a( i1, 1 ), lda,
472 a( j+1, k ) = work( 2 )
478 CALL zcopy( m-j, a( j+1, k+1 ), 1,
485 IF( j.LT.(m-1) )
THEN
486 IF( a( j+1, k ).NE.zero )
THEN
487 alpha = one / a( j+1, k )
488 CALL zcopy( m-j-1, work( 3 ), 1, a( j+2, k ), 1 )
489 CALL zscal( m-j-1, alpha, a( j+2, k ), 1 )
491 CALL zlaset(
'Full', m-j-1, 1, zero, zero,
subroutine xerbla(srname, info)
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zlacgv(n, x, incx)
ZLACGV conjugates a complex vector.
subroutine zlahef_aa(uplo, j1, m, nb, a, lda, ipiv, h, ldh, work)
ZLAHEF_AA
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zscal(n, za, zx, incx)
ZSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP