169 SUBROUTINE cgehrd( N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO )
177 INTEGER ihi, ilo, info, lda, lwork, n
180 COMPLEX a( lda, * ), tau( * ), work( * )
187 parameter( nbmax = 64, ldt = nbmax+1 )
189 parameter( zero = ( 0.0e+0, 0.0e+0 ),
190 $ one = ( 1.0e+0, 0.0e+0 ) )
194 INTEGER i, ib, iinfo, iws, j, ldwork, lwkopt, nb,
199 COMPLEX t( ldt, nbmax )
217 nb = min( nbmax,
ilaenv( 1,
'CGEHRD',
' ', 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(
'CGEHRD', -info )
235 ELSE IF( lquery )
THEN
244 DO 20 i = max( 1, ihi ), n - 1
258 nb = min( nbmax,
ilaenv( 1,
'CGEHRD',
' ', n, ilo, ihi, -1 ) )
261 IF( nb.GT.1 .AND. nb.LT.nh )
THEN
266 nx = max( nb,
ilaenv( 3,
'CGEHRD',
' ', n, ilo, ihi, -1 ) )
272 IF( lwork.LT.iws )
THEN
278 nbmin = max( 2,
ilaenv( 2,
'CGEHRD',
' ', 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
clahr2( 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
cgemm(
'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
ctrmm(
'Right',
'Lower',
'Conjugate transpose',
327 $ one, a( i+1, i ), lda, work, ldwork )
329 CALL
caxpy( i, -one, work( ldwork*j+1 ), 1,
336 CALL
clarfb(
'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
cgehd2( n, i, ihi, a, lda, tau, work, iinfo )