145 SUBROUTINE cgeqrf( M, N, A, LDA, TAU, WORK, LWORK, INFO )
152 INTEGER INFO, LDA, LWORK, M, N
155 COMPLEX A( LDA, * ), TAU( * ), WORK( * )
162 INTEGER I, IB, IINFO, IWS, K, LDWORK, LWKOPT, NB,
174 EXTERNAL ilaenv, sroundup_lwork
182 nb = ilaenv( 1,
'CGEQRF',
' ', m, n, -1, -1 )
183 lquery = ( lwork.EQ.-1 )
186 ELSE IF( n.LT.0 )
THEN
188 ELSE IF( lda.LT.max( 1, m ) )
THEN
190 ELSE IF( .NOT.lquery )
THEN
191 IF( lwork.LE.0 .OR. ( m.GT.0 .AND. lwork.LT.max( 1, n ) ) )
195 CALL xerbla(
'CGEQRF', -info )
197 ELSE IF( lquery )
THEN
203 work( 1 ) = sroundup_lwork(lwkopt)
217 IF( nb.GT.1 .AND. nb.LT.k )
THEN
221 nx = max( 0, ilaenv( 3,
'CGEQRF',
' ', m, n, -1, -1 ) )
228 IF( lwork.LT.iws )
THEN
234 nbmin = max( 2, ilaenv( 2,
'CGEQRF',
' ', m, n, -1,
240 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
244 DO 10 i = 1, k - nx, nb
245 ib = min( k-i+1, nb )
250 CALL cgeqr2( m-i+1, ib, a( i, i ), lda, tau( i ), work,
257 CALL clarft(
'Forward',
'Columnwise', m-i+1, ib,
258 $ a( i, i ), lda, tau( i ), work, ldwork )
262 CALL clarfb(
'Left',
'Conjugate transpose',
'Forward',
263 $
'Columnwise', m-i+1, n-i-ib+1, ib,
264 $ a( i, i ), lda, work, ldwork, a( i, i+ib ),
265 $ lda, work( ib+1 ), ldwork )
275 $
CALL cgeqr2( m-i+1, n-i+1, a( i, i ), lda, tau( i ), work,
278 work( 1 ) = sroundup_lwork(iws)
subroutine xerbla(srname, info)
subroutine cgeqr2(m, n, a, lda, tau, work, info)
CGEQR2 computes the QR factorization of a general rectangular matrix using an unblocked algorithm.
subroutine cgeqrf(m, n, a, lda, tau, work, lwork, info)
CGEQRF
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