157 SUBROUTINE cgeqp3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK,
165 INTEGER INFO, LDA, LWORK, M, N
170 COMPLEX 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
190 EXTERNAL ilaenv, scnrm2
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,
'CGEQRF',
' ', m, n, -1, -1 )
218 lwkopt = ( n + 1 )*nb
220 work( 1 ) = cmplx( lwkopt )
222 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
228 CALL xerbla(
'CGEQP3', -info )
230 ELSE IF( lquery )
THEN
238 IF( jpvt( j ).NE.0 )
THEN
240 CALL cswap( m, a( 1, j ), 1, a( 1, nfxd ), 1 )
241 jpvt( j ) = jpvt( nfxd )
262 CALL cgeqrf( m, na, a, lda, tau, work, lwork, info )
263 iws = max( iws, int( work( 1 ) ) )
268 CALL cunmqr(
'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,
'CGEQRF',
' ', sm, sn, -1, -1 )
290 IF( ( nb.GT.1 ) .AND. ( nb.LT.sminmn ) )
THEN
294 nx = max( 0, ilaenv( ixover,
'CGEQRF',
' ', 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,
'CGEQRF',
' ', sm, sn,
321 DO 20 j = nfxd + 1, n
322 rwork( j ) = scnrm2( 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 claqps( 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 claqp2( 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 ) = cmplx( lwkopt )
subroutine xerbla(srname, info)
subroutine cgeqp3(m, n, a, lda, jpvt, tau, work, lwork, rwork, info)
CGEQP3
subroutine cgeqrf(m, n, a, lda, tau, work, lwork, info)
CGEQRF
subroutine claqp2(m, n, offset, a, lda, jpvt, tau, vn1, vn2, work)
CLAQP2 computes a QR factorization with column pivoting of the matrix block.
subroutine claqps(m, n, offset, nb, kb, a, lda, jpvt, tau, vn1, vn2, auxv, f, ldf)
CLAQPS computes a step of QR factorization with column pivoting of a real m-by-n matrix A by using BL...
subroutine cswap(n, cx, incx, cy, incy)
CSWAP
subroutine cunmqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
CUNMQR