143 SUBROUTINE cgeqrf( M, N, A, LDA, TAU, WORK, LWORK, INFO )
150 INTEGER INFO, LDA, LWORK, M, N
153 COMPLEX A( LDA, * ), TAU( * ), WORK( * )
160 INTEGER I, IB, IINFO, IWS, K, LDWORK, LWKOPT, NB,
172 EXTERNAL ilaenv, sroundup_lwork
180 nb = ilaenv( 1,
'CGEQRF',
' ', m, n, -1, -1 )
181 lquery = ( lwork.EQ.-1 )
184 ELSE IF( n.LT.0 )
THEN
186 ELSE IF( lda.LT.max( 1, m ) )
THEN
188 ELSE IF( .NOT.lquery )
THEN
189 IF( lwork.LE.0 .OR. ( m.GT.0 .AND. lwork.LT.max( 1, n ) ) )
193 CALL xerbla(
'CGEQRF', -info )
195 ELSE IF( lquery )
THEN
201 work( 1 ) = sroundup_lwork(lwkopt)
215 IF( nb.GT.1 .AND. nb.LT.k )
THEN
219 nx = max( 0, ilaenv( 3,
'CGEQRF',
' ', m, n, -1, -1 ) )
226 IF( lwork.LT.iws )
THEN
232 nbmin = max( 2, ilaenv( 2,
'CGEQRF',
' ', m, n, -1,
238 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
242 DO 10 i = 1, k - nx, nb
243 ib = min( k-i+1, nb )
248 CALL cgeqr2( m-i+1, ib, a( i, i ), lda, tau( i ), work,
255 CALL clarft(
'Forward',
'Columnwise', m-i+1, ib,
256 $ a( i, i ), lda, tau( i ), work, ldwork )
260 CALL clarfb(
'Left',
'Conjugate transpose',
'Forward',
261 $
'Columnwise', m-i+1, n-i-ib+1, ib,
262 $ a( i, i ), lda, work, ldwork, a( i, i+ib ),
263 $ lda, work( ib+1 ), ldwork )
273 $
CALL cgeqr2( m-i+1, n-i+1, a( i, i ), lda, tau( i ), work,
276 work( 1 ) = sroundup_lwork(iws)
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.
recursive subroutine clarft(direct, storev, n, k, v, ldv, tau, t, ldt)
CLARFT forms the triangular factor T of a block reflector H = I - vtvH