113 SUBROUTINE zlagge( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
120 INTEGER INFO, KL, KU, LDA, M, N
124 DOUBLE PRECISION D( * )
125 COMPLEX*16 A( LDA, * ), WORK( * )
132 parameter( zero = ( 0.0d+0, 0.0d+0 ),
133 $ one = ( 1.0d+0, 0.0d+0 ) )
138 COMPLEX*16 TAU, WA, WB
144 INTRINSIC abs, dble, max, min
147 DOUBLE PRECISION DZNRM2
157 ELSE IF( n.LT.0 )
THEN
159 ELSE IF( kl.LT.0 .OR. kl.GT.m-1 )
THEN
161 ELSE IF( ku.LT.0 .OR. ku.GT.n-1 )
THEN
163 ELSE IF( lda.LT.max( 1, m ) )
THEN
167 CALL xerbla(
'ZLAGGE', -info )
178 DO 30 i = 1, min( m, n )
184 IF(( kl .EQ. 0 ).AND.( ku .EQ. 0))
RETURN
188 DO 40 i = min( m, n ), 1, -1
193 CALL zlarnv( 3, iseed, m-i+1, work )
194 wn = dznrm2( m-i+1, work, 1 )
195 wa = ( wn / abs( work( 1 ) ) )*work( 1 )
196 IF( wn.EQ.zero )
THEN
200 CALL zscal( m-i, one / wb, work( 2 ), 1 )
202 tau = dble( wb / wa )
207 CALL zgemv(
'Conjugate transpose', m-i+1, n-i+1, one,
208 $ a( i, i ), lda, work, 1, zero, work( m+1 ), 1 )
209 CALL zgerc( m-i+1, n-i+1, -tau, work, 1, work( m+1 ), 1,
216 CALL zlarnv( 3, iseed, n-i+1, work )
217 wn = dznrm2( n-i+1, work, 1 )
218 wa = ( wn / abs( work( 1 ) ) )*work( 1 )
219 IF( wn.EQ.zero )
THEN
223 CALL zscal( n-i, one / wb, work( 2 ), 1 )
225 tau = dble( wb / wa )
230 CALL zgemv(
'No transpose', m-i+1, n-i+1, one, a( i, i ),
231 $ lda, work, 1, zero, work( n+1 ), 1 )
232 CALL zgerc( m-i+1, n-i+1, -tau, work( n+1 ), 1, work, 1,
240 DO 70 i = 1, max( m-1-kl, n-1-ku )
245 IF( i.LE.min( m-1-kl, n ) )
THEN
249 wn = dznrm2( m-kl-i+1, a( kl+i, i ), 1 )
250 wa = ( wn / abs( a( kl+i, i ) ) )*a( kl+i, i )
251 IF( wn.EQ.zero )
THEN
254 wb = a( kl+i, i ) + wa
255 CALL zscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
257 tau = dble( wb / wa )
262 CALL zgemv(
'Conjugate transpose', m-kl-i+1, n-i, one,
263 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
265 CALL zgerc( m-kl-i+1, n-i, -tau, a( kl+i, i ), 1, work,
266 $ 1, a( kl+i, i+1 ), lda )
270 IF( i.LE.min( n-1-ku, m ) )
THEN
274 wn = dznrm2( n-ku-i+1, a( i, ku+i ), lda )
275 wa = ( wn / abs( a( i, ku+i ) ) )*a( i, ku+i )
276 IF( wn.EQ.zero )
THEN
279 wb = a( i, ku+i ) + wa
280 CALL zscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
282 tau = dble( wb / wa )
287 CALL zlacgv( n-ku-i+1, a( i, ku+i ), lda )
288 CALL zgemv(
'No transpose', m-i, n-ku-i+1, one,
289 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
291 CALL zgerc( m-i, n-ku-i+1, -tau, work, 1, a( i, ku+i ),
292 $ lda, a( i+1, ku+i ), lda )
300 IF( i.LE.min( n-1-ku, m ) )
THEN
304 wn = dznrm2( n-ku-i+1, a( i, ku+i ), lda )
305 wa = ( wn / abs( a( i, ku+i ) ) )*a( i, ku+i )
306 IF( wn.EQ.zero )
THEN
309 wb = a( i, ku+i ) + wa
310 CALL zscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
312 tau = dble( wb / wa )
317 CALL zlacgv( n-ku-i+1, a( i, ku+i ), lda )
318 CALL zgemv(
'No transpose', m-i, n-ku-i+1, one,
319 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
321 CALL zgerc( m-i, n-ku-i+1, -tau, work, 1, a( i, ku+i ),
322 $ lda, a( i+1, ku+i ), lda )
326 IF( i.LE.min( m-1-kl, n ) )
THEN
330 wn = dznrm2( m-kl-i+1, a( kl+i, i ), 1 )
331 wa = ( wn / abs( a( kl+i, i ) ) )*a( kl+i, i )
332 IF( wn.EQ.zero )
THEN
335 wb = a( kl+i, i ) + wa
336 CALL zscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
338 tau = dble( wb / wa )
343 CALL zgemv(
'Conjugate transpose', m-kl-i+1, n-i, one,
344 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
346 CALL zgerc( m-kl-i+1, n-i, -tau, a( kl+i, i ), 1, work,
347 $ 1, a( kl+i, i+1 ), lda )
353 DO 50 j = kl + i + 1, m
359 DO 60 j = ku + i + 1, n
subroutine xerbla(srname, info)
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zgerc(m, n, alpha, x, incx, y, incy, a, lda)
ZGERC
subroutine zlacgv(n, x, incx)
ZLACGV conjugates a complex vector.
subroutine zlarnv(idist, iseed, n, x)
ZLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine zscal(n, za, zx, incx)
ZSCAL
subroutine zlagge(m, n, kl, ku, d, a, lda, iseed, work, info)
ZLAGGE