147 SUBROUTINE zgeqpf( M, N, A, LDA, JPVT, TAU, WORK, RWORK, INFO )
154 INTEGER INFO, LDA, M, N
158 DOUBLE PRECISION RWORK( * )
159 COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
165 DOUBLE PRECISION ZERO, ONE
166 parameter( zero = 0.0d+0, one = 1.0d+0 )
169 INTEGER I, ITEMP, J, MA, MN, PVT
170 DOUBLE PRECISION TEMP, TEMP2, TOL3Z
177 INTRINSIC abs, dcmplx, dconjg, max, min, sqrt
181 DOUBLE PRECISION DLAMCH, DZNRM2
182 EXTERNAL idamax, dlamch, dznrm2
191 ELSE IF( n.LT.0 )
THEN
193 ELSE IF( lda.LT.max( 1, m ) )
THEN
197 CALL xerbla(
'ZGEQPF', -info )
202 tol3z = sqrt(dlamch(
'Epsilon'))
208 IF( jpvt( i ).NE.0 )
THEN
209 IF( i.NE.itemp )
THEN
210 CALL zswap( m, a( 1, i ), 1, a( 1, itemp ), 1 )
211 jpvt( i ) = jpvt( itemp )
225 IF( itemp.GT.0 )
THEN
227 CALL zgeqr2( m, ma, a, lda, tau, work, info )
229 CALL zunm2r(
'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 ) = dznrm2( m-itemp, a( itemp+1, i ), 1 )
241 rwork( n+i ) = rwork( i )
246 DO 40 i = itemp + 1, mn
250 pvt = ( i-1 ) + idamax( n-i+1, rwork( i ), 1 )
253 CALL zswap( 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 zlarfg( m-i+1, aii, a( min( i+1, m ), i ), 1,
273 a( i, i ) = dcmplx( one )
274 CALL zlarf(
'Left', m-i+1, n-i, a( i, i ), 1,
275 $ dconjg( 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 ) = dznrm2( 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 zgeqr2(m, n, a, lda, tau, work, info)
ZGEQR2 computes the QR factorization of a general rectangular matrix using an unblocked algorithm.
subroutine zlarf(side, m, n, v, incv, tau, c, ldc, work)
ZLARF applies an elementary reflector to a general rectangular matrix.
subroutine zlarfg(n, alpha, x, incx, tau)
ZLARFG generates an elementary reflector (Householder matrix).
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP
subroutine zunm2r(side, trans, m, n, k, a, lda, tau, c, ldc, work, info)
ZUNM2R multiplies a general matrix by the unitary matrix from a QR factorization determined by cgeqrf...
subroutine zgeqpf(m, n, a, lda, jpvt, tau, work, rwork, info)
ZGEQPF