196 SUBROUTINE zunmbr( 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 COMPLEX*16 a( lda, * ), c( ldc, * ), tau( * ), work( * )
215 LOGICAL applyq, left, lquery, notran
217 INTEGER i1, i2, iinfo, lwkopt, mi, nb, ni, nq, nw
235 applyq =
lsame( vect,
'Q' )
236 left =
lsame( side,
'L' )
237 notran =
lsame( trans,
'N' )
238 lquery = ( lwork.EQ.-1 )
249 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
252 IF( .NOT.applyq .AND. .NOT.
lsame( vect,
'P' ) )
THEN
254 ELSE IF( .NOT.left .AND. .NOT.
lsame( side,
'R' ) )
THEN
256 ELSE IF( .NOT.notran .AND. .NOT.
lsame( trans,
'C' ) )
THEN
258 ELSE IF( m.LT.0 )
THEN
260 ELSE IF( n.LT.0 )
THEN
262 ELSE IF( k.LT.0 )
THEN
264 ELSE IF( ( applyq .AND. lda.LT.max( 1, nq ) ) .OR.
265 $ ( .NOT.applyq .AND. lda.LT.max( 1, min( nq, k ) ) ) )
268 ELSE IF( ldc.LT.max( 1, m ) )
THEN
270 ELSE IF( lwork.LT.max( 1, nw ) .AND. .NOT.lquery )
THEN
278 nb =
ilaenv( 1,
'ZUNMQR', side // trans, m-1, n, m-1,
281 nb =
ilaenv( 1,
'ZUNMQR', side // trans, m, n-1, n-1,
286 nb =
ilaenv( 1,
'ZUNMLQ', side // trans, m-1, n, m-1,
289 nb =
ilaenv( 1,
'ZUNMLQ', side // trans, m, n-1, n-1,
293 lwkopt = max( 1, nw*nb )
301 CALL
xerbla(
'ZUNMBR', -info )
303 ELSE IF( lquery )
THEN
309 IF( m.EQ.0 .OR. n.EQ.0 )
320 CALL
zunmqr( side, trans, m, n, k, a, lda, tau, c, ldc,
321 $ work, lwork, iinfo )
322 ELSE IF( nq.GT.1 )
THEN
337 CALL
zunmqr( side, trans, mi, ni, nq-1, a( 2, 1 ), lda, tau,
338 $ c( i1, i2 ), ldc, work, lwork, iinfo )
353 CALL
zunmlq( side, transt, m, n, k, a, lda, tau, c, ldc,
354 $ work, lwork, iinfo )
355 ELSE IF( nq.GT.1 )
THEN
370 CALL
zunmlq( side, transt, mi, ni, nq-1, a( 1, 2 ), lda,
371 $ tau, c( i1, i2 ), ldc, work, lwork, iinfo )