136 SUBROUTINE dgerqf( M, N, A, LDA, TAU, WORK, LWORK, INFO )
143 INTEGER INFO, LDA, LWORK, M, N
146 DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
153 INTEGER I, IB, IINFO, IWS, K, KI, KK, LDWORK, LWKOPT,
154 $ MU, NB, NBMIN, NU, NX
171 lquery = ( lwork.EQ.-1 )
174 ELSE IF( n.LT.0 )
THEN
176 ELSE IF( lda.LT.max( 1, m ) )
THEN
185 nb = ilaenv( 1,
'DGERQF',
' ', m, n, -1, -1 )
190 IF( .NOT.lquery )
THEN
191 IF( lwork.LE.0 .OR. ( n.GT.0 .AND. lwork.LT.max( 1, m ) ) )
197 CALL xerbla(
'DGERQF', -info )
199 ELSE IF( lquery )
THEN
212 IF( nb.GT.1 .AND. nb.LT.k )
THEN
216 nx = max( 0, ilaenv( 3,
'DGERQF',
' ', m, n, -1, -1 ) )
223 IF( lwork.LT.iws )
THEN
229 nbmin = max( 2, ilaenv( 2,
'DGERQF',
' ', m, n, -1,
235 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
240 ki = ( ( k-nx-1 ) / nb )*nb
243 DO 10 i = k - kk + ki + 1, k - kk + 1, -nb
244 ib = min( k-i+1, nb )
249 CALL dgerq2( ib, n-k+i+ib-1, a( m-k+i, 1 ), lda,
252 IF( m-k+i.GT.1 )
THEN
257 CALL dlarft(
'Backward',
'Rowwise', n-k+i+ib-1, ib,
258 $ a( m-k+i, 1 ), lda, tau( i ), work, ldwork )
262 CALL dlarfb(
'Right',
'No transpose',
'Backward',
263 $
'Rowwise', m-k+i-1, n-k+i+ib-1, ib,
264 $ a( m-k+i, 1 ), lda, work, ldwork, a, lda,
265 $ work( ib+1 ), ldwork )
268 mu = m - k + i + nb - 1
269 nu = n - k + i + nb - 1
277 IF( mu.GT.0 .AND. nu.GT.0 )
278 $
CALL dgerq2( mu, nu, a, lda, tau, work, iinfo )
subroutine dgerq2(m, n, a, lda, tau, work, info)
DGERQ2 computes the RQ factorization of a general rectangular matrix using an unblocked algorithm.
subroutine dgerqf(m, n, a, lda, tau, work, lwork, info)
DGERQF
subroutine dlarfb(side, trans, direct, storev, m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork)
DLARFB applies a block reflector or its transpose to a general rectangular matrix.
recursive subroutine dlarft(direct, storev, n, k, v, ldv, tau, t, ldt)
DLARFT forms the triangular factor T of a block reflector H = I - vtvH