169 SUBROUTINE zgehrd( N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO )
177 INTEGER ihi, ilo, info, lda, lwork, n
180 COMPLEX*16 a( lda, * ), tau( * ), work( * )
187 parameter( nbmax = 64, ldt = nbmax+1 )
189 parameter( zero = ( 0.0d+0, 0.0d+0 ),
190 $ one = ( 1.0d+0, 0.0d+0 ) )
194 INTEGER i, ib, iinfo, iws, j, ldwork, lwkopt, nb,
199 COMPLEX*16 t( ldt, nbmax )
217 nb = min( nbmax,
ilaenv( 1,
'ZGEHRD',
' ', n, ilo, ihi, -1 ) )
220 lquery = ( lwork.EQ.-1 )
223 ELSE IF( ilo.LT.1 .OR. ilo.GT.max( 1, n ) )
THEN
225 ELSE IF( ihi.LT.min( ilo, n ) .OR. ihi.GT.n )
THEN
227 ELSE IF( lda.LT.max( 1, n ) )
THEN
229 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
233 CALL
xerbla(
'ZGEHRD', -info )
235 ELSE IF( lquery )
THEN
244 DO 20 i = max( 1, ihi ), n - 1
258 nb = min( nbmax,
ilaenv( 1,
'ZGEHRD',
' ', n, ilo, ihi, -1 ) )
261 IF( nb.GT.1 .AND. nb.LT.nh )
THEN
266 nx = max( nb,
ilaenv( 3,
'ZGEHRD',
' ', n, ilo, ihi, -1 ) )
272 IF( lwork.LT.iws )
THEN
278 nbmin = max( 2,
ilaenv( 2,
'ZGEHRD',
' ', n, ilo, ihi,
280 IF( lwork.GE.n*nbmin )
THEN
290 IF( nb.LT.nbmin .OR. nb.GE.nh )
THEN
300 DO 40 i = ilo, ihi - 1 - nx, nb
301 ib = min( nb, ihi-i )
307 CALL
zlahr2( ihi, i, ib, a( 1, i ), lda, tau( i ), t, ldt,
314 ei = a( i+ib, i+ib-1 )
315 a( i+ib, i+ib-1 ) = one
316 CALL
zgemm(
'No transpose',
'Conjugate transpose',
318 $ ib, -one, work, ldwork, a( i+ib, i ), lda, one,
319 $ a( 1, i+ib ), lda )
320 a( i+ib, i+ib-1 ) = ei
325 CALL
ztrmm(
'Right',
'Lower',
'Conjugate transpose',
327 $ one, a( i+1, i ), lda, work, ldwork )
329 CALL
zaxpy( i, -one, work( ldwork*j+1 ), 1,
336 CALL
zlarfb(
'Left',
'Conjugate transpose',
'Forward',
338 $ ihi-i, n-i-ib+1, ib, a( i+1, i ), lda, t, ldt,
339 $ a( i+1, i+ib ), lda, work, ldwork )
345 CALL
zgehd2( n, i, ihi, a, lda, tau, work, iinfo )