112 SUBROUTINE slagge( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
119 INTEGER INFO, KL, KU, LDA, M, N
123 REAL A( LDA, * ), D( * ), WORK( * )
130 parameter( zero = 0.0e+0, one = 1.0e+0 )
140 INTRINSIC max, min, sign
153 ELSE IF( n.LT.0 )
THEN
155 ELSE IF( kl.LT.0 .OR. kl.GT.m-1 )
THEN
157 ELSE IF( ku.LT.0 .OR. ku.GT.n-1 )
THEN
159 ELSE IF( lda.LT.max( 1, m ) )
THEN
163 CALL xerbla(
'SLAGGE', -info )
174 DO 30 i = 1, min( m, n )
180 IF(( kl .EQ. 0 ).AND.( ku .EQ. 0))
RETURN
184 DO 40 i = min( m, n ), 1, -1
189 CALL slarnv( 3, iseed, m-i+1, work )
190 wn = snrm2( m-i+1, work, 1 )
191 wa = sign( wn, work( 1 ) )
192 IF( wn.EQ.zero )
THEN
196 CALL sscal( m-i, one / wb, work( 2 ), 1 )
203 CALL sgemv(
'Transpose', m-i+1, n-i+1, one, a( i, i ), lda,
204 $ work, 1, zero, work( m+1 ), 1 )
205 CALL sger( m-i+1, n-i+1, -tau, work, 1, work( m+1 ), 1,
212 CALL slarnv( 3, iseed, n-i+1, work )
213 wn = snrm2( n-i+1, work, 1 )
214 wa = sign( wn, work( 1 ) )
215 IF( wn.EQ.zero )
THEN
219 CALL sscal( n-i, one / wb, work( 2 ), 1 )
226 CALL sgemv(
'No transpose', m-i+1, n-i+1, one, a( i, i ),
227 $ lda, work, 1, zero, work( n+1 ), 1 )
228 CALL sger( m-i+1, n-i+1, -tau, work( n+1 ), 1, work, 1,
236 DO 70 i = 1, max( m-1-kl, n-1-ku )
241 IF( i.LE.min( m-1-kl, n ) )
THEN
245 wn = snrm2( m-kl-i+1, a( kl+i, i ), 1 )
246 wa = sign( wn, a( kl+i, i ) )
247 IF( wn.EQ.zero )
THEN
250 wb = a( kl+i, i ) + wa
251 CALL sscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
258 CALL sgemv(
'Transpose', m-kl-i+1, n-i, one,
259 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
261 CALL sger( m-kl-i+1, n-i, -tau, a( kl+i, i ), 1, work, 1,
262 $ a( kl+i, i+1 ), lda )
266 IF( i.LE.min( n-1-ku, m ) )
THEN
270 wn = snrm2( n-ku-i+1, a( i, ku+i ), lda )
271 wa = sign( wn, a( i, ku+i ) )
272 IF( wn.EQ.zero )
THEN
275 wb = a( i, ku+i ) + wa
276 CALL sscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
283 CALL sgemv(
'No transpose', m-i, n-ku-i+1, one,
284 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
286 CALL sger( m-i, n-ku-i+1, -tau, work, 1, a( i, ku+i ),
287 $ lda, a( i+1, ku+i ), lda )
295 IF( i.LE.min( n-1-ku, m ) )
THEN
299 wn = snrm2( n-ku-i+1, a( i, ku+i ), lda )
300 wa = sign( wn, a( i, ku+i ) )
301 IF( wn.EQ.zero )
THEN
304 wb = a( i, ku+i ) + wa
305 CALL sscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
312 CALL sgemv(
'No transpose', m-i, n-ku-i+1, one,
313 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
315 CALL sger( m-i, n-ku-i+1, -tau, work, 1, a( i, ku+i ),
316 $ lda, a( i+1, ku+i ), lda )
320 IF( i.LE.min( m-1-kl, n ) )
THEN
324 wn = snrm2( m-kl-i+1, a( kl+i, i ), 1 )
325 wa = sign( wn, a( kl+i, i ) )
326 IF( wn.EQ.zero )
THEN
329 wb = a( kl+i, i ) + wa
330 CALL sscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
337 CALL sgemv(
'Transpose', m-kl-i+1, n-i, one,
338 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
340 CALL sger( m-kl-i+1, n-i, -tau, a( kl+i, i ), 1, work, 1,
341 $ a( kl+i, i+1 ), lda )
347 DO 50 j = kl + i + 1, m
353 DO 60 j = ku + i + 1, n