161 SUBROUTINE zgebal( JOB, N, A, LDA, ILO, IHI, SCALE, INFO )
170 INTEGER IHI, ILO, INFO, LDA, N
173 DOUBLE PRECISION SCALE( * )
174 COMPLEX*16 A( lda, * )
180 DOUBLE PRECISION ZERO, ONE
181 parameter ( zero = 0.0d+0, one = 1.0d+0 )
182 DOUBLE PRECISION SCLFAC
183 parameter ( sclfac = 2.0d+0 )
184 DOUBLE PRECISION FACTOR
185 parameter ( factor = 0.95d+0 )
189 INTEGER I, ICA, IEXC, IRA, J, K, L, M
190 DOUBLE PRECISION C, CA, F, G, R, RA, S, SFMAX1, SFMAX2, SFMIN1,
195 LOGICAL DISNAN, LSAME
197 DOUBLE PRECISION DLAMCH, DZNRM2
198 EXTERNAL disnan, lsame, izamax, dlamch, dznrm2
204 INTRINSIC abs, dble, dimag, max, min
209 IF( .NOT.lsame( job,
'N' ) .AND. .NOT.lsame( job,
'P' ) .AND.
210 $ .NOT.lsame( job,
'S' ) .AND. .NOT.lsame( job,
'B' ) )
THEN
212 ELSE IF( n.LT.0 )
THEN
214 ELSE IF( lda.LT.max( 1, n ) )
THEN
218 CALL xerbla(
'ZGEBAL', -info )
228 IF( lsame( job,
'N' ) )
THEN
235 IF( lsame( job,
'S' ) )
249 CALL zswap( l, a( 1, j ), 1, a( 1, m ), 1 )
250 CALL zswap( n-k+1, a( j, k ), lda, a( m, k ), lda )
268 IF( dble( a( j, i ) ).NE.zero .OR. dimag( a( j, i ) ).NE.
290 IF( dble( a( i, j ) ).NE.zero .OR. dimag( a( i, j ) ).NE.
304 IF( lsame( job,
'P' ) )
311 sfmin1 = dlamch(
'S' ) / dlamch(
'P' )
312 sfmax1 = one / sfmin1
313 sfmin2 = sfmin1*sclfac
314 sfmax2 = one / sfmin2
320 c = dznrm2( l-k+1, a( k, i ), 1 )
321 r = dznrm2( l-k+1, a( i, k ), lda )
322 ica = izamax( l, a( 1, i ), 1 )
323 ca = abs( a( ica, i ) )
324 ira = izamax( n-k+1, a( i, k ), lda )
325 ra = abs( a( i, ira+k-1 ) )
329 IF( c.EQ.zero .OR. r.EQ.zero )
335 IF( c.GE.g .OR. max( f, c, ca ).GE.sfmax2 .OR.
336 $ min( r, g, ra ).LE.sfmin2 )
GO TO 170
337 IF( disnan( c+f+ca+r+g+ra ) )
THEN
342 CALL xerbla(
'ZGEBAL', -info )
356 IF( g.LT.r .OR. max( r, ra ).GE.sfmax2 .OR.
357 $ min( f, c, g, ca ).LE.sfmin2 )
GO TO 190
369 IF( ( c+r ).GE.factor*s )
371 IF( f.LT.one .AND. scale( i ).LT.one )
THEN
372 IF( f*scale( i ).LE.sfmin1 )
375 IF( f.GT.one .AND. scale( i ).GT.one )
THEN
376 IF( scale( i ).GE.sfmax1 / f )
380 scale( i ) = scale( i )*f
383 CALL zdscal( n-k+1, g, a( i, k ), lda )
384 CALL zdscal( l, f, a( 1, i ), 1 )
subroutine zswap(N, ZX, INCX, ZY, INCY)
ZSWAP
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine zgebal(JOB, N, A, LDA, ILO, IHI, SCALE, INFO)
ZGEBAL
subroutine zdscal(N, DA, ZX, INCX)
ZDSCAL