170 SUBROUTINE sormqr( SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC,
171 $ work, lwork, info )
179 CHARACTER side, trans
180 INTEGER info, k, lda, ldc, lwork, m, n
183 REAL a( lda, * ), c( ldc, * ), tau( * ),
191 parameter( nbmax = 64, ldt = nbmax+1 )
194 LOGICAL left, lquery, notran
195 INTEGER i, i1, i2, i3, ib, ic, iinfo, iws, jc, ldwork,
196 $ lwkopt, mi, nb, nbmin, ni, nq, nw
217 left =
lsame( side,
'L' )
218 notran =
lsame( trans,
'N' )
219 lquery = ( lwork.EQ.-1 )
230 IF( .NOT.left .AND. .NOT.
lsame( side,
'R' ) )
THEN
232 ELSE IF( .NOT.notran .AND. .NOT.
lsame( trans,
'T' ) )
THEN
234 ELSE IF( m.LT.0 )
THEN
236 ELSE IF( n.LT.0 )
THEN
238 ELSE IF( k.LT.0 .OR. k.GT.nq )
THEN
240 ELSE IF( lda.LT.max( 1, nq ) )
THEN
242 ELSE IF( ldc.LT.max( 1, m ) )
THEN
244 ELSE IF( lwork.LT.max( 1, nw ) .AND. .NOT.lquery )
THEN
253 nb = min( nbmax,
ilaenv( 1,
'SORMQR', side // trans, m, n, k,
255 lwkopt = max( 1, nw )*nb
260 CALL
xerbla(
'SORMQR', -info )
262 ELSE IF( lquery )
THEN
268 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
275 IF( nb.GT.1 .AND. nb.LT.k )
THEN
277 IF( lwork.LT.iws )
THEN
279 nbmin = max( 2,
ilaenv( 2,
'SORMQR', side // trans, m, n, k,
286 IF( nb.LT.nbmin .OR. nb.GE.k )
THEN
290 CALL
sorm2r( side, trans, m, n, k, a, lda, tau, c, ldc, work,
296 IF( ( left .AND. .NOT.notran ) .OR.
297 $ ( .NOT.left .AND. notran ) )
THEN
302 i1 = ( ( k-1 ) / nb )*nb + 1
316 ib = min( nb, k-i+1 )
321 CALL
slarft(
'Forward',
'Columnwise', nq-i+1, ib, a( i, i ),
322 $ lda, tau( i ), t, ldt )
339 CALL
slarfb( side, trans,
'Forward',
'Columnwise', mi, ni,
340 $ ib, a( i, i ), lda, t, ldt, c( ic, jc ), ldc,