150 SUBROUTINE sgeqp3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, INFO )
157 INTEGER INFO, LDA, LWORK, M, N
161 REAL 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 REAL SNRM2, SROUNDUP_LWORK
181 EXTERNAL ilaenv, snrm2, sroundup_lwork
184 INTRINSIC int, max, min
189 lquery = ( lwork.EQ.-1 )
192 ELSE IF( n.LT.0 )
THEN
194 ELSE IF( lda.LT.max( 1, m ) )
THEN
200 IF( minmn.EQ.0 )
THEN
205 nb = ilaenv( inb,
'SGEQRF',
' ', m, n, -1, -1 )
206 lwkopt = 2*n + ( n + 1 )*nb
208 work( 1 ) = sroundup_lwork(lwkopt)
210 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
216 CALL xerbla(
'SGEQP3', -info )
218 ELSE IF( lquery )
THEN
226 IF( jpvt( j ).NE.0 )
THEN
228 CALL sswap( m, a( 1, j ), 1, a( 1, nfxd ), 1 )
229 jpvt( j ) = jpvt( nfxd )
250 CALL sgeqrf( m, na, a, lda, tau, work, lwork, info )
251 iws = max( iws, int( work( 1 ) ) )
255 CALL sormqr(
'Left',
'Transpose', m, n-na, na, a, lda, tau,
256 $ a( 1, na+1 ), lda, work, lwork, info )
257 iws = max( iws, int( work( 1 ) ) )
264 IF( nfxd.LT.minmn )
THEN
268 sminmn = minmn - nfxd
272 nb = ilaenv( inb,
'SGEQRF',
' ', sm, sn, -1, -1 )
276 IF( ( nb.GT.1 ) .AND. ( nb.LT.sminmn ) )
THEN
280 nx = max( 0, ilaenv( ixover,
'SGEQRF',
' ', sm, sn, -1,
284 IF( nx.LT.sminmn )
THEN
288 minws = 2*sn + ( sn+1 )*nb
289 iws = max( iws, minws )
290 IF( lwork.LT.minws )
THEN
295 nb = ( lwork-2*sn ) / ( sn+1 )
296 nbmin = max( 2, ilaenv( inbmin,
'SGEQRF',
' ', sm, sn,
307 DO 20 j = nfxd + 1, n
308 work( j ) = snrm2( sm, a( nfxd+1, j ), 1 )
309 work( n+j ) = work( j )
312 IF( ( nb.GE.nbmin ) .AND. ( nb.LT.sminmn ) .AND.
313 $ ( nx.LT.sminmn ) )
THEN
324 IF( j.LE.topbmn )
THEN
325 jb = min( nb, topbmn-j+1 )
329 CALL slaqps( m, n-j+1, j-1, jb, fjb, a( 1, j ), lda,
330 $ jpvt( j ), tau( j ), work( j ), work( n+j ),
331 $ work( 2*n+1 ), work( 2*n+jb+1 ), n-j+1 )
344 $
CALL slaqp2( m, n-j+1, j-1, a( 1, j ), lda, jpvt( j ),
345 $ tau( j ), work( j ), work( n+j ),
350 work( 1 ) = sroundup_lwork(iws)
subroutine xerbla(srname, info)
subroutine sgeqp3(m, n, a, lda, jpvt, tau, work, lwork, info)
SGEQP3
subroutine sgeqrf(m, n, a, lda, tau, work, lwork, info)
SGEQRF
subroutine slaqp2(m, n, offset, a, lda, jpvt, tau, vn1, vn2, work)
SLAQP2 computes a QR factorization with column pivoting of the matrix block.
subroutine slaqps(m, n, offset, nb, kb, a, lda, jpvt, tau, vn1, vn2, auxv, f, ldf)
SLAQPS computes a step of QR factorization with column pivoting of a real m-by-n matrix A by using BL...
subroutine sswap(n, sx, incx, sy, incy)
SSWAP
subroutine sormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
SORMQR