169 SUBROUTINE sgehrd( N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO )
177 INTEGER ihi, ilo, info, lda, lwork, n
180 REAL a( lda, * ), tau( * ), work( * )
187 parameter( nbmax = 64, ldt = nbmax+1 )
189 parameter( zero = 0.0e+0,
194 INTEGER i, ib, iinfo, iws, j, ldwork, lwkopt, nb,
217 nb = min( nbmax,
ilaenv( 1,
'SGEHRD',
' ', 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(
'SGEHRD', -info )
235 ELSE IF( lquery )
THEN
244 DO 20 i = max( 1, ihi ), n - 1
258 nb = min( nbmax,
ilaenv( 1,
'SGEHRD',
' ', n, ilo, ihi, -1 ) )
261 IF( nb.GT.1 .AND. nb.LT.nh )
THEN
266 nx = max( nb,
ilaenv( 3,
'SGEHRD',
' ', n, ilo, ihi, -1 ) )
272 IF( lwork.LT.iws )
THEN
278 nbmin = max( 2,
ilaenv( 2,
'SGEHRD',
' ', 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
slahr2( 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
sgemm(
'No transpose',
'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
strmm(
'Right',
'Lower',
'Transpose',
327 $ one, a( i+1, i ), lda, work, ldwork )
329 CALL
saxpy( i, -one, work( ldwork*j+1 ), 1,
336 CALL
slarfb(
'Left',
'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
sgehd2( n, i, ihi, a, lda, tau, work, iinfo )