170 SUBROUTINE cunmrq( 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 COMPLEX a( lda, * ), c( ldc, * ), tau( * ),
191 parameter( nbmax = 64, ldt = nbmax+1 )
194 LOGICAL left, lquery, notran
196 INTEGER i, i1, i2, i3, ib, iinfo, iws, ldwork, lwkopt,
197 $ mi, nb, nbmin, ni, nq, nw
200 COMPLEX t( ldt, nbmax )
218 left =
lsame( side,
'L' )
219 notran =
lsame( trans,
'N' )
220 lquery = ( lwork.EQ.-1 )
231 IF( .NOT.left .AND. .NOT.
lsame( side,
'R' ) )
THEN
233 ELSE IF( .NOT.notran .AND. .NOT.
lsame( trans,
'C' ) )
THEN
235 ELSE IF( m.LT.0 )
THEN
237 ELSE IF( n.LT.0 )
THEN
239 ELSE IF( k.LT.0 .OR. k.GT.nq )
THEN
241 ELSE IF( lda.LT.max( 1, k ) )
THEN
243 ELSE IF( ldc.LT.max( 1, m ) )
THEN
248 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
255 nb = min( nbmax,
ilaenv( 1,
'CUNMRQ', side // trans, m, n,
261 IF( lwork.LT.nw .AND. .NOT.lquery )
THEN
267 CALL
xerbla(
'CUNMRQ', -info )
269 ELSE IF( lquery )
THEN
275 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
281 IF( nb.GT.1 .AND. nb.LT.k )
THEN
283 IF( lwork.LT.iws )
THEN
285 nbmin = max( 2,
ilaenv( 2,
'CUNMRQ', side // trans, m, n, k,
292 IF( nb.LT.nbmin .OR. nb.GE.k )
THEN
296 CALL
cunmr2( side, trans, m, n, k, a, lda, tau, c, ldc, work,
302 IF( ( left .AND. .NOT.notran ) .OR.
303 $ ( .NOT.left .AND. notran ) )
THEN
308 i1 = ( ( k-1 ) / nb )*nb + 1
326 ib = min( nb, k-i+1 )
331 CALL
clarft(
'Backward',
'Rowwise', nq-k+i+ib-1, ib,
332 $ a( i, 1 ), lda, tau( i ), t, ldt )
337 mi = m - k + i + ib - 1
342 ni = n - k + i + ib - 1
347 CALL
clarfb( side, transt,
'Backward',
'Rowwise', mi, ni,
348 $ ib, a( i, 1 ), lda, t, ldt, c, ldc, work,