127 SUBROUTINE sorgql( 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, IINFO, IWS, J, KK, L, LDWORK, LWKOPT,
160 EXTERNAL ilaenv, sroundup_lwork
167 lquery = ( lwork.EQ.-1 )
170 ELSE IF( n.LT.0 .OR. n.GT.m )
THEN
172 ELSE IF( k.LT.0 .OR. k.GT.n )
THEN
174 ELSE IF( lda.LT.max( 1, m ) )
THEN
182 nb = ilaenv( 1,
'SORGQL',
' ', m, n, k, -1 )
185 work( 1 ) = sroundup_lwork(lwkopt)
187 IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
193 CALL xerbla(
'SORGQL', -info )
195 ELSE IF( lquery )
THEN
208 IF( nb.GT.1 .AND. nb.LT.k )
THEN
212 nx = max( 0, ilaenv( 3,
'SORGQL',
' ', m, n, k, -1 ) )
219 IF( lwork.LT.iws )
THEN
225 nbmin = max( 2, ilaenv( 2,
'SORGQL',
' ', 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 )
240 DO 10 i = m - kk + 1, m
250 CALL sorg2l( 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 )
258 IF( n-k+i.GT.1 )
THEN
263 CALL slarft(
'Backward',
'Columnwise', m-k+i+ib-1, ib,
264 $ a( 1, n-k+i ), lda, tau( i ), work, ldwork )
268 CALL slarfb(
'Left',
'No transpose',
'Backward',
269 $
'Columnwise', m-k+i+ib-1, n-k+i-1, ib,
270 $ a( 1, n-k+i ), lda, work, ldwork, a, lda,
271 $ work( ib+1 ), ldwork )
276 CALL sorg2l( m-k+i+ib-1, ib, ib, a( 1, n-k+i ), lda,
277 $ tau( i ), work, iinfo )
281 DO 40 j = n - k + i, n - k + i + ib - 1
282 DO 30 l = m - k + i + ib, m
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 sorg2l(m, n, k, a, lda, tau, work, info)
SORG2L generates all or part of the orthogonal matrix Q from a QL factorization determined by sgeqlf ...
subroutine sorgql(m, n, k, a, lda, tau, work, lwork, info)
SORGQL