172 SUBROUTINE sgemqr( SIDE, TRANS, M, N, K, A, LDA, T, TSIZE,
173 $ C, LDC, WORK, LWORK, INFO )
180 CHARACTER SIDE, TRANS
181 INTEGER INFO, LDA, M, N, K, TSIZE, LWORK, LDC
184 REAL A( LDA, * ), T( * ), C( LDC, * ), WORK( * )
191 LOGICAL LEFT, RIGHT, TRAN, NOTRAN, LQUERY
192 INTEGER MB, NB, LW, NBLCKS, MN, MINMNK, LWMIN
198 EXTERNAL sroundup_lwork
204 INTRINSIC int, max, min, mod
210 lquery = ( lwork.EQ.-1 )
211 notran = lsame( trans,
'N' )
212 tran = lsame( trans,
'T' )
213 left = lsame( side,
'L' )
214 right = lsame( side,
'R' )
226 minmnk = min( m, n, k )
227 IF( minmnk.EQ.0 )
THEN
233 IF( ( mb.GT.k ) .AND. ( mn.GT.k ) )
THEN
234 IF( mod( mn - k, mb - k ).EQ.0 )
THEN
235 nblcks = ( mn - k ) / ( mb - k )
237 nblcks = ( mn - k ) / ( mb - k ) + 1
244 IF( .NOT.left .AND. .NOT.right )
THEN
246 ELSE IF( .NOT.tran .AND. .NOT.notran )
THEN
248 ELSE IF( m.LT.0 )
THEN
250 ELSE IF( n.LT.0 )
THEN
252 ELSE IF( k.LT.0 .OR. k.GT.mn )
THEN
254 ELSE IF( lda.LT.max( 1, mn ) )
THEN
256 ELSE IF( tsize.LT.5 )
THEN
258 ELSE IF( ldc.LT.max( 1, m ) )
THEN
260 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
265 work( 1 ) = sroundup_lwork( lwmin )
269 CALL xerbla(
'SGEMQR', -info )
271 ELSE IF( lquery )
THEN
277 IF( minmnk.EQ.0 )
THEN
281 IF( ( left .AND. m.LE.k ) .OR. ( right .AND. n.LE.k )
282 $ .OR. ( mb.LE.k ) .OR. ( mb.GE.max( m, n, k ) ) )
THEN
283 CALL sgemqrt( side, trans, m, n, k, nb, a, lda, t( 6 ),
284 $ nb, c, ldc, work, info )
286 CALL slamtsqr( side, trans, m, n, k, mb, nb, a, lda, t( 6 ),
287 $ nb, c, ldc, work, lwork, info )
290 work( 1 ) = sroundup_lwork( lwmin )
subroutine sgemqr(side, trans, m, n, k, a, lda, t, tsize, c, ldc, work, lwork, info)
SGEMQR
subroutine sgemqrt(side, trans, m, n, k, nb, v, ldv, t, ldt, c, ldc, work, info)
SGEMQRT
subroutine slamtsqr(side, trans, m, n, k, mb, nb, a, lda, t, ldt, c, ldc, work, lwork, info)
SLAMTSQR