165 SUBROUTINE dormqr( SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC,
166 $ WORK, LWORK, INFO )
173 CHARACTER SIDE, TRANS
174 INTEGER INFO, K, LDA, LDC, LWORK, M, N
177 DOUBLE PRECISION A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
183 INTEGER NBMAX, LDT, TSIZE
184 parameter( nbmax = 64, ldt = nbmax+1,
185 $ tsize = ldt*nbmax )
188 LOGICAL LEFT, LQUERY, NOTRAN
189 INTEGER I, I1, I2, I3, IB, IC, IINFO, IWT, JC, LDWORK,
190 $ lwkopt, mi, nb, nbmin, ni, nq, nw
195 EXTERNAL lsame, ilaenv
208 left = lsame( side,
'L' )
209 notran = lsame( trans,
'N' )
210 lquery = ( lwork.EQ.-1 )
221 IF( .NOT.left .AND. .NOT.lsame( side,
'R' ) )
THEN
223 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) )
THEN
225 ELSE IF( m.LT.0 )
THEN
227 ELSE IF( n.LT.0 )
THEN
229 ELSE IF( k.LT.0 .OR. k.GT.nq )
THEN
231 ELSE IF( lda.LT.max( 1, nq ) )
THEN
233 ELSE IF( ldc.LT.max( 1, m ) )
THEN
235 ELSE IF( lwork.LT.nw .AND. .NOT.lquery )
THEN
243 nb = min( nbmax, ilaenv( 1,
'DORMQR', side // trans, m, n, k,
245 lwkopt = nw*nb + tsize
250 CALL xerbla(
'DORMQR', -info )
252 ELSE IF( lquery )
THEN
258 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
265 IF( nb.GT.1 .AND. nb.LT.k )
THEN
266 IF( lwork.LT.lwkopt )
THEN
267 nb = (lwork-tsize) / ldwork
268 nbmin = max( 2, ilaenv( 2,
'DORMQR', side // trans, m, n, k,
273 IF( nb.LT.nbmin .OR. nb.GE.k )
THEN
277 CALL dorm2r( side, trans, m, n, k, a, lda, tau, c, ldc, work,
284 IF( ( left .AND. .NOT.notran ) .OR.
285 $ ( .NOT.left .AND. notran ) )
THEN
290 i1 = ( ( k-1 ) / nb )*nb + 1
304 ib = min( nb, k-i+1 )
309 CALL dlarft(
'Forward',
'Columnwise', nq-i+1, ib, a( i, i ),
310 $ lda, tau( i ), work( iwt ), ldt )
327 CALL dlarfb( side, trans,
'Forward',
'Columnwise', mi, ni,
328 $ ib, a( i, i ), lda, work( iwt ), ldt,
329 $ c( ic, jc ), ldc, work, ldwork )
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 dorm2r(side, trans, m, n, k, a, lda, tau, c, ldc, work, info)
DORM2R multiplies a general matrix by the orthogonal matrix from a QR factorization determined by sge...
subroutine dormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
DORMQR