127 SUBROUTINE cungrq( M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
134 INTEGER INFO, K, LDA, LWORK, M, N
137 COMPLEX A( LDA, * ), TAU( * ), WORK( * )
144 parameter( zero = ( 0.0e+0, 0.0e+0 ) )
148 INTEGER I, IB, II, IINFO, IWS, J, KK, L, LDWORK,
149 $ LWKOPT, NB, NBMIN, NX
160 EXTERNAL ilaenv, sroundup_lwork
167 lquery = ( lwork.EQ.-1 )
170 ELSE IF( n.LT.m )
THEN
172 ELSE IF( k.LT.0 .OR. k.GT.m )
THEN
174 ELSE IF( lda.LT.max( 1, m ) )
THEN
182 nb = ilaenv( 1,
'CUNGRQ',
' ', m, n, k, -1 )
185 work( 1 ) = sroundup_lwork(lwkopt)
187 IF( lwork.LT.max( 1, m ) .AND. .NOT.lquery )
THEN
193 CALL xerbla(
'CUNGRQ', -info )
195 ELSE IF( lquery )
THEN
208 IF( nb.GT.1 .AND. nb.LT.k )
THEN
212 nx = max( 0, ilaenv( 3,
'CUNGRQ',
' ', m, n, k, -1 ) )
219 IF( lwork.LT.iws )
THEN
225 nbmin = max( 2, ilaenv( 2,
'CUNGRQ',
' ', m, n, k, -1 ) )
230 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
235 kk = min( k, ( ( k-nx+nb-1 ) / nb )*nb )
239 DO 20 j = n - kk + 1, n
250 CALL cungr2( m-kk, n-kk, k-kk, a, lda, tau, work, iinfo )
256 DO 50 i = k - kk + 1, k, nb
257 ib = min( nb, k-i+1 )
264 CALL clarft(
'Backward',
'Rowwise', n-k+i+ib-1, ib,
265 $ a( ii, 1 ), lda, tau( i ), work, ldwork )
269 CALL clarfb(
'Right',
'Conjugate transpose',
'Backward',
270 $
'Rowwise', ii-1, n-k+i+ib-1, ib, a( ii, 1 ),
271 $ lda, work, ldwork, a, lda, work( ib+1 ),
277 CALL cungr2( ib, n-k+i+ib-1, ib, a( ii, 1 ), lda, tau( i ),
282 DO 40 l = n - k + i + ib, n
283 DO 30 j = ii, ii + ib - 1
290 work( 1 ) = sroundup_lwork(iws)
subroutine xerbla(srname, info)
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.
subroutine clarft(direct, storev, n, k, v, ldv, tau, t, ldt)
CLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine cungr2(m, n, k, a, lda, tau, work, info)
CUNGR2 generates all or part of the unitary matrix Q from an RQ factorization determined by cgerqf (u...
subroutine cungrq(m, n, k, a, lda, tau, work, lwork, info)
CUNGRQ