150 SUBROUTINE dgeqp3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO )
157 INTEGER INFO, LDA, LWORK, M, N
161 DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
167 INTEGER INB, INBMIN, IXOVER
168 parameter( inb = 1, inbmin = 2, ixover = 3 )
172 INTEGER FJB, IWS, J, JB, LWKOPT, MINMN, MINWS, NA, NB,
173 $ NBMIN, NFXD, NX, SM, SMINMN, SN, TOPBMN
180 DOUBLE PRECISION DNRM2
181 EXTERNAL ilaenv, dnrm2
184 INTRINSIC int, max, min
192 lquery = ( lwork.EQ.-1 )
195 ELSE IF( n.LT.0 )
THEN
197 ELSE IF( lda.LT.max( 1, m ) )
THEN
203 IF( minmn.EQ.0 )
THEN
208 nb = ilaenv( inb,
'DGEQRF',
' ', m, n, -1, -1 )
209 lwkopt = 2*n + ( n + 1 )*nb
213 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
219 CALL xerbla(
'DGEQP3', -info )
221 ELSE IF( lquery )
THEN
229 IF( jpvt( j ).NE.0 )
THEN
231 CALL dswap( m, a( 1, j ), 1, a( 1, nfxd ), 1 )
232 jpvt( j ) = jpvt( nfxd )
253 CALL dgeqrf( m, na, a, lda, tau, work, lwork, info )
254 iws = max( iws, int( work( 1 ) ) )
258 CALL dormqr(
'Left',
'Transpose', m, n-na, na, a, lda, tau,
259 $ a( 1, na+1 ), lda, work, lwork, info )
260 iws = max( iws, int( work( 1 ) ) )
267 IF( nfxd.LT.minmn )
THEN
271 sminmn = minmn - nfxd
275 nb = ilaenv( inb,
'DGEQRF',
' ', sm, sn, -1, -1 )
279 IF( ( nb.GT.1 ) .AND. ( nb.LT.sminmn ) )
THEN
283 nx = max( 0, ilaenv( ixover,
'DGEQRF',
' ', sm, sn, -1,
287 IF( nx.LT.sminmn )
THEN
291 minws = 2*sn + ( sn+1 )*nb
292 iws = max( iws, minws )
293 IF( lwork.LT.minws )
THEN
298 nb = ( lwork-2*sn ) / ( sn+1 )
299 nbmin = max( 2, ilaenv( inbmin,
'DGEQRF',
' ', sm, sn,
310 DO 20 j = nfxd + 1, n
311 work( j ) = dnrm2( sm, a( nfxd+1, j ), 1 )
312 work( n+j ) = work( j )
315 IF( ( nb.GE.nbmin ) .AND. ( nb.LT.sminmn ) .AND.
316 $ ( nx.LT.sminmn ) )
THEN
327 IF( j.LE.topbmn )
THEN
328 jb = min( nb, topbmn-j+1 )
332 CALL dlaqps( m, n-j+1, j-1, jb, fjb, a( 1, j ), lda,
333 $ jpvt( j ), tau( j ), work( j ), work( n+j ),
334 $ work( 2*n+1 ), work( 2*n+jb+1 ), n-j+1 )
347 $
CALL dlaqp2( m, n-j+1, j-1, a( 1, j ), lda, jpvt( j ),
348 $ tau( j ), work( j ), work( n+j ),
subroutine xerbla(srname, info)
subroutine dgeqp3(m, n, a, lda, jpvt, tau, work, lwork, info)
DGEQP3
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.
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 dswap(n, dx, incx, dy, incy)
DSWAP
subroutine dormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
DORMQR