127 SUBROUTINE sorgrq( M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
134 INTEGER INFO, K, LDA, LWORK, M, N
137 REAL A( LDA, * ), TAU( * ), WORK( * )
144 parameter( zero = 0.0e+0 )
148 INTEGER I, IB, II, IINFO, IWS, J, KK, L, LDWORK,
149 $ LWKOPT, NB, NBMIN, NX
160 EXTERNAL ilaenv, sroundup_lwork
167 lquery = ( lwork.EQ.-1 )
170 ELSE IF( n.LT.m )
THEN
172 ELSE IF( k.LT.0 .OR. k.GT.m )
THEN
174 ELSE IF( lda.LT.max( 1, m ) )
THEN
182 nb = ilaenv( 1,
'SORGRQ',
' ', m, n, k, -1 )
185 work( 1 ) = sroundup_lwork(lwkopt)
187 IF( lwork.LT.max( 1, m ) .AND. .NOT.lquery )
THEN
193 CALL xerbla(
'SORGRQ', -info )
195 ELSE IF( lquery )
THEN
208 IF( nb.GT.1 .AND. nb.LT.k )
THEN
212 nx = max( 0, ilaenv( 3,
'SORGRQ',
' ', m, n, k, -1 ) )
219 IF( lwork.LT.iws )
THEN
225 nbmin = max( 2, ilaenv( 2,
'SORGRQ',
' ', m, n, k, -1 ) )
230 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
235 kk = min( k, ( ( k-nx+nb-1 ) / nb )*nb )
239 DO 20 j = n - kk + 1, n
250 CALL sorgr2( m-kk, n-kk, k-kk, a, lda, tau, work, iinfo )
256 DO 50 i = k - kk + 1, k, nb
257 ib = min( nb, k-i+1 )
264 CALL slarft(
'Backward',
'Rowwise', n-k+i+ib-1, ib,
265 $ a( ii, 1 ), lda, tau( i ), work, ldwork )
269 CALL slarfb(
'Right',
'Transpose',
'Backward',
'Rowwise',
270 $ ii-1, n-k+i+ib-1, ib, a( ii, 1 ), lda, work,
271 $ ldwork, a, lda, work( ib+1 ), ldwork )
276 CALL sorgr2( ib, n-k+i+ib-1, ib, a( ii, 1 ), lda, tau( i ),
281 DO 40 l = n - k + i + ib, n
282 DO 30 j = ii, ii + ib - 1
289 work( 1 ) = sroundup_lwork(iws)
subroutine xerbla(srname, info)
subroutine slarfb(side, trans, direct, storev, m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork)
SLARFB applies a block reflector or its transpose to a general rectangular matrix.
subroutine slarft(direct, storev, n, k, v, ldv, tau, t, ldt)
SLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine sorgr2(m, n, k, a, lda, tau, work, info)
SORGR2 generates all or part of the orthogonal matrix Q from an RQ factorization determined by sgerqf...
subroutine sorgrq(m, n, k, a, lda, tau, work, lwork, info)
SORGRQ