116 SUBROUTINE zgesc2( N, A, LDA, RHS, IPIV, JPIV, SCALE )
125 DOUBLE PRECISION scale
128 INTEGER ipiv( * ), jpiv( * )
129 COMPLEX*16 a( lda, * ), rhs( * )
135 DOUBLE PRECISION zero, one, two
136 parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
140 DOUBLE PRECISION bignum, eps, smlnum
152 INTRINSIC abs, dble, dcmplx
159 smlnum =
dlamch(
'S' ) / eps
160 bignum = one / smlnum
161 CALL
dlabad( smlnum, bignum )
165 CALL
zlaswp( 1, rhs, lda, 1, n-1, ipiv, 1 )
171 rhs( j ) = rhs( j ) - a( j, i )*rhs( i )
182 IF( two*smlnum*abs( rhs( i ) ).GT.abs( a( n, n ) ) )
THEN
183 temp = dcmplx( one / two, zero ) / abs( rhs( i ) )
184 CALL
zscal( n, temp, rhs( 1 ), 1 )
185 scale = scale*dble( temp )
188 temp = dcmplx( one, zero ) / a( i, i )
189 rhs( i ) = rhs( i )*temp
191 rhs( i ) = rhs( i ) - rhs( j )*( a( i, j )*temp )
197 CALL
zlaswp( 1, rhs, lda, 1, n-1, jpiv, -1 )