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,
194 LOGICAL DISNAN, LSAME
196 DOUBLE PRECISION DLAMCH, DZNRM2
197 EXTERNAL disnan, lsame, izamax, dlamch, dznrm2
203 INTRINSIC abs, dble, dimag, max, min
208 IF( .NOT.lsame( job,
'N' ) .AND. .NOT.lsame( job,
'P' ) .AND.
209 $ .NOT.lsame( job,
'S' ) .AND. .NOT.lsame( job,
'B' ) )
THEN
211 ELSE IF( n.LT.0 )
THEN
213 ELSE IF( lda.LT.max( 1, n ) )
THEN
217 CALL xerbla(
'ZGEBAL', -info )
227 IF( lsame( job,
'N' ) )
THEN
234 IF( lsame( job,
'S' ) )
248 CALL zswap( l, a( 1, j ), 1, a( 1, m ), 1 )
249 CALL zswap( n-k+1, a( j, k ), lda, a( m, k ), lda )
267 IF( dble( a( j, i ) ).NE.zero .OR. dimag( a( j, i ) ).NE.
289 IF( dble( a( i, j ) ).NE.zero .OR. dimag( a( i, j ) ).NE.
303 IF( lsame( job,
'P' ) )
310 sfmin1 = dlamch(
'S' ) / dlamch(
'P' )
311 sfmax1 = one / sfmin1
312 sfmin2 = sfmin1*sclfac
313 sfmax2 = one / sfmin2
319 c = dznrm2( l-k+1, a( k, i ), 1 )
320 r = dznrm2( l-k+1, a( i, k ), lda )
321 ica = izamax( l, a( 1, i ), 1 )
322 ca = abs( a( ica, i ) )
323 ira = izamax( n-k+1, a( i, k ), lda )
324 ra = abs( a( i, ira+k-1 ) )
328 IF( c.EQ.zero .OR. r.EQ.zero )
334 IF( c.GE.g .OR. max( f, c, ca ).GE.sfmax2 .OR.
335 $ min( r, g, ra ).LE.sfmin2 )
GO TO 170
336 IF( disnan( c+f+ca+r+g+ra ) )
THEN
341 CALL xerbla(
'ZGEBAL', -info )
355 IF( g.LT.r .OR. max( r, ra ).GE.sfmax2 .OR.
356 $ min( f, c, g, ca ).LE.sfmin2 )
GO TO 190
368 IF( ( c+r ).GE.factor*s )
370 IF( f.LT.one .AND. scale( i ).LT.one )
THEN
371 IF( f*scale( i ).LE.sfmin1 )
374 IF( f.GT.one .AND. scale( i ).GT.one )
THEN
375 IF( scale( i ).GE.sfmax1 / f )
379 scale( i ) = scale( i )*f
382 CALL zdscal( n-k+1, g, a( i, k ), lda )
383 CALL zdscal( l, f, a( 1, i ), 1 )
subroutine zswap(N, ZX, INCX, ZY, INCY)
ZSWAP
subroutine zgebal(JOB, N, A, LDA, ILO, IHI, SCALE, INFO)
ZGEBAL
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine zdscal(N, DA, ZX, INCX)
ZDSCAL