166 SUBROUTINE sgehrd( N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO )
173 INTEGER IHI, ILO, INFO, LDA, LWORK, N
176 REAL A( LDA, * ), TAU( * ), WORK( * )
182 INTEGER NBMAX, LDT, TSIZE
183 parameter( nbmax = 64, ldt = nbmax+1,
184 $ tsize = ldt*nbmax )
186 parameter( zero = 0.0e+0,
191 INTEGER I, IB, IINFO, IWT, J, LDWORK, LWKOPT, NB,
205 EXTERNAL ilaenv, sroundup_lwork
212 lquery = ( lwork.EQ.-1 )
215 ELSE IF( ilo.LT.1 .OR. ilo.GT.max( 1, n ) )
THEN
217 ELSE IF( ihi.LT.min( ilo, n ) .OR. ihi.GT.n )
THEN
219 ELSE IF( lda.LT.max( 1, n ) )
THEN
221 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
229 nb = min( nbmax, ilaenv( 1,
'SGEHRD',
' ', n, ilo, ihi, -1 ) )
230 lwkopt = n*nb + tsize
231 work( 1 ) = sroundup_lwork(lwkopt)
235 CALL xerbla(
'SGEHRD', -info )
237 ELSE IF( lquery )
THEN
246 DO 20 i = max( 1, ihi ), n - 1
260 nb = min( nbmax, ilaenv( 1,
'SGEHRD',
' ', n, ilo, ihi, -1 ) )
262 IF( nb.GT.1 .AND. nb.LT.nh )
THEN
267 nx = max( nb, ilaenv( 3,
'SGEHRD',
' ', n, ilo, ihi, -1 ) )
272 IF( lwork.LT.n*nb+tsize )
THEN
278 nbmin = max( 2, ilaenv( 2,
'SGEHRD',
' ', n, ilo, ihi,
280 IF( lwork.GE.(n*nbmin + tsize) )
THEN
281 nb = (lwork-tsize) / n
290 IF( nb.LT.nbmin .OR. nb.GE.nh )
THEN
301 DO 40 i = ilo, ihi - 1 - nx, nb
302 ib = min( nb, ihi-i )
308 CALL slahr2( ihi, i, ib, a( 1, i ), lda, tau( i ),
309 $ work( iwt ), ldt, work, ldwork )
315 ei = a( i+ib, i+ib-1 )
316 a( i+ib, i+ib-1 ) = one
317 CALL sgemm(
'No transpose',
'Transpose',
319 $ ib, -one, work, ldwork, a( i+ib, i ), lda, one,
320 $ a( 1, i+ib ), lda )
321 a( i+ib, i+ib-1 ) = ei
326 CALL strmm(
'Right',
'Lower',
'Transpose',
328 $ one, a( i+1, i ), lda, work, ldwork )
330 CALL saxpy( i, -one, work( ldwork*j+1 ), 1,
337 CALL slarfb(
'Left',
'Transpose',
'Forward',
339 $ ihi-i, n-i-ib+1, ib, a( i+1, i ), lda,
340 $ work( iwt ), ldt, a( i+1, i+ib ), lda,
347 CALL sgehd2( n, i, ihi, a, lda, tau, work, iinfo )
348 work( 1 ) = sroundup_lwork(lwkopt)
subroutine xerbla(srname, info)
subroutine saxpy(n, sa, sx, incx, sy, incy)
SAXPY
subroutine sgehd2(n, ilo, ihi, a, lda, tau, work, info)
SGEHD2 reduces a general square matrix to upper Hessenberg form using an unblocked algorithm.
subroutine sgehrd(n, ilo, ihi, a, lda, tau, work, lwork, info)
SGEHRD
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine slahr2(n, k, nb, a, lda, tau, t, ldt, y, ldy)
SLAHR2 reduces the specified number of first columns of a general rectangular matrix A so that elemen...
subroutine slarfb(side, trans, direct, storev, m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork)
SLARFB applies a block reflector or its transpose to a general rectangular matrix.
subroutine strmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
STRMM