155 SUBROUTINE zgeqp3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK,
163 INTEGER INFO, LDA, LWORK, M, N
167 DOUBLE PRECISION RWORK( * )
168 COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
174 INTEGER INB, INBMIN, IXOVER
175 parameter( inb = 1, inbmin = 2, ixover = 3 )
179 INTEGER FJB, IWS, J, JB, LWKOPT, MINMN, MINWS, NA, NB,
180 $ nbmin, nfxd, nx, sm, sminmn, sn, topbmn
188 DOUBLE PRECISION DZNRM2
189 EXTERNAL ilaenv, dznrm2
192 INTRINSIC int, max, min
200 lquery = ( lwork.EQ.-1 )
203 ELSE IF( n.LT.0 )
THEN
205 ELSE IF( lda.LT.max( 1, m ) )
THEN
211 IF( minmn.EQ.0 )
THEN
216 nb = ilaenv( inb,
'ZGEQRF',
' ', m, n, -1, -1 )
217 lwkopt = ( n + 1 )*nb
219 work( 1 ) = dcmplx( lwkopt )
221 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
227 CALL xerbla(
'ZGEQP3', -info )
229 ELSE IF( lquery )
THEN
237 IF( jpvt( j ).NE.0 )
THEN
239 CALL zswap( m, a( 1, j ), 1, a( 1, nfxd ), 1 )
240 jpvt( j ) = jpvt( nfxd )
261 CALL zgeqrf( m, na, a, lda, tau, work, lwork, info )
262 iws = max( iws, int( work( 1 ) ) )
267 CALL zunmqr(
'Left',
'Conjugate Transpose', m, n-na, na,
269 $ lda, tau, a( 1, na+1 ), lda, work, lwork,
271 iws = max( iws, int( work( 1 ) ) )
278 IF( nfxd.LT.minmn )
THEN
282 sminmn = minmn - nfxd
286 nb = ilaenv( inb,
'ZGEQRF',
' ', sm, sn, -1, -1 )
290 IF( ( nb.GT.1 ) .AND. ( nb.LT.sminmn ) )
THEN
294 nx = max( 0, ilaenv( ixover,
'ZGEQRF',
' ', sm, sn, -1,
298 IF( nx.LT.sminmn )
THEN
303 iws = max( iws, minws )
304 IF( lwork.LT.minws )
THEN
309 nb = lwork / ( sn+1 )
310 nbmin = max( 2, ilaenv( inbmin,
'ZGEQRF',
' ', sm,
322 DO 20 j = nfxd + 1, n
323 rwork( j ) = dznrm2( sm, a( nfxd+1, j ), 1 )
324 rwork( n+j ) = rwork( j )
327 IF( ( nb.GE.nbmin ) .AND. ( nb.LT.sminmn ) .AND.
328 $ ( nx.LT.sminmn ) )
THEN
339 IF( j.LE.topbmn )
THEN
340 jb = min( nb, topbmn-j+1 )
344 CALL zlaqps( m, n-j+1, j-1, jb, fjb, a( 1, j ), lda,
345 $ jpvt( j ), tau( j ), rwork( j ),
346 $ rwork( n+j ), work( 1 ), work( jb+1 ),
360 $
CALL zlaqp2( m, n-j+1, j-1, a( 1, j ), lda, jpvt( j ),
361 $ tau( j ), rwork( j ), rwork( n+j ), work( 1 ) )
365 work( 1 ) = dcmplx( lwkopt )
subroutine zlaqp2(m, n, offset, a, lda, jpvt, tau, vn1, vn2, work)
ZLAQP2 computes a QR factorization with column pivoting of the matrix block.
subroutine zlaqps(m, n, offset, nb, kb, a, lda, jpvt, tau, vn1, vn2, auxv, f, ldf)
ZLAQPS computes a step of QR factorization with column pivoting of a real m-by-n matrix A by using BL...
subroutine zunmqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
ZUNMQR