169 SUBROUTINE dormqr( SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC,
170 $ work, lwork, info )
178 CHARACTER side, trans
179 INTEGER info, k, lda, ldc, lwork, m, n
182 DOUBLE PRECISION a( lda, * ), c( ldc, * ), tau( * ), work( * )
189 parameter( nbmax = 64, ldt = nbmax+1 )
192 LOGICAL left, lquery, notran
193 INTEGER i, i1, i2, i3, ib, ic, iinfo, iws, jc, ldwork,
194 $ lwkopt, mi, nb, nbmin, ni, nq, nw
197 DOUBLE PRECISION t( ldt, nbmax )
215 left =
lsame( side,
'L' )
216 notran =
lsame( trans,
'N' )
217 lquery = ( lwork.EQ.-1 )
228 IF( .NOT.left .AND. .NOT.
lsame( side,
'R' ) )
THEN
230 ELSE IF( .NOT.notran .AND. .NOT.
lsame( trans,
'T' ) )
THEN
232 ELSE IF( m.LT.0 )
THEN
234 ELSE IF( n.LT.0 )
THEN
236 ELSE IF( k.LT.0 .OR. k.GT.nq )
THEN
238 ELSE IF( lda.LT.max( 1, nq ) )
THEN
240 ELSE IF( ldc.LT.max( 1, m ) )
THEN
242 ELSE IF( lwork.LT.max( 1, nw ) .AND. .NOT.lquery )
THEN
251 nb = min( nbmax,
ilaenv( 1,
'DORMQR', side // trans, m, n, k,
253 lwkopt = max( 1, nw )*nb
258 CALL
xerbla(
'DORMQR', -info )
260 ELSE IF( lquery )
THEN
266 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
273 IF( nb.GT.1 .AND. nb.LT.k )
THEN
275 IF( lwork.LT.iws )
THEN
277 nbmin = max( 2,
ilaenv( 2,
'DORMQR', side // trans, m, n, k,
284 IF( nb.LT.nbmin .OR. nb.GE.k )
THEN
288 CALL
dorm2r( side, trans, m, n, k, a, lda, tau, c, ldc, work,
294 IF( ( left .AND. .NOT.notran ) .OR.
295 $ ( .NOT.left .AND. notran ) )
THEN
300 i1 = ( ( k-1 ) / nb )*nb + 1
314 ib = min( nb, k-i+1 )
319 CALL
dlarft(
'Forward',
'Columnwise', nq-i+1, ib, a( i, i ),
320 $ lda, tau( i ), t, ldt )
337 CALL
dlarfb( side, trans,
'Forward',
'Columnwise', mi, ni,
338 $ ib, a( i, i ), lda, t, ldt, c( ic, jc ), ldc,