164 SUBROUTINE cunmqr( SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC,
165 $ WORK, LWORK, INFO )
172 CHARACTER SIDE, TRANS
173 INTEGER INFO, K, LDA, LDC, LWORK, M, N
176 COMPLEX A( LDA, * ), C( LDC, * ), TAU( * ),
183 INTEGER NBMAX, LDT, TSIZE
184 parameter( nbmax = 64, ldt = nbmax+1,
185 $ tsize = ldt*nbmax )
188 LOGICAL LEFT, LQUERY, NOTRAN
189 INTEGER I, I1, I2, I3, IB, IC, IINFO, IWT, JC, LDWORK,
190 $ lwkopt, mi, nb, nbmin, ni, nq, nw
196 EXTERNAL lsame, ilaenv, sroundup_lwork
209 left = lsame( side,
'L' )
210 notran = lsame( trans,
'N' )
211 lquery = ( lwork.EQ.-1 )
222 IF( .NOT.left .AND. .NOT.lsame( side,
'R' ) )
THEN
224 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans,
'C' ) )
THEN
226 ELSE IF( m.LT.0 )
THEN
228 ELSE IF( n.LT.0 )
THEN
230 ELSE IF( k.LT.0 .OR. k.GT.nq )
THEN
232 ELSE IF( lda.LT.max( 1, nq ) )
THEN
234 ELSE IF( ldc.LT.max( 1, m ) )
THEN
236 ELSE IF( lwork.LT.nw .AND. .NOT.lquery )
THEN
244 nb = min( nbmax, ilaenv( 1,
'CUNMQR', side // trans, m, n,
247 lwkopt = nw*nb + tsize
248 work( 1 ) = sroundup_lwork(lwkopt)
252 CALL xerbla(
'CUNMQR', -info )
254 ELSE IF( lquery )
THEN
260 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
267 IF( nb.GT.1 .AND. nb.LT.k )
THEN
268 IF( lwork.LT.lwkopt )
THEN
269 nb = (lwork-tsize) / ldwork
270 nbmin = max( 2, ilaenv( 2,
'CUNMQR', side // trans, m, n,
276 IF( nb.LT.nbmin .OR. nb.GE.k )
THEN
280 CALL cunm2r( side, trans, m, n, k, a, lda, tau, c, ldc,
288 IF( ( left .AND. .NOT.notran ) .OR.
289 $ ( .NOT.left .AND. notran ) )
THEN
294 i1 = ( ( k-1 ) / nb )*nb + 1
308 ib = min( nb, k-i+1 )
313 CALL clarft(
'Forward',
'Columnwise', nq-i+1, ib, a( i,
315 $ lda, tau( i ), work( iwt ), ldt )
332 CALL clarfb( side, trans,
'Forward',
'Columnwise', mi,
334 $ ib, a( i, i ), lda, work( iwt ), ldt,
335 $ c( ic, jc ), ldc, work, ldwork )
338 work( 1 ) = sroundup_lwork(lwkopt)
subroutine clarfb(side, trans, direct, storev, m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork)
CLARFB applies a block reflector or its conjugate-transpose to a general rectangular matrix.
recursive subroutine clarft(direct, storev, n, k, v, ldv, tau, t, ldt)
CLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine cunm2r(side, trans, m, n, k, a, lda, tau, c, ldc, work, info)
CUNM2R multiplies a general matrix by the unitary matrix from a QR factorization determined by cgeqrf...
subroutine cunmqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
CUNMQR