127 SUBROUTINE zungqr( M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
134 INTEGER INFO, K, LDA, LWORK, M, N
137 COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
144 parameter( zero = ( 0.0d+0, 0.0d+0 ) )
148 INTEGER I, IB, IINFO, IWS, J, KI, KK, L, LDWORK,
149 $ LWKOPT, NB, NBMIN, NX
166 nb = ilaenv( 1,
'ZUNGQR',
' ', m, n, k, -1 )
167 lwkopt = max( 1, n )*nb
169 lquery = ( lwork.EQ.-1 )
172 ELSE IF( n.LT.0 .OR. n.GT.m )
THEN
174 ELSE IF( k.LT.0 .OR. k.GT.n )
THEN
176 ELSE IF( lda.LT.max( 1, m ) )
THEN
178 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
182 CALL xerbla(
'ZUNGQR', -info )
184 ELSE IF( lquery )
THEN
198 IF( nb.GT.1 .AND. nb.LT.k )
THEN
202 nx = max( 0, ilaenv( 3,
'ZUNGQR',
' ', m, n, k, -1 ) )
209 IF( lwork.LT.iws )
THEN
215 nbmin = max( 2, ilaenv( 2,
'ZUNGQR',
' ', m, n, k, -1 ) )
220 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
225 ki = ( ( k-nx-1 ) / nb )*nb
242 $
CALL zung2r( m-kk, n-kk, k-kk, a( kk+1, kk+1 ), lda,
243 $ tau( kk+1 ), work, iinfo )
249 DO 50 i = ki + 1, 1, -nb
250 ib = min( nb, k-i+1 )
256 CALL zlarft(
'Forward',
'Columnwise', m-i+1, ib,
257 $ a( i, i ), lda, tau( i ), work, ldwork )
261 CALL zlarfb(
'Left',
'No transpose',
'Forward',
262 $
'Columnwise', m-i+1, n-i-ib+1, ib,
263 $ a( i, i ), lda, work, ldwork, a( i, i+ib ),
264 $ lda, work( ib+1 ), ldwork )
269 CALL zung2r( m-i+1, ib, ib, a( i, i ), lda, tau( i ), work,
274 DO 40 j = i, i + ib - 1
subroutine xerbla(srname, info)
subroutine zlarfb(side, trans, direct, storev, m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork)
ZLARFB applies a block reflector or its conjugate-transpose to a general rectangular matrix.
subroutine zlarft(direct, storev, n, k, v, ldv, tau, t, ldt)
ZLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine zung2r(m, n, k, a, lda, tau, work, info)
ZUNG2R
subroutine zungqr(m, n, k, a, lda, tau, work, lwork, info)
ZUNGQR