125 SUBROUTINE sorgqr( M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
132 INTEGER INFO, K, LDA, LWORK, M, N
135 REAL A( LDA, * ), TAU( * ), WORK( * )
142 parameter( zero = 0.0e+0 )
146 INTEGER I, IB, IINFO, IWS, J, KI, KK, L, LDWORK,
147 $ LWKOPT, NB, NBMIN, NX
158 EXTERNAL ilaenv, sroundup_lwork
165 nb = ilaenv( 1,
'SORGQR',
' ', m, n, k, -1 )
166 lwkopt = max( 1, n )*nb
167 work( 1 ) = sroundup_lwork(lwkopt)
168 lquery = ( lwork.EQ.-1 )
171 ELSE IF( n.LT.0 .OR. n.GT.m )
THEN
173 ELSE IF( k.LT.0 .OR. k.GT.n )
THEN
175 ELSE IF( lda.LT.max( 1, m ) )
THEN
177 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
181 CALL xerbla(
'SORGQR', -info )
183 ELSE IF( lquery )
THEN
197 IF( nb.GT.1 .AND. nb.LT.k )
THEN
201 nx = max( 0, ilaenv( 3,
'SORGQR',
' ', m, n, k, -1 ) )
208 IF( lwork.LT.iws )
THEN
214 nbmin = max( 2, ilaenv( 2,
'SORGQR',
' ', m, n, k,
220 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
225 ki = ( ( k-nx-1 ) / nb )*nb
242 $
CALL sorg2r( m-kk, n-kk, k-kk, a( kk+1, kk+1 ), lda,
243 $ tau( kk+1 ), work, iinfo )
249 DO 50 i = ki + 1, 1, -nb
250 ib = min( nb, k-i+1 )
256 CALL slarft(
'Forward',
'Columnwise', m-i+1, ib,
257 $ a( i, i ), lda, tau( i ), work, ldwork )
261 CALL slarfb(
'Left',
'No transpose',
'Forward',
262 $
'Columnwise', m-i+1, n-i-ib+1, ib,
263 $ a( i, i ), lda, work, ldwork, a( i, i+ib ),
264 $ lda, work( ib+1 ), ldwork )
269 CALL sorg2r( m-i+1, ib, ib, a( i, i ), lda, tau( i ),
275 DO 40 j = i, i + ib - 1
283 work( 1 ) = sroundup_lwork(iws)
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.
recursive subroutine slarft(direct, storev, n, k, v, ldv, tau, t, ldt)
SLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine sorg2r(m, n, k, a, lda, tau, work, info)
SORG2R generates all or part of the orthogonal matrix Q from a QR factorization determined by sgeqrf ...
subroutine sorgqr(m, n, k, a, lda, tau, work, lwork, info)
SORGQR