196 SUBROUTINE sormbr( VECT, SIDE, TRANS, M, N, K, A, LDA, TAU, C,
197 $ ldc, work, lwork, info )
205 CHARACTER side, trans, vect
206 INTEGER info, k, lda, ldc, lwork, m, n
209 REAL a( lda, * ), c( ldc, * ), tau( * ),
216 LOGICAL applyq, left, lquery, notran
218 INTEGER i1, i2, iinfo, lwkopt, mi, nb, ni, nq, nw
236 applyq =
lsame( vect,
'Q' )
237 left =
lsame( side,
'L' )
238 notran =
lsame( trans,
'N' )
239 lquery = ( lwork.EQ.-1 )
250 IF( .NOT.applyq .AND. .NOT.
lsame( vect,
'P' ) )
THEN
252 ELSE IF( .NOT.left .AND. .NOT.
lsame( side,
'R' ) )
THEN
254 ELSE IF( .NOT.notran .AND. .NOT.
lsame( trans,
'T' ) )
THEN
256 ELSE IF( m.LT.0 )
THEN
258 ELSE IF( n.LT.0 )
THEN
260 ELSE IF( k.LT.0 )
THEN
262 ELSE IF( ( applyq .AND. lda.LT.max( 1, nq ) ) .OR.
263 $ ( .NOT.applyq .AND. lda.LT.max( 1, min( nq, k ) ) ) )
266 ELSE IF( ldc.LT.max( 1, m ) )
THEN
268 ELSE IF( lwork.LT.max( 1, nw ) .AND. .NOT.lquery )
THEN
275 nb =
ilaenv( 1,
'SORMQR', side // trans, m-1, n, m-1,
278 nb =
ilaenv( 1,
'SORMQR', side // trans, m, n-1, n-1,
283 nb =
ilaenv( 1,
'SORMLQ', side // trans, m-1, n, m-1,
286 nb =
ilaenv( 1,
'SORMLQ', side // trans, m, n-1, n-1,
290 lwkopt = max( 1, nw )*nb
295 CALL
xerbla(
'SORMBR', -info )
297 ELSE IF( lquery )
THEN
304 IF( m.EQ.0 .OR. n.EQ.0 )
315 CALL
sormqr( side, trans, m, n, k, a, lda, tau, c, ldc,
316 $ work, lwork, iinfo )
317 ELSE IF( nq.GT.1 )
THEN
332 CALL
sormqr( side, trans, mi, ni, nq-1, a( 2, 1 ), lda, tau,
333 $ c( i1, i2 ), ldc, work, lwork, iinfo )
348 CALL
sormlq( side, transt, m, n, k, a, lda, tau, c, ldc,
349 $ work, lwork, iinfo )
350 ELSE IF( nq.GT.1 )
THEN
365 CALL
sormlq( side, transt, mi, ni, nq-1, a( 1, 2 ), lda,
366 $ tau, c( i1, i2 ), ldc, work, lwork, iinfo )