159 SUBROUTINE cgeqp3( M, N, A, LDA, JPVT, TAU, WORK, LWORK, RWORK,
168 INTEGER INFO, LDA, LWORK, M, N
173 COMPLEX 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
193 EXTERNAL ilaenv, scnrm2
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,
'CGEQRF',
' ', m, n, -1, -1 )
221 lwkopt = ( n + 1 )*nb
223 work( 1 ) = cmplx( lwkopt )
225 IF( ( lwork.LT.iws ) .AND. .NOT.lquery )
THEN
231 CALL xerbla(
'CGEQP3', -info )
233 ELSE IF( lquery )
THEN
241 IF( jpvt( j ).NE.0 )
THEN
243 CALL cswap( m, a( 1, j ), 1, a( 1, nfxd ), 1 )
244 jpvt( j ) = jpvt( nfxd )
265 CALL cgeqrf( m, na, a, lda, tau, work, lwork, info )
266 iws = max( iws, int( work( 1 ) ) )
271 CALL cunmqr(
'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,
'CGEQRF',
' ', sm, sn, -1, -1 )
293 IF( ( nb.GT.1 ) .AND. ( nb.LT.sminmn ) )
THEN
297 nx = max( 0, ilaenv( ixover,
'CGEQRF',
' ', 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,
'CGEQRF',
' ', sm, sn,
324 DO 20 j = nfxd + 1, n
325 rwork( j ) = scnrm2( 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 claqps( 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 claqp2( 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 ) = cmplx( lwkopt )
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 xerbla(SRNAME, INFO)
XERBLA
subroutine cunmqr(SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
CUNMQR
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 cswap(N, CX, INCX, CY, INCY)
CSWAP