145 SUBROUTINE sgeqrf( M, N, A, LDA, TAU, WORK, LWORK, INFO )
152 INTEGER INFO, LDA, LWORK, M, N
155 REAL A( LDA, * ), TAU( * ), WORK( * )
162 INTEGER I, IB, IINFO, IWS, K, LDWORK, LWKOPT, NB,
174 EXTERNAL ilaenv, sroundup_lwork
182 nb = ilaenv( 1,
'SGEQRF',
' ', 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(
'SGEQRF', -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,
'SGEQRF',
' ', m, n, -1, -1 ) )
228 IF( lwork.LT.iws )
THEN
234 nbmin = max( 2, ilaenv( 2,
'SGEQRF',
' ', 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 sgeqr2( m-i+1, ib, a( i, i ), lda, tau( i ), work,
257 CALL slarft(
'Forward',
'Columnwise', m-i+1, ib,
258 $ a( i, i ), lda, tau( i ), work, ldwork )
262 CALL slarfb(
'Left',
'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 sgeqr2( m-i+1, n-i+1, a( i, i ), lda, tau( i ), work,
278 work( 1 ) = sroundup_lwork(iws)
subroutine xerbla(srname, info)
subroutine sgeqr2(m, n, a, lda, tau, work, info)
SGEQR2 computes the QR factorization of a general rectangular matrix using an unblocked algorithm.
subroutine sgeqrf(m, n, a, lda, tau, work, lwork, info)
SGEQRF
subroutine slarfb(side, trans, direct, storev, m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork)
SLARFB applies a block reflector or its transpose to a general rectangular matrix.
subroutine slarft(direct, storev, n, k, v, ldv, tau, t, ldt)
SLARFT forms the triangular factor T of a block reflector H = I - vtvH