167 SUBROUTINE zlatdf( IJOB, N, Z, LDZ, RHS, RDSUM, RDSCAL, IPIV,
176 DOUBLE PRECISION RDSCAL, RDSUM
179 INTEGER IPIV( * ), JPIV( * )
180 COMPLEX*16 RHS( * ), Z( LDZ, * )
187 parameter( maxdim = 2 )
188 DOUBLE PRECISION ZERO, ONE
189 parameter( zero = 0.0d+0, one = 1.0d+0 )
191 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
194 INTEGER I, INFO, J, K
195 DOUBLE PRECISION RTEMP, SCALE, SMINU, SPLUS
196 COMPLEX*16 BM, BP, PMONE, TEMP
199 DOUBLE PRECISION RWORK( MAXDIM )
200 COMPLEX*16 WORK( 4*MAXDIM ), XM( MAXDIM ), XP( MAXDIM )
207 DOUBLE PRECISION DZASUM
209 EXTERNAL dzasum, zdotc
212 INTRINSIC abs, dble, sqrt
220 CALL zlaswp( 1, rhs, ldz, 1, n-1, ipiv, 1 )
233 splus = splus + dble( zdotc( n-j, z( j+1, j ), 1, z( j+1,
235 sminu = dble( zdotc( n-j, z( j+1, j ), 1, rhs( j+1 ), 1 ) )
236 splus = splus*dble( rhs( j ) )
237 IF( splus.GT.sminu )
THEN
239 ELSE IF( sminu.GT.splus )
THEN
249 rhs( j ) = rhs( j ) + pmone
256 CALL zaxpy( n-j, temp, z( j+1, j ), 1, rhs( j+1 ), 1 )
264 CALL zcopy( n-1, rhs, 1, work, 1 )
265 work( n ) = rhs( n ) + cone
266 rhs( n ) = rhs( n ) - cone
270 temp = cone / z( i, i )
271 work( i ) = work( i )*temp
272 rhs( i ) = rhs( i )*temp
274 work( i ) = work( i ) - work( k )*( z( i, k )*temp )
275 rhs( i ) = rhs( i ) - rhs( k )*( z( i, k )*temp )
277 splus = splus + abs( work( i ) )
278 sminu = sminu + abs( rhs( i ) )
281 $
CALL zcopy( n, work, 1, rhs, 1 )
285 CALL zlaswp( 1, rhs, ldz, 1, n-1, jpiv, -1 )
289 CALL zlassq( n, rhs, 1, rdscal, rdsum )
297 CALL zgecon(
'I', n, z, ldz, one, rtemp, work, rwork, info )
298 CALL zcopy( n, work( n+1 ), 1, xm, 1 )
302 CALL zlaswp( 1, xm, ldz, 1, n-1, ipiv, -1 )
303 temp = cone / sqrt( zdotc( n, xm, 1, xm, 1 ) )
304 CALL zscal( n, temp, xm, 1 )
305 CALL zcopy( n, xm, 1, xp, 1 )
306 CALL zaxpy( n, cone, rhs, 1, xp, 1 )
307 CALL zaxpy( n, -cone, xm, 1, rhs, 1 )
308 CALL zgesc2( n, z, ldz, rhs, ipiv, jpiv, scale )
309 CALL zgesc2( n, z, ldz, xp, ipiv, jpiv, scale )
310 IF( dzasum( n, xp, 1 ).GT.dzasum( n, rhs, 1 ) )
311 $
CALL zcopy( n, xp, 1, rhs, 1 )
315 CALL zlassq( n, rhs, 1, rdscal, rdsum )
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zgecon(norm, n, a, lda, anorm, rcond, work, rwork, info)
ZGECON
subroutine zgesc2(n, a, lda, rhs, ipiv, jpiv, scale)
ZGESC2 solves a system of linear equations using the LU factorization with complete pivoting computed...
subroutine zlassq(n, x, incx, scale, sumsq)
ZLASSQ updates a sum of squares represented in scaled form.
subroutine zlaswp(n, a, lda, k1, k2, ipiv, incx)
ZLASWP performs a series of row interchanges on a general rectangular matrix.
subroutine zlatdf(ijob, n, z, ldz, rhs, rdsum, rdscal, ipiv, jpiv)
ZLATDF uses the LU factorization of the n-by-n matrix computed by sgetc2 and computes a contribution ...
subroutine zscal(n, za, zx, incx)
ZSCAL