142 SUBROUTINE sgelqf( M, N, A, LDA, TAU, WORK, LWORK, INFO )
149 INTEGER INFO, LDA, LWORK, M, N
152 REAL A( LDA, * ), TAU( * ), WORK( * )
159 INTEGER I, IB, IINFO, IWS, K, LDWORK, LWKOPT, NB,
171 EXTERNAL ilaenv, sroundup_lwork
178 nb = ilaenv( 1,
'SGELQF',
' ', 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(
'SGELQF', -info )
194 ELSE IF( lquery )
THEN
209 IF( nb.GT.1 .AND. nb.LT.k )
THEN
213 nx = max( 0, ilaenv( 3,
'SGELQF',
' ', m, n, -1, -1 ) )
220 IF( lwork.LT.iws )
THEN
226 nbmin = max( 2, ilaenv( 2,
'SGELQF',
' ', 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 sgelq2( ib, n-i+1, a( i, i ), lda, tau( i ), work,
249 CALL slarft(
'Forward',
'Rowwise', n-i+1, ib, a( i, i ),
250 $ lda, tau( i ), work, ldwork )
254 CALL slarfb(
'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 sgelq2( m-i+1, n-i+1, a( i, i ), lda, tau( i ), work,
270 work( 1 ) = sroundup_lwork(iws)
subroutine xerbla(srname, info)
subroutine sgelq2(m, n, a, lda, tau, work, info)
SGELQ2 computes the LQ factorization of a general rectangular matrix using an unblocked algorithm.
subroutine sgelqf(m, n, a, lda, tau, work, lwork, info)
SGELQF
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