1 SUBROUTINE slagge( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
8 INTEGER INFO, KL, KU, LDA, M, N
12 REAL A( LDA, * ), D( * ), WORK( * )
65 parameter( zero = 0.0e+0, one = 1.0e+0 )
72 EXTERNAL sgemv, sger, slarnv, sscal, xerbla
88 ELSE IF( n.LT.0 )
THEN
90 ELSE IF( kl.LT.0 .OR. kl.GT.m-1 )
THEN
92 ELSE IF( ku.LT.0 .OR. ku.GT.n-1 )
THEN
94 ELSE IF( lda.LT.
max( 1, m ) )
THEN
98 CALL xerbla(
'SLAGGE', -info )
109 DO 30 i = 1,
min( m, n )
115 DO 40 i =
min( m, n ), 1, -1
120 CALL slarnv( 3, iseed, m-i+1, work )
121 wn = snrm2( m-i+1, work, 1 )
122 wa = sign( wn, work( 1 ) )
123 IF( wn.EQ.zero )
THEN
127 CALL sscal( m-i, one / wb, work( 2 ), 1 )
134 CALL sgemv(
'Transpose', m-i+1, n-i+1, one, a( i, i ), lda,
135 $ work, 1, zero, work( m+1 ), 1 )
136 CALL sger( m-i+1, n-i+1, -tau, work, 1, work( m+1 ), 1,
143 CALL slarnv( 3, iseed, n-i+1, work )
144 wn = snrm2( n-i+1, work, 1 )
145 wa = sign( wn, work( 1 ) )
146 IF( wn.EQ.zero )
THEN
150 CALL sscal( n-i, one / wb, work( 2 ), 1 )
157 CALL sgemv(
'No transpose', m-i+1, n-i+1, one, a( i, i ),
158 $ lda, work, 1, zero, work( n+1 ), 1 )
159 CALL sger( m-i+1, n-i+1, -tau, work( n+1 ), 1, work, 1,
167 DO 70 i = 1,
max( m-1-kl, n-1-ku )
172 IF( i.LE.
min( m-1-kl, n ) )
THEN
176 wn = snrm2( m-kl-i+1, a( kl+i, i ), 1 )
177 wa = sign( wn, a( kl+i, i ) )
178 IF( wn.EQ.zero )
THEN
181 wb = a( kl+i, i ) + wa
182 CALL sscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
189 CALL sgemv(
'Transpose', m-kl-i+1, n-i, one,
190 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
192 CALL sger( m-kl-i+1, n-i, -tau, a( kl+i, i ), 1, work, 1,
193 $ a( kl+i, i+1 ), lda )
197 IF( i.LE.
min( n-1-ku, m ) )
THEN
201 wn = snrm2( n-ku-i+1, a( i, ku+i ), lda )
202 wa = sign( wn, a( i, ku+i ) )
203 IF( wn.EQ.zero )
THEN
206 wb = a( i, ku+i ) + wa
207 CALL sscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
214 CALL sgemv(
'No transpose', m-i, n-ku-i+1, one,
215 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
217 CALL sger( m-i, n-ku-i+1, -tau, work, 1, a( i, ku+i ),
218 $ lda, a( i+1, ku+i ), lda )
226 IF( i.LE.
min( n-1-ku, m ) )
THEN
230 wn = snrm2( n-ku-i+1, a( i, ku+i ), lda )
231 wa = sign( wn, a( i, ku+i ) )
232 IF( wn.EQ.zero )
THEN
235 wb = a( i, ku+i ) + wa
236 CALL sscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
243 CALL sgemv(
'No transpose', m-i, n-ku-i+1, one,
244 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
246 CALL sger( m-i, n-ku-i+1, -tau, work, 1, a( i, ku+i ),
247 $ lda, a( i+1, ku+i ), lda )
251 IF( i.LE.
min( m-1-kl, n ) )
THEN
255 wn = snrm2( m-kl-i+1, a( kl+i, i ), 1 )
256 wa = sign( wn, a( kl+i, i ) )
257 IF( wn.EQ.zero )
THEN
260 wb = a( kl+i, i ) + wa
261 CALL sscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
268 CALL sgemv(
'Transpose', m-kl-i+1, n-i, one,
269 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
271 CALL sger( m-kl-i+1, n-i, -tau, a( kl+i, i ), 1, work, 1,
272 $ a( kl+i, i+1 ), lda )
277 DO 50 j = kl + i + 1, m
281 DO 60 j = ku + i + 1, n