113 SUBROUTINE clagge( M, N, KL, KU, D, A, LDA, ISEED, WORK, INFO )
120 INTEGER INFO, KL, KU, LDA, M, N
125 COMPLEX A( LDA, * ), WORK( * )
132 parameter( zero = ( 0.0e+0, 0.0e+0 ),
133 $ one = ( 1.0e+0, 0.0e+0 ) )
144 INTRINSIC abs, max, min, real
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(
'CLAGGE', -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 clarnv( 3, iseed, m-i+1, work )
194 wn = scnrm2( m-i+1, work, 1 )
195 wa = ( wn / abs( work( 1 ) ) )*work( 1 )
196 IF( wn.EQ.zero )
THEN
200 CALL cscal( m-i, one / wb, work( 2 ), 1 )
202 tau = real( wb / wa )
207 CALL cgemv(
'Conjugate transpose', m-i+1, n-i+1, one,
208 $ a( i, i ), lda, work, 1, zero, work( m+1 ), 1 )
209 CALL cgerc( m-i+1, n-i+1, -tau, work, 1, work( m+1 ), 1,
216 CALL clarnv( 3, iseed, n-i+1, work )
217 wn = scnrm2( n-i+1, work, 1 )
218 wa = ( wn / abs( work( 1 ) ) )*work( 1 )
219 IF( wn.EQ.zero )
THEN
223 CALL cscal( n-i, one / wb, work( 2 ), 1 )
225 tau = real( wb / wa )
230 CALL cgemv(
'No transpose', m-i+1, n-i+1, one, a( i, i ),
231 $ lda, work, 1, zero, work( n+1 ), 1 )
232 CALL cgerc( 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 = scnrm2( 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 cscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
257 tau = real( wb / wa )
262 CALL cgemv(
'Conjugate transpose', m-kl-i+1, n-i, one,
263 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
265 CALL cgerc( 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 = scnrm2( 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 cscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
282 tau = real( wb / wa )
287 CALL clacgv( n-ku-i+1, a( i, ku+i ), lda )
288 CALL cgemv(
'No transpose', m-i, n-ku-i+1, one,
289 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
291 CALL cgerc( 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 = scnrm2( 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 cscal( n-ku-i, one / wb, a( i, ku+i+1 ), lda )
312 tau = real( wb / wa )
317 CALL clacgv( n-ku-i+1, a( i, ku+i ), lda )
318 CALL cgemv(
'No transpose', m-i, n-ku-i+1, one,
319 $ a( i+1, ku+i ), lda, a( i, ku+i ), lda, zero,
321 CALL cgerc( 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 = scnrm2( 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 cscal( m-kl-i, one / wb, a( kl+i+1, i ), 1 )
338 tau = real( wb / wa )
343 CALL cgemv(
'Conjugate transpose', m-kl-i+1, n-i, one,
344 $ a( kl+i, i+1 ), lda, a( kl+i, i ), 1, zero,
346 CALL cgerc( 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 clagge(m, n, kl, ku, d, a, lda, iseed, work, info)
CLAGGE
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine cgerc(m, n, alpha, x, incx, y, incy, a, lda)
CGERC
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
subroutine clarnv(idist, iseed, n, x)
CLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine cscal(n, ca, cx, incx)
CSCAL