1 SUBROUTINE clagge( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
8 INTEGER INFO, KL, KU, LDA, M, N
13 COMPLEX A( LDA, * ), WORK( * )
66 parameter( zero = ( 0.0e+0, 0.0e+0 ),
67 $ one = ( 1.0e+0, 0.0e+0 ) )
75 EXTERNAL cgemv, cgerc, clacgv,
clarnv, cscal, xerbla
78 INTRINSIC abs,
max,
min, real
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(
'CLAGGE', -info )
112 DO 30 i = 1,
min( m, n )
118 DO 40 i =
min( m, n ), 1, -1
123 CALL clarnv( 3, iseed, m-i+1, work )
124 wn = scnrm2( m-i+1, work, 1 )
125 wa = ( wn / abs( work( 1 ) ) )*work( 1 )
126 IF( wn.EQ.zero )
THEN
130 CALL cscal( m-i, one / wb, work( 2 ), 1 )
132 tau = real( wb / wa )
137 CALL cgemv(
'Conjugate transpose', m-i+1, n-i+1, one,
138 $ a( i, i ), lda, work, 1, zero, work( m+1 ), 1 )
139 CALL cgerc( m-i+1, n-i+1, -tau, work, 1, work( m+1 ), 1,
146 CALL clarnv( 3, iseed, n-i+1, work )
147 wn = scnrm2( n-i+1, work, 1 )
148 wa = ( wn / abs( work( 1 ) ) )*work( 1 )
149 IF( wn.EQ.zero )
THEN
153 CALL cscal( n-i, one / wb, work( 2 ), 1 )
155 tau = real( wb / wa )
160 CALL cgemv(
'No transpose', m-i+1, n-i+1, one, a( i, i ),
161 $ lda, work, 1, zero, work( n+1 ), 1 )
162 CALL cgerc( 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 = scnrm2( 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 cscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
187 tau = real( wb / wa )
192 CALL cgemv(
'Conjugate transpose', m-kl-i+1, n-i, one,
193 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
195 CALL cgerc( 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 = scnrm2( 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 cscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
212 tau = real( wb / wa )
217 CALL clacgv( n-ku-i+1, a( i, ku+i ), lda )
218 CALL cgemv(
'No transpose', m-i, n-ku-i+1, one,
219 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
221 CALL cgerc( 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 = scnrm2( 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 cscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
242 tau = real( wb / wa )
247 CALL clacgv( n-ku-i+1, a( i, ku+i ), lda )
248 CALL cgemv(
'No transpose', m-i, n-ku-i+1, one,
249 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
251 CALL cgerc( 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 = scnrm2( 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 cscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
268 tau = real( wb / wa )
273 CALL cgemv(
'Conjugate transpose', m-kl-i+1, n-i, one,
274 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
276 CALL cgerc( 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