147 SUBROUTINE cgeqpf( M, N, A, LDA, JPVT, TAU, WORK, RWORK, INFO )
154 INTEGER INFO, LDA, M, N
159 COMPLEX A( LDA, * ), TAU( * ), WORK( * )
166 parameter( zero = 0.0e+0, one = 1.0e+0 )
169 INTEGER I, ITEMP, J, MA, MN, PVT
170 REAL TEMP, TEMP2, TOL3Z
177 INTRINSIC abs, cmplx, conjg, max, min, sqrt
182 EXTERNAL isamax, scnrm2, slamch
191 ELSE IF( n.LT.0 )
THEN
193 ELSE IF( lda.LT.max( 1, m ) )
THEN
197 CALL xerbla(
'CGEQPF', -info )
202 tol3z = sqrt(slamch(
'Epsilon'))
208 IF( jpvt( i ).NE.0 )
THEN
209 IF( i.NE.itemp )
THEN
210 CALL cswap( m, a( 1, i ), 1, a( 1, itemp ), 1 )
211 jpvt( i ) = jpvt( itemp )
225 IF( itemp.GT.0 )
THEN
227 CALL cgeqr2( m, ma, a, lda, tau, work, info )
229 CALL cunm2r(
'Left',
'Conjugate transpose', m, n-ma, ma, a,
230 $ lda, tau, a( 1, ma+1 ), lda, work, info )
234 IF( itemp.LT.mn )
THEN
239 DO 20 i = itemp + 1, n
240 rwork( i ) = scnrm2( m-itemp, a( itemp+1, i ), 1 )
241 rwork( n+i ) = rwork( i )
246 DO 40 i = itemp + 1, mn
250 pvt = ( i-1 ) + isamax( n-i+1, rwork( i ), 1 )
253 CALL cswap( m, a( 1, pvt ), 1, a( 1, i ), 1 )
255 jpvt( pvt ) = jpvt( i )
257 rwork( pvt ) = rwork( i )
258 rwork( n+pvt ) = rwork( n+i )
264 CALL clarfg( m-i+1, aii, a( min( i+1, m ), i ), 1,
273 a( i, i ) = cmplx( one )
274 CALL clarf(
'Left', m-i+1, n-i, a( i, i ), 1,
275 $ conjg( tau( i ) ), a( i, i+1 ), lda, work )
282 IF( rwork( j ).NE.zero )
THEN
287 temp = abs( a( i, j ) ) / rwork( j )
288 temp = max( zero, ( one+temp )*( one-temp ) )
289 temp2 = temp*( rwork( j ) / rwork( n+j ) )**2
290 IF( temp2 .LE. tol3z )
THEN
292 rwork( j ) = scnrm2( m-i, a( i+1, j ), 1 )
293 rwork( n+j ) = rwork( j )
299 rwork( j ) = rwork( j )*sqrt( temp )
subroutine xerbla(srname, info)
subroutine cgeqpf(m, n, a, lda, jpvt, tau, work, rwork, info)
CGEQPF
subroutine cgeqr2(m, n, a, lda, tau, work, info)
CGEQR2 computes the QR factorization of a general rectangular matrix using an unblocked algorithm.
subroutine clarf(side, m, n, v, incv, tau, c, ldc, work)
CLARF applies an elementary reflector to a general rectangular matrix.
subroutine clarfg(n, alpha, x, incx, tau)
CLARFG generates an elementary reflector (Householder matrix).
subroutine cswap(n, cx, incx, cy, incy)
CSWAP
subroutine cunm2r(side, trans, m, n, k, a, lda, tau, c, ldc, work, info)
CUNM2R multiplies a general matrix by the unitary matrix from a QR factorization determined by cgeqrf...