164 SUBROUTINE zgebal( JOB, N, A, LDA, ILO, IHI, SCALE, INFO )
172 INTEGER IHI, ILO, INFO, LDA, N
175 DOUBLE PRECISION SCALE( * )
176 COMPLEX*16 A( LDA, * )
182 DOUBLE PRECISION ZERO, ONE
183 parameter( zero = 0.0d+0, one = 1.0d+0 )
184 DOUBLE PRECISION SCLFAC
185 parameter( sclfac = 2.0d+0 )
186 DOUBLE PRECISION FACTOR
187 parameter( factor = 0.95d+0 )
190 LOGICAL NOCONV, CANSWAP
191 INTEGER I, ICA, IRA, J, K, L
192 DOUBLE PRECISION C, CA, F, G, R, RA, S, SFMAX1, SFMAX2, SFMIN1,
196 LOGICAL DISNAN, LSAME
198 DOUBLE PRECISION DLAMCH, DZNRM2
199 EXTERNAL disnan, lsame, izamax, dlamch, dznrm2
205 INTRINSIC abs, dble, dimag, max, min
210 IF( .NOT.lsame( job,
'N' ) .AND. .NOT.lsame( job,
'P' ) .AND.
211 $ .NOT.lsame( job,
'S' ) .AND. .NOT.lsame( job,
'B' ) )
THEN
213 ELSE IF( n.LT.0 )
THEN
215 ELSE IF( lda.LT.max( 1, n ) )
THEN
219 CALL xerbla(
'ZGEBAL', -info )
231 IF( lsame( job,
'N' ) )
THEN
245 IF( .NOT.lsame( job,
'S' ) )
THEN
258 IF( i.NE.j .AND. ( dble( a( i, j ) ).NE.zero .OR.
259 $ dimag( a( i, j ) ).NE.zero ) )
THEN
268 CALL zswap( l, a( 1, i ), 1, a( 1, l ), 1 )
269 CALL zswap( n-k+1, a( i, k ), lda, a( l, k ), lda )
294 IF( i.NE.j .AND. ( dble( a( i, j ) ).NE.zero .OR.
295 $ dimag( a( i, j ) ).NE.zero ) )
THEN
304 CALL zswap( l, a( 1, j ), 1, a( 1, k ), 1 )
305 CALL zswap( n-k+1, a( j, k ), lda, a( k, k ), lda )
325 IF( lsame( job,
'P' ) )
THEN
335 sfmin1 = dlamch(
'S' ) / dlamch(
'P' )
336 sfmax1 = one / sfmin1
337 sfmin2 = sfmin1*sclfac
338 sfmax2 = one / sfmin2
346 c = dznrm2( l-k+1, a( k, i ), 1 )
347 r = dznrm2( l-k+1, a( i, k ), lda )
348 ica = izamax( l, a( 1, i ), 1 )
349 ca = abs( a( ica, i ) )
350 ira = izamax( n-k+1, a( i, k ), lda )
351 ra = abs( a( i, ira+k-1 ) )
355 IF( c.EQ.zero .OR. r.EQ.zero ) cycle
359 IF( disnan( c+ca+r+ra ) )
THEN
361 CALL xerbla(
'ZGEBAL', -info )
369 DO WHILE( c.LT.g .AND. max( f, c, ca ).LT.sfmax2 .AND.
370 $ min( r, g, ra ).GT.sfmin2 )
381 DO WHILE( g.GE.r .AND. max( r, ra ).LT.sfmax2 .AND.
382 $ min( f, c, g, ca ).GT.sfmin2 )
393 IF( ( c+r ).GE.factor*s ) cycle
394 IF( f.LT.one .AND. scale( i ).LT.one )
THEN
395 IF( f*scale( i ).LE.sfmin1 ) cycle
397 IF( f.GT.one .AND. scale( i ).GT.one )
THEN
398 IF( scale( i ).GE.sfmax1 / f ) cycle
401 scale( i ) = scale( i )*f
404 CALL zdscal( n-k+1, g, a( i, k ), lda )
405 CALL zdscal( l, f, a( 1, i ), 1 )
subroutine xerbla(srname, info)
subroutine zgebal(job, n, a, lda, ilo, ihi, scale, info)
ZGEBAL
subroutine zdscal(n, da, zx, incx)
ZDSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP