1 SUBROUTINE dlagge( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
8 INTEGER INFO, KL, KU, LDA, M, N
12 DOUBLE PRECISION A( LDA, * ), D( * ), WORK( * )
64 DOUBLE PRECISION ZERO, ONE
65 parameter( zero = 0.0d+0, one = 1.0d+0 )
69 DOUBLE PRECISION TAU, WA, WB, WN
72 EXTERNAL dgemv, dger, dlarnv, dscal, xerbla
78 DOUBLE PRECISION DNRM2
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(
'DLAGGE', -info )
109 DO 30 i = 1,
min( m, n )
115 DO 40 i =
min( m, n ), 1, -1
120 CALL dlarnv( 3, iseed, m-i+1, work )
121 wn = dnrm2( m-i+1, work, 1 )
122 wa = sign( wn, work( 1 ) )
123 IF( wn.EQ.zero )
THEN
127 CALL dscal( m-i, one / wb, work( 2 ), 1 )
134 CALL dgemv(
'Transpose', m-i+1, n-i+1, one, a( i, i ), lda,
135 $ work, 1, zero, work( m+1 ), 1 )
136 CALL dger( m-i+1, n-i+1, -tau, work, 1, work( m+1 ), 1,
143 CALL dlarnv( 3, iseed, n-i+1, work )
144 wn = dnrm2( n-i+1, work, 1 )
145 wa = sign( wn, work( 1 ) )
146 IF( wn.EQ.zero )
THEN
150 CALL dscal( n-i, one / wb, work( 2 ), 1 )
157 CALL dgemv(
'No transpose', m-i+1, n-i+1, one, a( i, i ),
158 $ lda, work, 1, zero, work( n+1 ), 1 )
159 CALL dger( 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 = dnrm2( 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 dscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
189 CALL dgemv(
'Transpose', m-kl-i+1, n-i, one,
190 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
192 CALL dger( 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 = dnrm2( 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 dscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
214 CALL dgemv(
'No transpose', m-i, n-ku-i+1, one,
215 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
217 CALL dger( 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 = dnrm2( 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 dscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
243 CALL dgemv(
'No transpose', m-i, n-ku-i+1, one,
244 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
246 CALL dger( 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 = dnrm2( 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 dscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
268 CALL dgemv(
'Transpose', m-kl-i+1, n-i, one,
269 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
271 CALL dger( 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