142 SUBROUTINE cgelqf( M, N, A, LDA, TAU, WORK, LWORK, INFO )
149 INTEGER INFO, LDA, LWORK, M, N
152 COMPLEX A( LDA, * ), TAU( * ), WORK( * )
159 INTEGER I, IB, IINFO, IWS, K, LDWORK, LWKOPT, NB,
171 EXTERNAL ilaenv, sroundup_lwork
178 nb = ilaenv( 1,
'CGELQF',
' ', m, n, -1, -1 )
180 work( 1 ) = sroundup_lwork(lwkopt)
181 lquery = ( lwork.EQ.-1 )
184 ELSE IF( n.LT.0 )
THEN
186 ELSE IF( lda.LT.max( 1, m ) )
THEN
188 ELSE IF( lwork.LT.max( 1, m ) .AND. .NOT.lquery )
THEN
192 CALL xerbla(
'CGELQF', -info )
194 ELSE IF( lquery )
THEN
209 IF( nb.GT.1 .AND. nb.LT.k )
THEN
213 nx = max( 0, ilaenv( 3,
'CGELQF',
' ', m, n, -1, -1 ) )
220 IF( lwork.LT.iws )
THEN
226 nbmin = max( 2, ilaenv( 2,
'CGELQF',
' ', m, n, -1,
232 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
236 DO 10 i = 1, k - nx, nb
237 ib = min( k-i+1, nb )
242 CALL cgelq2( ib, n-i+1, a( i, i ), lda, tau( i ), work,
249 CALL clarft(
'Forward',
'Rowwise', n-i+1, ib, a( i, i ),
250 $ lda, tau( i ), work, ldwork )
254 CALL clarfb(
'Right',
'No transpose',
'Forward',
255 $
'Rowwise', m-i-ib+1, n-i+1, ib, a( i, i ),
256 $ lda, work, ldwork, a( i+ib, i ), lda,
257 $ work( ib+1 ), ldwork )
267 $
CALL cgelq2( m-i+1, n-i+1, a( i, i ), lda, tau( i ), work,
270 work( 1 ) = sroundup_lwork(iws)
subroutine xerbla(srname, info)
subroutine cgelq2(m, n, a, lda, tau, work, info)
CGELQ2 computes the LQ factorization of a general rectangular matrix using an unblocked algorithm.
subroutine cgelqf(m, n, a, lda, tau, work, lwork, info)
CGELQF
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