1 SUBROUTINE zlagge( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
8 INTEGER INFO, KL, KU, LDA, M, N
12 DOUBLE PRECISION D( * )
13 COMPLEX*16 A( LDA, * ), WORK( * )
66 parameter( zero = ( 0.0d+0, 0.0d+0 ),
67 $ one = ( 1.0d+0, 0.0d+0 ) )
72 COMPLEX*16 TAU, WA, WB
75 EXTERNAL xerbla, zgemv, zgerc, zlacgv,
zlarnv, zscal
78 INTRINSIC abs, dble,
max,
min
81 DOUBLE PRECISION DZNRM2
91 ELSE IF( n.LT.0 )
THEN
93 ELSE IF( kl.LT.0 .OR. kl.GT.m-1 )
THEN
95 ELSE IF( ku.LT.0 .OR. ku.GT.n-1 )
THEN
97 ELSE IF( lda.LT.
max( 1, m ) )
THEN
101 CALL xerbla(
'ZLAGGE', -info )
112 DO 30 i = 1,
min( m, n )
118 DO 40 i =
min( m, n ), 1, -1
123 CALL zlarnv( 3, iseed, m-i+1, work )
124 wn = dznrm2( m-i+1, work, 1 )
125 wa = ( wn / abs( work( 1 ) ) )*work( 1 )
126 IF( wn.EQ.zero )
THEN
130 CALL zscal( m-i, one / wb, work( 2 ), 1 )
132 tau = dble( wb / wa )
137 CALL zgemv(
'Conjugate transpose', m-i+1, n-i+1, one,
138 $ a( i, i ), lda, work, 1, zero, work( m+1 ), 1 )
139 CALL zgerc( m-i+1, n-i+1, -tau, work, 1, work( m+1 ), 1,
146 CALL zlarnv( 3, iseed, n-i+1, work )
147 wn = dznrm2( n-i+1, work, 1 )
148 wa = ( wn / abs( work( 1 ) ) )*work( 1 )
149 IF( wn.EQ.zero )
THEN
153 CALL zscal( n-i, one / wb, work( 2 ), 1 )
155 tau = dble( wb / wa )
160 CALL zgemv(
'No transpose', m-i+1, n-i+1, one, a( i, i ),
161 $ lda, work, 1, zero, work( n+1 ), 1 )
162 CALL zgerc( m-i+1, n-i+1, -tau, work( n+1 ), 1, work, 1,
170 DO 70 i = 1,
max( m-1-kl, n-1-ku )
175 IF( i.LE.
min( m-1-kl, n ) )
THEN
179 wn = dznrm2( m-kl-i+1, a( kl+i, i ), 1 )
180 wa = ( wn / abs( a( kl+i, i ) ) )*a( kl+i, i )
181 IF( wn.EQ.zero )
THEN
184 wb = a( kl+i, i ) + wa
185 CALL zscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
187 tau = dble( wb / wa )
192 CALL zgemv(
'Conjugate transpose', m-kl-i+1, n-i, one,
193 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
195 CALL zgerc( m-kl-i+1, n-i, -tau, a( kl+i, i ), 1, work,
196 $ 1, a( kl+i, i+1 ), lda )
200 IF( i.LE.
min( n-1-ku, m ) )
THEN
204 wn = dznrm2( n-ku-i+1, a( i, ku+i ), lda )
205 wa = ( wn / abs( a( i, ku+i ) ) )*a( i, ku+i )
206 IF( wn.EQ.zero )
THEN
209 wb = a( i, ku+i ) + wa
210 CALL zscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
212 tau = dble( wb / wa )
217 CALL zlacgv( n-ku-i+1, a( i, ku+i ), lda )
218 CALL zgemv(
'No transpose', m-i, n-ku-i+1, one,
219 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
221 CALL zgerc( m-i, n-ku-i+1, -tau, work, 1, a( i, ku+i ),
222 $ lda, a( i+1, ku+i ), lda )
230 IF( i.LE.
min( n-1-ku, m ) )
THEN
234 wn = dznrm2( n-ku-i+1, a( i, ku+i ), lda )
235 wa = ( wn / abs( a( i, ku+i ) ) )*a( i, ku+i )
236 IF( wn.EQ.zero )
THEN
239 wb = a( i, ku+i ) + wa
240 CALL zscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
242 tau = dble( wb / wa )
247 CALL zlacgv( n-ku-i+1, a( i, ku+i ), lda )
248 CALL zgemv(
'No transpose', m-i, n-ku-i+1, one,
249 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
251 CALL zgerc( m-i, n-ku-i+1, -tau, work, 1, a( i, ku+i ),
252 $ lda, a( i+1, ku+i ), lda )
256 IF( i.LE.
min( m-1-kl, n ) )
THEN
260 wn = dznrm2( m-kl-i+1, a( kl+i, i ), 1 )
261 wa = ( wn / abs( a( kl+i, i ) ) )*a( kl+i, i )
262 IF( wn.EQ.zero )
THEN
265 wb = a( kl+i, i ) + wa
266 CALL zscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
268 tau = dble( wb / wa )
273 CALL zgemv(
'Conjugate transpose', m-kl-i+1, n-i, one,
274 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
276 CALL zgerc( m-kl-i+1, n-i, -tau, a( kl+i, i ), 1, work,
277 $ 1, a( kl+i, i+1 ), lda )
282 DO 50 j = kl + i + 1, m
286 DO 60 j = ku + i + 1, n