141 SUBROUTINE dgeqpf( M, N, A, LDA, JPVT, TAU, WORK, INFO )
148 INTEGER INFO, LDA, M, N
152 DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
158 DOUBLE PRECISION ZERO, ONE
159 parameter( zero = 0.0d+0, one = 1.0d+0 )
162 INTEGER I, ITEMP, J, MA, MN, PVT
163 DOUBLE PRECISION AII, TEMP, TEMP2, TOL3Z
169 INTRINSIC abs, max, min, sqrt
173 DOUBLE PRECISION DLAMCH, DNRM2
174 EXTERNAL idamax, dlamch, dnrm2
183 ELSE IF( n.LT.0 )
THEN
185 ELSE IF( lda.LT.max( 1, m ) )
THEN
189 CALL xerbla(
'DGEQPF', -info )
194 tol3z = sqrt(dlamch(
'Epsilon'))
200 IF( jpvt( i ).NE.0 )
THEN
201 IF( i.NE.itemp )
THEN
202 CALL dswap( m, a( 1, i ), 1, a( 1, itemp ), 1 )
203 jpvt( i ) = jpvt( itemp )
217 IF( itemp.GT.0 )
THEN
219 CALL dgeqr2( m, ma, a, lda, tau, work, info )
221 CALL dorm2r(
'Left',
'Transpose', m, n-ma, ma, a, lda, tau,
222 $ a( 1, ma+1 ), lda, work, info )
226 IF( itemp.LT.mn )
THEN
231 DO 20 i = itemp + 1, n
232 work( i ) = dnrm2( m-itemp, a( itemp+1, i ), 1 )
233 work( n+i ) = work( i )
238 DO 40 i = itemp + 1, mn
242 pvt = ( i-1 ) + idamax( n-i+1, work( i ), 1 )
245 CALL dswap( m, a( 1, pvt ), 1, a( 1, i ), 1 )
247 jpvt( pvt ) = jpvt( i )
249 work( pvt ) = work( i )
250 work( n+pvt ) = work( n+i )
256 CALL dlarfg( m-i+1, a( i, i ), a( i+1, i ), 1, tau( i ) )
258 CALL dlarfg( 1, a( m, m ), a( m, m ), 1, tau( m ) )
267 CALL dlarf(
'LEFT', m-i+1, n-i, a( i, i ), 1, tau( i ),
268 $ a( i, i+1 ), lda, work( 2*n+1 ) )
275 IF( work( j ).NE.zero )
THEN
280 temp = abs( a( i, j ) ) / work( j )
281 temp = max( zero, ( one+temp )*( one-temp ) )
282 temp2 = temp*( work( j ) / work( n+j ) )**2
283 IF( temp2 .LE. tol3z )
THEN
285 work( j ) = dnrm2( m-i, a( i+1, j ), 1 )
286 work( n+j ) = work( j )
292 work( j ) = work( j )*sqrt( temp )
subroutine xerbla(srname, info)
subroutine dgeqpf(m, n, a, lda, jpvt, tau, work, info)
DGEQPF
subroutine dgeqr2(m, n, a, lda, tau, work, info)
DGEQR2 computes the QR factorization of a general rectangular matrix using an unblocked algorithm.
subroutine dlarf(side, m, n, v, incv, tau, c, ldc, work)
DLARF applies an elementary reflector to a general rectangular matrix.
subroutine dlarfg(n, alpha, x, incx, tau)
DLARFG generates an elementary reflector (Householder matrix).
subroutine dswap(n, dx, incx, dy, incy)
DSWAP
subroutine dorm2r(side, trans, m, n, k, a, lda, tau, c, ldc, work, info)
DORM2R multiplies a general matrix by the orthogonal matrix from a QR factorization determined by sge...