157 SUBROUTINE zgeqp3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK,
165 INTEGER INFO, LDA, LWORK, M, N
169 DOUBLE PRECISION RWORK( * )
170 COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
176 INTEGER INB, INBMIN, IXOVER
177 parameter( inb = 1, inbmin = 2, ixover = 3 )
181 INTEGER FJB, IWS, J, JB, LWKOPT, MINMN, MINWS, NA, NB,
182 $ nbmin, nfxd, nx, sm, sminmn, sn, topbmn
189 DOUBLE PRECISION DZNRM2
190 EXTERNAL ilaenv, dznrm2
193 INTRINSIC int, max, min
201 lquery = ( lwork.EQ.-1 )
204 ELSE IF( n.LT.0 )
THEN
206 ELSE IF( lda.LT.max( 1, m ) )
THEN
212 IF( minmn.EQ.0 )
THEN
217 nb = ilaenv( inb,
'ZGEQRF',
' ', m, n, -1, -1 )
218 lwkopt = ( n + 1 )*nb
220 work( 1 ) = dcmplx( lwkopt )
222 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
228 CALL xerbla(
'ZGEQP3', -info )
230 ELSE IF( lquery )
THEN
238 IF( jpvt( j ).NE.0 )
THEN
240 CALL zswap( m, a( 1, j ), 1, a( 1, nfxd ), 1 )
241 jpvt( j ) = jpvt( nfxd )
262 CALL zgeqrf( m, na, a, lda, tau, work, lwork, info )
263 iws = max( iws, int( work( 1 ) ) )
268 CALL zunmqr(
'Left',
'Conjugate Transpose', m, n-na, na, a,
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, sn,
321 DO 20 j = nfxd + 1, n
322 rwork( j ) = dznrm2( sm, a( nfxd+1, j ), 1 )
323 rwork( n+j ) = rwork( j )
326 IF( ( nb.GE.nbmin ) .AND. ( nb.LT.sminmn ) .AND.
327 $ ( nx.LT.sminmn ) )
THEN
338 IF( j.LE.topbmn )
THEN
339 jb = min( nb, topbmn-j+1 )
343 CALL zlaqps( m, n-j+1, j-1, jb, fjb, a( 1, j ), lda,
344 $ jpvt( j ), tau( j ), rwork( j ),
345 $ rwork( n+j ), work( 1 ), work( jb+1 ),
359 $
CALL zlaqp2( m, n-j+1, j-1, a( 1, j ), lda, jpvt( j ),
360 $ tau( j ), rwork( j ), rwork( n+j ), work( 1 ) )
364 work( 1 ) = dcmplx( lwkopt )
subroutine xerbla(srname, info)
subroutine zgeqp3(m, n, a, lda, jpvt, tau, work, lwork, rwork, info)
ZGEQP3
subroutine zgeqrf(m, n, a, lda, tau, work, lwork, info)
ZGEQRF
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 zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine zunmqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
ZUNMQR