127 SUBROUTINE dorgqr( M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
134 INTEGER INFO, K, LDA, LWORK, M, N
137 DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
143 DOUBLE PRECISION ZERO
144 parameter( zero = 0.0d+0 )
148 INTEGER I, IB, IINFO, IWS, J, KI, KK, L, LDWORK,
149 $ LWKOPT, NB, NBMIN, NX
166 nb = ilaenv( 1,
'DORGQR',
' ', m, n, k, -1 )
167 lwkopt = max( 1, n )*nb
169 lquery = ( lwork.EQ.-1 )
172 ELSE IF( n.LT.0 .OR. n.GT.m )
THEN
174 ELSE IF( k.LT.0 .OR. k.GT.n )
THEN
176 ELSE IF( lda.LT.max( 1, m ) )
THEN
178 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
182 CALL xerbla(
'DORGQR', -info )
184 ELSE IF( lquery )
THEN
198 IF( nb.GT.1 .AND. nb.LT.k )
THEN
202 nx = max( 0, ilaenv( 3,
'DORGQR',
' ', m, n, k, -1 ) )
209 IF( lwork.LT.iws )
THEN
215 nbmin = max( 2, ilaenv( 2,
'DORGQR',
' ', m, n, k, -1 ) )
220 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
225 ki = ( ( k-nx-1 ) / nb )*nb
242 $
CALL dorg2r( 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 dlarft(
'Forward',
'Columnwise', m-i+1, ib,
257 $ a( i, i ), lda, tau( i ), work, ldwork )
261 CALL dlarfb(
'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 dorg2r( m-i+1, ib, ib, a( i, i ), lda, tau( i ), work,
274 DO 40 j = i, i + ib - 1
subroutine xerbla(srname, info)
subroutine dlarfb(side, trans, direct, storev, m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork)
DLARFB applies a block reflector or its transpose to a general rectangular matrix.
subroutine dlarft(direct, storev, n, k, v, ldv, tau, t, ldt)
DLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine dorg2r(m, n, k, a, lda, tau, work, info)
DORG2R generates all or part of the orthogonal matrix Q from a QR factorization determined by sgeqrf ...
subroutine dorgqr(m, n, k, a, lda, tau, work, lwork, info)
DORGQR