164 SUBROUTINE cgehrd( N, ILO, IHI, A, LDA, TAU, WORK, LWORK,
172 INTEGER IHI, ILO, INFO, LDA, LWORK, N
175 COMPLEX A( LDA, * ), TAU( * ), WORK( * )
181 INTEGER NBMAX, LDT, TSIZE
182 parameter( nbmax = 64, ldt = nbmax+1,
183 $ tsize = ldt*nbmax )
185 parameter( zero = ( 0.0e+0, 0.0e+0 ),
186 $ one = ( 1.0e+0, 0.0e+0 ) )
190 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
233 nb = min( nbmax, ilaenv( 1,
'CGEHRD',
' ', n, ilo, ihi,
235 lwkopt = n*nb + tsize
237 work( 1 ) = sroundup_lwork( lwkopt )
241 CALL xerbla(
'CGEHRD', -info )
243 ELSE IF( lquery )
THEN
252 DO 20 i = max( 1, ihi ), n - 1
265 nb = min( nbmax, ilaenv( 1,
'CGEHRD',
' ', n, ilo, ihi, -1 ) )
267 IF( nb.GT.1 .AND. nb.LT.nh )
THEN
272 nx = max( nb, ilaenv( 3,
'CGEHRD',
' ', n, ilo, ihi, -1 ) )
277 IF( lwork.LT.lwkopt )
THEN
283 nbmin = max( 2, ilaenv( 2,
'CGEHRD',
' ', n, ilo, ihi,
285 IF( lwork.GE.(n*nbmin+tsize) )
THEN
286 nb = (lwork-tsize) / n
295 IF( nb.LT.nbmin .OR. nb.GE.nh )
THEN
306 DO 40 i = ilo, ihi - 1 - nx, nb
307 ib = min( nb, ihi-i )
313 CALL clahr2( ihi, i, ib, a( 1, i ), lda, tau( i ),
314 $ work( iwt ), ldt, work, ldwork )
320 ei = a( i+ib, i+ib-1 )
321 a( i+ib, i+ib-1 ) = one
322 CALL cgemm(
'No transpose',
'Conjugate transpose',
324 $ ib, -one, work, ldwork, a( i+ib, i ), lda, one,
325 $ a( 1, i+ib ), lda )
326 a( i+ib, i+ib-1 ) = ei
331 CALL ctrmm(
'Right',
'Lower',
'Conjugate transpose',
333 $ one, a( i+1, i ), lda, work, ldwork )
335 CALL caxpy( i, -one, work( ldwork*j+1 ), 1,
342 CALL clarfb(
'Left',
'Conjugate transpose',
'Forward',
344 $ ihi-i, n-i-ib+1, ib, a( i+1, i ), lda,
345 $ work( iwt ), ldt, a( i+1, i+ib ), lda,
352 CALL cgehd2( n, i, ihi, a, lda, tau, work, iinfo )
354 work( 1 ) = sroundup_lwork( lwkopt )
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine clahr2(n, k, nb, a, lda, tau, t, ldt, y, ldy)
CLAHR2 reduces the specified number of first columns of a general rectangular matrix A so that elemen...
subroutine clarfb(side, trans, direct, storev, m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork)
CLARFB applies a block reflector or its conjugate-transpose to a general rectangular matrix.