159 SUBROUTINE zgeqp3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK,
168 INTEGER INFO, LDA, LWORK, M, N
172 DOUBLE PRECISION RWORK( * )
173 COMPLEX*16 A( lda, * ), TAU( * ), WORK( * )
179 INTEGER INB, INBMIN, IXOVER
180 parameter ( inb = 1, inbmin = 2, ixover = 3 )
184 INTEGER FJB, IWS, J, JB, LWKOPT, MINMN, MINWS, NA, NB,
185 $ nbmin, nfxd, nx, sm, sminmn, sn, topbmn
192 DOUBLE PRECISION DZNRM2
193 EXTERNAL ilaenv, dznrm2
196 INTRINSIC int, max, min
204 lquery = ( lwork.EQ.-1 )
207 ELSE IF( n.LT.0 )
THEN
209 ELSE IF( lda.LT.max( 1, m ) )
THEN
215 IF( minmn.EQ.0 )
THEN
220 nb = ilaenv( inb,
'ZGEQRF',
' ', m, n, -1, -1 )
221 lwkopt = ( n + 1 )*nb
223 work( 1 ) = dcmplx( lwkopt )
225 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
231 CALL xerbla(
'ZGEQP3', -info )
233 ELSE IF( lquery )
THEN
241 IF( jpvt( j ).NE.0 )
THEN
243 CALL zswap( m, a( 1, j ), 1, a( 1, nfxd ), 1 )
244 jpvt( j ) = jpvt( nfxd )
265 CALL zgeqrf( m, na, a, lda, tau, work, lwork, info )
266 iws = max( iws, int( work( 1 ) ) )
271 CALL zunmqr(
'Left',
'Conjugate Transpose', m, n-na, na, a,
272 $ lda, tau, a( 1, na+1 ), lda, work, lwork,
274 iws = max( iws, int( work( 1 ) ) )
281 IF( nfxd.LT.minmn )
THEN
285 sminmn = minmn - nfxd
289 nb = ilaenv( inb,
'ZGEQRF',
' ', sm, sn, -1, -1 )
293 IF( ( nb.GT.1 ) .AND. ( nb.LT.sminmn ) )
THEN
297 nx = max( 0, ilaenv( ixover,
'ZGEQRF',
' ', sm, sn, -1,
301 IF( nx.LT.sminmn )
THEN
306 iws = max( iws, minws )
307 IF( lwork.LT.minws )
THEN
312 nb = lwork / ( sn+1 )
313 nbmin = max( 2, ilaenv( inbmin,
'ZGEQRF',
' ', sm, sn,
324 DO 20 j = nfxd + 1, n
325 rwork( j ) = dznrm2( sm, a( nfxd+1, j ), 1 )
326 rwork( n+j ) = rwork( j )
329 IF( ( nb.GE.nbmin ) .AND. ( nb.LT.sminmn ) .AND.
330 $ ( nx.LT.sminmn ) )
THEN
341 IF( j.LE.topbmn )
THEN
342 jb = min( nb, topbmn-j+1 )
346 CALL zlaqps( m, n-j+1, j-1, jb, fjb, a( 1, j ), lda,
347 $ jpvt( j ), tau( j ), rwork( j ),
348 $ rwork( n+j ), work( 1 ), work( jb+1 ),
362 $
CALL zlaqp2( m, n-j+1, j-1, a( 1, j ), lda, jpvt( j ),
363 $ tau( j ), rwork( j ), rwork( n+j ), work( 1 ) )
367 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 zgeqrf(M, N, A, LDA, TAU, WORK, LWORK, INFO)
ZGEQRF VARIANT: left-looking Level 3 BLAS of the algorithm.
subroutine zswap(N, ZX, INCX, ZY, INCY)
ZSWAP
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine zunmqr(SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
ZUNMQR
subroutine zgeqp3(M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK, INFO)
ZGEQP3
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...