138 SUBROUTINE cgerqf( M, N, A, LDA, TAU, WORK, LWORK, INFO )
145 INTEGER INFO, LDA, LWORK, M, N
148 COMPLEX A( LDA, * ), TAU( * ), WORK( * )
155 INTEGER I, IB, IINFO, IWS, K, KI, KK, LDWORK, LWKOPT,
156 $ MU, NB, NBMIN, NU, NX
167 EXTERNAL ilaenv, sroundup_lwork
174 lquery = ( lwork.EQ.-1 )
177 ELSE IF( n.LT.0 )
THEN
179 ELSE IF( lda.LT.max( 1, m ) )
THEN
188 nb = ilaenv( 1,
'CGERQF',
' ', m, n, -1, -1 )
191 work( 1 ) = sroundup_lwork(lwkopt)
193 IF ( .NOT.lquery )
THEN
194 IF( lwork.LE.0 .OR. ( n.GT.0 .AND. lwork.LT.max( 1, m ) ) )
200 CALL xerbla(
'CGERQF', -info )
202 ELSE IF( lquery )
THEN
215 IF( nb.GT.1 .AND. nb.LT.k )
THEN
219 nx = max( 0, ilaenv( 3,
'CGERQF',
' ', m, n, -1, -1 ) )
226 IF( lwork.LT.iws )
THEN
232 nbmin = max( 2, ilaenv( 2,
'CGERQF',
' ', m, n, -1,
238 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
243 ki = ( ( k-nx-1 ) / nb )*nb
246 DO 10 i = k - kk + ki + 1, k - kk + 1, -nb
247 ib = min( k-i+1, nb )
252 CALL cgerq2( ib, n-k+i+ib-1, a( m-k+i, 1 ), lda, tau( i ),
254 IF( m-k+i.GT.1 )
THEN
259 CALL clarft(
'Backward',
'Rowwise', n-k+i+ib-1, ib,
260 $ a( m-k+i, 1 ), lda, tau( i ), work, ldwork )
264 CALL clarfb(
'Right',
'No transpose',
'Backward',
265 $
'Rowwise', m-k+i-1, n-k+i+ib-1, ib,
266 $ a( m-k+i, 1 ), lda, work, ldwork, a, lda,
267 $ work( ib+1 ), ldwork )
270 mu = m - k + i + nb - 1
271 nu = n - k + i + nb - 1
279 IF( mu.GT.0 .AND. nu.GT.0 )
280 $
CALL cgerq2( mu, nu, a, lda, tau, work, iinfo )
282 work( 1 ) = sroundup_lwork(iws)
subroutine xerbla(srname, info)
subroutine cgerq2(m, n, a, lda, tau, work, info)
CGERQ2 computes the RQ factorization of a general rectangular matrix using an unblocked algorithm.
subroutine cgerqf(m, n, a, lda, tau, work, lwork, info)
CGERQF
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