205 SUBROUTINE sgebrd( M, N, A, LDA, D, E, TAUQ, TAUP, WORK, LWORK,
214 INTEGER info, lda, lwork, m, n
217 REAL a( lda, * ), d( * ), e( * ), taup( * ),
218 $ tauq( * ), work( * )
225 parameter( one = 1.0e+0 )
229 INTEGER i, iinfo, j, ldwrkx, ldwrky, lwkopt, minmn, nb,
237 INTRINSIC max, min, real
248 nb = max( 1,
ilaenv( 1,
'SGEBRD',
' ', m, n, -1, -1 ) )
250 work( 1 ) =
REAL( lwkopt )
251 lquery = ( lwork.EQ.-1 )
254 ELSE IF( n.LT.0 )
THEN
256 ELSE IF( lda.LT.max( 1, m ) )
THEN
258 ELSE IF( lwork.LT.max( 1, m, n ) .AND. .NOT.lquery )
THEN
262 CALL
xerbla(
'SGEBRD', -info )
264 ELSE IF( lquery )
THEN
271 IF( minmn.EQ.0 )
THEN
280 IF( nb.GT.1 .AND. nb.LT.minmn )
THEN
284 nx = max( nb,
ilaenv( 3,
'SGEBRD',
' ', m, n, -1, -1 ) )
288 IF( nx.LT.minmn )
THEN
290 IF( lwork.LT.ws )
THEN
295 nbmin =
ilaenv( 2,
'SGEBRD',
' ', m, n, -1, -1 )
296 IF( lwork.GE.( m+n )*nbmin )
THEN
308 DO 30 i = 1, minmn - nx, nb
314 CALL
slabrd( m-i+1, n-i+1, nb, a( i, i ), lda, d( i ), e( i ),
315 $ tauq( i ), taup( i ), work, ldwrkx,
316 $ work( ldwrkx*nb+1 ), ldwrky )
321 CALL
sgemm(
'No transpose',
'Transpose', m-i-nb+1, n-i-nb+1,
322 $ nb, -one, a( i+nb, i ), lda,
323 $ work( ldwrkx*nb+nb+1 ), ldwrky, one,
324 $ a( i+nb, i+nb ), lda )
325 CALL
sgemm(
'No transpose',
'No transpose', m-i-nb+1, n-i-nb+1,
326 $ nb, -one, work( nb+1 ), ldwrkx, a( i, i+nb ), lda,
327 $ one, a( i+nb, i+nb ), lda )
332 DO 10 j = i, i + nb - 1
337 DO 20 j = i, i + nb - 1
346 CALL
sgebd2( m-i+1, n-i+1, a( i, i ), lda, d( i ), e( i ),
347 $ tauq( i ), taup( i ), work, iinfo )