152 SUBROUTINE dgeqp3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO )
160 INTEGER INFO, LDA, LWORK, M, N
164 DOUBLE PRECISION A( lda, * ), TAU( * ), WORK( * )
170 INTEGER INB, INBMIN, IXOVER
171 parameter ( inb = 1, inbmin = 2, ixover = 3 )
175 INTEGER FJB, IWS, J, JB, LWKOPT, MINMN, MINWS, NA, NB,
176 $ nbmin, nfxd, nx, sm, sminmn, sn, topbmn
183 DOUBLE PRECISION DNRM2
184 EXTERNAL ilaenv, dnrm2
187 INTRINSIC int, max, min
195 lquery = ( lwork.EQ.-1 )
198 ELSE IF( n.LT.0 )
THEN
200 ELSE IF( lda.LT.max( 1, m ) )
THEN
206 IF( minmn.EQ.0 )
THEN
211 nb = ilaenv( inb,
'DGEQRF',
' ', m, n, -1, -1 )
212 lwkopt = 2*n + ( n + 1 )*nb
216 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
222 CALL xerbla(
'DGEQP3', -info )
224 ELSE IF( lquery )
THEN
232 IF( jpvt( j ).NE.0 )
THEN
234 CALL dswap( m, a( 1, j ), 1, a( 1, nfxd ), 1 )
235 jpvt( j ) = jpvt( nfxd )
256 CALL dgeqrf( m, na, a, lda, tau, work, lwork, info )
257 iws = max( iws, int( work( 1 ) ) )
261 CALL dormqr(
'Left',
'Transpose', m, n-na, na, a, lda, tau,
262 $ a( 1, na+1 ), lda, work, lwork, info )
263 iws = max( iws, int( work( 1 ) ) )
270 IF( nfxd.LT.minmn )
THEN
274 sminmn = minmn - nfxd
278 nb = ilaenv( inb,
'DGEQRF',
' ', sm, sn, -1, -1 )
282 IF( ( nb.GT.1 ) .AND. ( nb.LT.sminmn ) )
THEN
286 nx = max( 0, ilaenv( ixover,
'DGEQRF',
' ', sm, sn, -1,
290 IF( nx.LT.sminmn )
THEN
294 minws = 2*sn + ( sn+1 )*nb
295 iws = max( iws, minws )
296 IF( lwork.LT.minws )
THEN
301 nb = ( lwork-2*sn ) / ( sn+1 )
302 nbmin = max( 2, ilaenv( inbmin,
'DGEQRF',
' ', sm, sn,
313 DO 20 j = nfxd + 1, n
314 work( j ) = dnrm2( sm, a( nfxd+1, j ), 1 )
315 work( n+j ) = work( j )
318 IF( ( nb.GE.nbmin ) .AND. ( nb.LT.sminmn ) .AND.
319 $ ( nx.LT.sminmn ) )
THEN
330 IF( j.LE.topbmn )
THEN
331 jb = min( nb, topbmn-j+1 )
335 CALL dlaqps( m, n-j+1, j-1, jb, fjb, a( 1, j ), lda,
336 $ jpvt( j ), tau( j ), work( j ), work( n+j ),
337 $ work( 2*n+1 ), work( 2*n+jb+1 ), n-j+1 )
350 $
CALL dlaqp2( m, n-j+1, j-1, a( 1, j ), lda, jpvt( j ),
351 $ tau( j ), work( j ), work( n+j ),
subroutine dgeqp3(M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO)
DGEQP3
subroutine dormqr(SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
DORMQR
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine dswap(N, DX, INCX, DY, INCY)
DSWAP
subroutine dlaqps(M, N, OFFSET, NB, KB, A, LDA, JPVT, TAU, VN1, VN2, AUXV, F, LDF)
DLAQPS computes a step of QR factorization with column pivoting of a real m-by-n matrix A by using BL...
subroutine dgeqrf(M, N, A, LDA, TAU, WORK, LWORK, INFO)
DGEQRF
subroutine dlaqp2(M, N, OFFSET, A, LDA, JPVT, TAU, VN1, VN2, WORK)
DLAQP2 computes a QR factorization with column pivoting of the matrix block.