167 SUBROUTINE dormqr( SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC,
168 $ work, lwork, info )
176 CHARACTER SIDE, TRANS
177 INTEGER INFO, K, LDA, LDC, LWORK, M, N
180 DOUBLE PRECISION A( lda, * ), C( ldc, * ), TAU( * ), WORK( * )
186 INTEGER NBMAX, LDT, TSIZE
187 parameter ( nbmax = 64, ldt = nbmax+1,
188 $ tsize = ldt*nbmax )
191 LOGICAL LEFT, LQUERY, NOTRAN
192 INTEGER I, I1, I2, I3, IB, IC, IINFO, IWT, JC, LDWORK,
193 $ lwkopt, mi, nb, nbmin, ni, nq, nw
198 EXTERNAL lsame, ilaenv
211 left = lsame( side,
'L' )
212 notran = lsame( trans,
'N' )
213 lquery = ( lwork.EQ.-1 )
224 IF( .NOT.left .AND. .NOT.lsame( side,
'R' ) )
THEN
226 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) )
THEN
228 ELSE IF( m.LT.0 )
THEN
230 ELSE IF( n.LT.0 )
THEN
232 ELSE IF( k.LT.0 .OR. k.GT.nq )
THEN
234 ELSE IF( lda.LT.max( 1, nq ) )
THEN
236 ELSE IF( ldc.LT.max( 1, m ) )
THEN
238 ELSE IF( lwork.LT.max( 1, nw ) .AND. .NOT.lquery )
THEN
246 nb = min( nbmax, ilaenv( 1,
'DORMQR', side // trans, m, n, k,
248 lwkopt = max( 1, nw )*nb + tsize
253 CALL xerbla(
'DORMQR', -info )
255 ELSE IF( lquery )
THEN
261 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
268 IF( nb.GT.1 .AND. nb.LT.k )
THEN
269 IF( lwork.LT.nw*nb+tsize )
THEN
270 nb = (lwork-tsize) / ldwork
271 nbmin = max( 2, ilaenv( 2,
'DORMQR', side // trans, m, n, k,
276 IF( nb.LT.nbmin .OR. nb.GE.k )
THEN
280 CALL dorm2r( side, trans, m, n, k, a, lda, tau, c, ldc, work,
287 IF( ( left .AND. .NOT.notran ) .OR.
288 $ ( .NOT.left .AND. notran ) )
THEN
293 i1 = ( ( k-1 ) / nb )*nb + 1
307 ib = min( nb, k-i+1 )
312 CALL dlarft(
'Forward',
'Columnwise', nq-i+1, ib, a( i, i ),
313 $ lda, tau( i ), work( iwt ), ldt )
330 CALL dlarfb( side, trans,
'Forward',
'Columnwise', mi, ni,
331 $ ib, a( i, i ), lda, work( iwt ), ldt,
332 $ c( ic, jc ), ldc, work, ldwork )
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 dormqr(SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
DORMQR
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 dlarft(DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT)
DLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine xerbla(SRNAME, INFO)
XERBLA