129 SUBROUTINE cungrq( M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
137 INTEGER info, k, lda, lwork, m, n
140 COMPLEX a( lda, * ), tau( * ), work( * )
147 parameter( zero = ( 0.0e+0, 0.0e+0 ) )
151 INTEGER i, ib, ii, iinfo, iws, j, kk, l, ldwork,
152 $ lwkopt, nb, nbmin, nx
169 lquery = ( lwork.EQ.-1 )
172 ELSE IF( n.LT.m )
THEN
174 ELSE IF( k.LT.0 .OR. k.GT.m )
THEN
176 ELSE IF( lda.LT.max( 1, m ) )
THEN
184 nb =
ilaenv( 1,
'CUNGRQ',
' ', m, n, k, -1 )
189 IF( lwork.LT.max( 1, m ) .AND. .NOT.lquery )
THEN
195 CALL
xerbla(
'CUNGRQ', -info )
197 ELSE IF( lquery )
THEN
210 IF( nb.GT.1 .AND. nb.LT.k )
THEN
214 nx = max( 0,
ilaenv( 3,
'CUNGRQ',
' ', m, n, k, -1 ) )
221 IF( lwork.LT.iws )
THEN
227 nbmin = max( 2,
ilaenv( 2,
'CUNGRQ',
' ', m, n, k, -1 ) )
232 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
237 kk = min( k, ( ( k-nx+nb-1 ) / nb )*nb )
241 DO 20 j = n - kk + 1, n
252 CALL
cungr2( m-kk, n-kk, k-kk, a, lda, tau, work, iinfo )
258 DO 50 i = k - kk + 1, k, nb
259 ib = min( nb, k-i+1 )
266 CALL
clarft(
'Backward',
'Rowwise', n-k+i+ib-1, ib,
267 $ a( ii, 1 ), lda, tau( i ), work, ldwork )
271 CALL
clarfb(
'Right',
'Conjugate transpose',
'Backward',
272 $
'Rowwise', ii-1, n-k+i+ib-1, ib, a( ii, 1 ),
273 $ lda, work, ldwork, a, lda, work( ib+1 ),
279 CALL
cungr2( ib, n-k+i+ib-1, ib, a( ii, 1 ), lda, tau( i ),
284 DO 40 l = n - k + i + ib, n
285 DO 30 j = ii, ii + ib - 1