153 INTEGER M, NB, J1, LDA, LDH
157 COMPLEX A( LDA, * ), H( LDH, * ), WORK( * )
163 parameter( zero = (0.0e+0, 0.0e+0), one = (1.0e+0, 0.0e+0) )
166 INTEGER J, K, K1, I1, I2, MJ
171 INTEGER ICAMAX, ILAENV
172 EXTERNAL lsame, ilaenv, icamax
179 INTRINSIC real, conjg, max
190 IF( lsame( uplo,
'U' ) )
THEN
197 IF ( j.GT.min(m, nb) )
226 CALL clacgv( j-k1, a( 1, j ), 1 )
227 CALL cgemv(
'No transpose', mj, j-k1,
228 $ -one, h( j, k1 ), ldh,
230 $ one, h( j, j ), 1 )
231 CALL clacgv( j-k1, a( 1, j ), 1 )
236 CALL ccopy( mj, h( j, j ), 1, work( 1 ), 1 )
243 alpha = -conjg( a( k-1, j ) )
244 CALL caxpy( mj, alpha, a( k-2, j ), lda, work( 1 ), 1 )
249 a( k, j ) = real( work( 1 ) )
258 CALL caxpy( m-j, alpha, a( k-1, j+1 ), lda,
264 i2 = icamax( m-j, work( 2 ), 1 ) + 1
269 IF( (i2.NE.2) .AND. (piv.NE.0) )
THEN
274 work( i2 ) = work( i1 )
281 CALL cswap( i2-i1-1, a( j1+i1-1, i1+1 ), lda,
282 $ a( j1+i1, i2 ), 1 )
283 CALL clacgv( i2-i1, a( j1+i1-1, i1+1 ), lda )
284 CALL clacgv( i2-i1-1, a( j1+i1, i2 ), 1 )
289 $
CALL cswap( 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 cswap( i1-1, h( i1, 1 ), ldh, h( i2, 1 ), ldh )
303 IF( i1.GT.(k1-1) )
THEN
308 CALL cswap( i1-k1+1, a( 1, i1 ), 1,
317 a( k, j+1 ) = work( 2 )
323 CALL ccopy( 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 ccopy( m-j-1, work( 3 ), 1, a( k, j+2 ), lda )
334 CALL cscal( m-j-1, alpha, a( k, j+2 ), lda )
336 CALL claset(
'Full', 1, m-j-1, zero, zero,
352 IF( j.GT.min( m, nb ) )
381 CALL clacgv( j-k1, a( j, 1 ), lda )
382 CALL cgemv(
'No transpose', mj, j-k1,
383 $ -one, h( j, k1 ), ldh,
385 $ one, h( j, j ), 1 )
386 CALL clacgv( j-k1, a( j, 1 ), lda )
391 CALL ccopy( mj, h( j, j ), 1, work( 1 ), 1 )
398 alpha = -conjg( a( j, k-1 ) )
399 CALL caxpy( mj, alpha, a( j, k-2 ), 1, work( 1 ), 1 )
404 a( j, k ) = real( work( 1 ) )
413 CALL caxpy( m-j, alpha, a( j+1, k-1 ), 1,
419 i2 = icamax( m-j, work( 2 ), 1 ) + 1
424 IF( (i2.NE.2) .AND. (piv.NE.0) )
THEN
429 work( i2 ) = work( i1 )
436 CALL cswap( i2-i1-1, a( i1+1, j1+i1-1 ), 1,
437 $ a( i2, j1+i1 ), lda )
438 CALL clacgv( i2-i1, a( i1+1, j1+i1-1 ), 1 )
439 CALL clacgv( i2-i1-1, a( i2, j1+i1 ), lda )
444 $
CALL cswap( 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 cswap( i1-1, h( i1, 1 ), ldh, h( i2, 1 ), ldh )
458 IF( i1.GT.(k1-1) )
THEN
463 CALL cswap( i1-k1+1, a( i1, 1 ), lda,
472 a( j+1, k ) = work( 2 )
478 CALL ccopy( 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 ccopy( m-j-1, work( 3 ), 1, a( j+2, k ), 1 )
489 CALL cscal( m-j-1, alpha, a( j+2, k ), 1 )
491 CALL claset(
'Full', m-j-1, 1, zero, zero,
subroutine xerbla(srname, info)
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
subroutine clahef_aa(uplo, j1, m, nb, a, lda, ipiv, h, ldh, work)
CLAHEF_AA
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine cscal(n, ca, cx, incx)
CSCAL
subroutine cswap(n, cx, incx, cy, incy)
CSWAP