168 SUBROUTINE sormqr( SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC,
169 $ work, lwork, info )
177 CHARACTER SIDE, TRANS
178 INTEGER INFO, K, LDA, LDC, LWORK, M, N
181 REAL A( lda, * ), C( ldc, * ), TAU( * ),
188 INTEGER NBMAX, LDT, TSIZE
189 parameter ( nbmax = 64, ldt = nbmax+1,
190 $ tsize = ldt*nbmax )
193 LOGICAL LEFT, LQUERY, NOTRAN
194 INTEGER I, I1, I2, I3, IB, IC, IINFO, IWT, JC, LDWORK,
195 $ lwkopt, mi, nb, nbmin, ni, nq, nw
200 EXTERNAL lsame, ilaenv
213 left = lsame( side,
'L' )
214 notran = lsame( trans,
'N' )
215 lquery = ( lwork.EQ.-1 )
226 IF( .NOT.left .AND. .NOT.lsame( side,
'R' ) )
THEN
228 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans,
'T' ) )
THEN
230 ELSE IF( m.LT.0 )
THEN
232 ELSE IF( n.LT.0 )
THEN
234 ELSE IF( k.LT.0 .OR. k.GT.nq )
THEN
236 ELSE IF( lda.LT.max( 1, nq ) )
THEN
238 ELSE IF( ldc.LT.max( 1, m ) )
THEN
240 ELSE IF( lwork.LT.max( 1, nw ) .AND. .NOT.lquery )
THEN
248 nb = min( nbmax, ilaenv( 1,
'SORMQR', side // trans, m, n, k,
250 lwkopt = max( 1, nw )*nb + tsize
255 CALL xerbla(
'SORMQR', -info )
257 ELSE IF( lquery )
THEN
263 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
270 IF( nb.GT.1 .AND. nb.LT.k )
THEN
271 IF( lwork.LT.nw*nb+tsize )
THEN
272 nb = (lwork-tsize) / ldwork
273 nbmin = max( 2, ilaenv( 2,
'SORMQR', side // trans, m, n, k,
278 IF( nb.LT.nbmin .OR. nb.GE.k )
THEN
282 CALL sorm2r( side, trans, m, n, k, a, lda, tau, c, ldc, work,
289 IF( ( left .AND. .NOT.notran ) .OR.
290 $ ( .NOT.left .AND. notran ) )
THEN
295 i1 = ( ( k-1 ) / nb )*nb + 1
309 ib = min( nb, k-i+1 )
314 CALL slarft(
'Forward',
'Columnwise', nq-i+1, ib, a( i, i ),
315 $ lda, tau( i ), work( iwt ), ldt )
332 CALL slarfb( side, trans,
'Forward',
'Columnwise', mi, ni,
333 $ ib, a( i, i ), lda, work( iwt ), ldt,
334 $ c( ic, jc ), ldc, work, ldwork )
subroutine sormqr(SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, LWORK, INFO)
SORMQR
subroutine xerbla(SRNAME, INFO)
XERBLA
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 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 sorm2r(SIDE, TRANS, M, N, K, A, LDA, TAU, C, LDC, WORK, INFO)
SORM2R multiplies a general matrix by the orthogonal matrix from a QR factorization determined by sge...