1 SUBROUTINE dgebal( JOB, N, A, LDA, ILO, IHI, SCALE, INFO )
10 INTEGER IHI, ILO, INFO, LDA, N
13 DOUBLE PRECISION A( LDA, * ), SCALE( * )
105 DOUBLE PRECISION ZERO, ONE
106 parameter( zero = 0.0d+0, one = 1.0d+0 )
107 DOUBLE PRECISION SCLFAC
108 parameter( sclfac = 0.8d+1 )
109 DOUBLE PRECISION FACTOR
110 parameter( factor = 0.95d+0 )
114 INTEGER I, ICA, IEXC, IRA, J, K, L, M
115 DOUBLE PRECISION C, CA, F, G, R, RA, S, SFMAX1, SFMAX2, SFMIN1,
121 DOUBLE PRECISION DLAMCH
122 EXTERNAL lsame, idamax, dlamch
128 INTRINSIC abs, max, min
135 IF( .NOT.lsame( job,
'N' ) .AND. .NOT.lsame( job,
'P' ) .AND.
136 $ .NOT.lsame( job,
'S' ) .AND. .NOT.lsame( job,
'B' ) )
THEN
138 ELSE IF( n.LT.0 )
THEN
140 ELSE IF( lda.LT.max( 1, n ) )
THEN
144 CALL xerbla(
'DGEBAL', -info )
154 IF( lsame( job,
'N' ) )
THEN
161 IF( lsame( job,
'S' ) )
175 CALL dswap( l, a( 1, j ), 1, a( 1, m ), 1 )
176 CALL dswap( n-k+1, a( j, k ), lda, a( m, k ), lda )
194 IF( a( j, i ).NE.zero )
216 IF( a( i, j ).NE.zero )
230 IF( lsame( job,
'P' ) )
237 sfmin1 = dlamch(
'S' ) / dlamch(
'P' )
238 sfmax1 = one / sfmin1
239 sfmin2 = sfmin1*sclfac
240 sfmax2 = one / sfmin2
251 c = c + abs( a( j, i ) )
252 r = r + abs( a( i, j ) )
254 ica = idamax( l, a( 1, i ), 1 )
255 ca = abs( a( ica, i ) )
256 ira = idamax( n-k+1, a( i, k ), lda )
257 ra = abs( a( i, ira+k-1 ) )
261 IF( c.EQ.zero .OR. r.EQ.zero )
267 IF( c.GE.g .OR. max( f, c, ca ).GE.sfmax2 .OR.
268 $ min( r, g, ra ).LE.sfmin2 )
GO TO 170
280 IF( g.LT.r .OR. max( r, ra ).GE.sfmax2 .OR.
281 $ min( f, c, g, ca ).LE.sfmin2 )
GO TO 190
293 IF( ( c+r ).GE.factor*s )
295 IF( f.LT.one .AND. scale( i ).LT.one )
THEN
296 IF( f*scale( i ).LE.sfmin1 )
299 IF( f.GT.one .AND. scale( i ).GT.one )
THEN
300 IF( scale( i ).GE.sfmax1 / f )
304 scale( i ) = scale( i )*f
307 CALL dscal( n-k+1, g, a( i, k ), lda )
308 CALL dscal( l, f, a( 1, i ), 1 )
subroutine dgebal(JOB, N, A, LDA, ILO, IHI, SCALE, INFO)
subroutine dscal(n, da, dx, incx)
subroutine dswap(n, dx, incx, dy, incy)
subroutine xerbla(SRNAME, INFO)