LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zlatdf ( integer  IJOB,
integer  N,
complex*16, dimension( ldz, * )  Z,
integer  LDZ,
complex*16, dimension( * )  RHS,
double precision  RDSUM,
double precision  RDSCAL,
integer, dimension( * )  IPIV,
integer, dimension( * )  JPIV 
)

ZLATDF uses the LU factorization of the n-by-n matrix computed by sgetc2 and computes a contribution to the reciprocal Dif-estimate.

Download ZLATDF + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 ZLATDF computes the contribution to the reciprocal Dif-estimate
 by solving for x in Z * x = b, where b is chosen such that the norm
 of x is as large as possible. It is assumed that LU decomposition
 of Z has been computed by ZGETC2. On entry RHS = f holds the
 contribution from earlier solved sub-systems, and on return RHS = x.

 The factorization of Z returned by ZGETC2 has the form
 Z = P * L * U * Q, where P and Q are permutation matrices. L is lower
 triangular with unit diagonal elements and U is upper triangular.
Parameters
[in]IJOB
          IJOB is INTEGER
          IJOB = 2: First compute an approximative null-vector e
              of Z using ZGECON, e is normalized and solve for
              Zx = +-e - f with the sign giving the greater value of
              2-norm(x).  About 5 times as expensive as Default.
          IJOB .ne. 2: Local look ahead strategy where
              all entries of the r.h.s. b is chosen as either +1 or
              -1.  Default.
[in]N
          N is INTEGER
          The number of columns of the matrix Z.
[in]Z
          Z is COMPLEX*16 array, dimension (LDZ, N)
          On entry, the LU part of the factorization of the n-by-n
          matrix Z computed by ZGETC2:  Z = P * L * U * Q
[in]LDZ
          LDZ is INTEGER
          The leading dimension of the array Z.  LDA >= max(1, N).
[in,out]RHS
          RHS is COMPLEX*16 array, dimension (N).
          On entry, RHS contains contributions from other subsystems.
          On exit, RHS contains the solution of the subsystem with
          entries according to the value of IJOB (see above).
[in,out]RDSUM
          RDSUM is DOUBLE PRECISION
          On entry, the sum of squares of computed contributions to
          the Dif-estimate under computation by ZTGSYL, where the
          scaling factor RDSCAL (see below) has been factored out.
          On exit, the corresponding sum of squares updated with the
          contributions from the current sub-system.
          If TRANS = 'T' RDSUM is not touched.
          NOTE: RDSUM only makes sense when ZTGSY2 is called by CTGSYL.
[in,out]RDSCAL
          RDSCAL is DOUBLE PRECISION
          On entry, scaling factor used to prevent overflow in RDSUM.
          On exit, RDSCAL is updated w.r.t. the current contributions
          in RDSUM.
          If TRANS = 'T', RDSCAL is not touched.
          NOTE: RDSCAL only makes sense when ZTGSY2 is called by
          ZTGSYL.
[in]IPIV
          IPIV is INTEGER array, dimension (N).
          The pivot indices; for 1 <= i <= N, row i of the
          matrix has been interchanged with row IPIV(i).
[in]JPIV
          JPIV is INTEGER array, dimension (N).
          The pivot indices; for 1 <= j <= N, column j of the
          matrix has been interchanged with column JPIV(j).
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
June 2016
Further Details:
This routine is a further developed implementation of algorithm BSOLVE in [1] using complete pivoting in the LU factorization.
Contributors:
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
References:
[1] Bo Kagstrom and Lars Westin, Generalized Schur Methods with Condition Estimators for Solving the Generalized Sylvester Equation, IEEE Transactions on Automatic Control, Vol. 34, No. 7, July 1989, pp 745-751.
[2] Peter Poromaa, On Efficient and Robust Estimators for the Separation between two Regular Matrix Pairs with Applications in Condition Estimation. Report UMINF-95.05, Department of Computing Science, Umea University, S-901 87 Umea, Sweden,

Definition at line 171 of file zlatdf.f.

171 *
172 * -- LAPACK auxiliary routine (version 3.6.1) --
173 * -- LAPACK is a software package provided by Univ. of Tennessee, --
174 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
175 * June 2016
176 *
177 * .. Scalar Arguments ..
178  INTEGER ijob, ldz, n
179  DOUBLE PRECISION rdscal, rdsum
180 * ..
181 * .. Array Arguments ..
182  INTEGER ipiv( * ), jpiv( * )
183  COMPLEX*16 rhs( * ), z( ldz, * )
184 * ..
185 *
186 * =====================================================================
187 *
188 * .. Parameters ..
189  INTEGER maxdim
190  parameter ( maxdim = 2 )
191  DOUBLE PRECISION zero, one
192  parameter ( zero = 0.0d+0, one = 1.0d+0 )
193  COMPLEX*16 cone
194  parameter ( cone = ( 1.0d+0, 0.0d+0 ) )
195 * ..
196 * .. Local Scalars ..
197  INTEGER i, info, j, k
198  DOUBLE PRECISION rtemp, scale, sminu, splus
199  COMPLEX*16 bm, bp, pmone, temp
200 * ..
201 * .. Local Arrays ..
202  DOUBLE PRECISION rwork( maxdim )
203  COMPLEX*16 work( 4*maxdim ), xm( maxdim ), xp( maxdim )
204 * ..
205 * .. External Subroutines ..
206  EXTERNAL zaxpy, zcopy, zgecon, zgesc2, zlassq, zlaswp,
207  $ zscal
208 * ..
209 * .. External Functions ..
210  DOUBLE PRECISION dzasum
211  COMPLEX*16 zdotc
212  EXTERNAL dzasum, zdotc
213 * ..
214 * .. Intrinsic Functions ..
215  INTRINSIC abs, dble, sqrt
216 * ..
217 * .. Executable Statements ..
218 *
219  IF( ijob.NE.2 ) THEN
220 *
221 * Apply permutations IPIV to RHS
222 *
223  CALL zlaswp( 1, rhs, ldz, 1, n-1, ipiv, 1 )
224 *
225 * Solve for L-part choosing RHS either to +1 or -1.
226 *
227  pmone = -cone
228  DO 10 j = 1, n - 1
229  bp = rhs( j ) + cone
230  bm = rhs( j ) - cone
231  splus = one
232 *
233 * Lockahead for L- part RHS(1:N-1) = +-1
234 * SPLUS and SMIN computed more efficiently than in BSOLVE[1].
235 *
236  splus = splus + dble( zdotc( n-j, z( j+1, j ), 1, z( j+1,
237  $ j ), 1 ) )
238  sminu = dble( zdotc( n-j, z( j+1, j ), 1, rhs( j+1 ), 1 ) )
239  splus = splus*dble( rhs( j ) )
240  IF( splus.GT.sminu ) THEN
241  rhs( j ) = bp
242  ELSE IF( sminu.GT.splus ) THEN
243  rhs( j ) = bm
244  ELSE
245 *
246 * In this case the updating sums are equal and we can
247 * choose RHS(J) +1 or -1. The first time this happens we
248 * choose -1, thereafter +1. This is a simple way to get
249 * good estimates of matrices like Byers well-known example
250 * (see [1]). (Not done in BSOLVE.)
251 *
252  rhs( j ) = rhs( j ) + pmone
253  pmone = cone
254  END IF
255 *
256 * Compute the remaining r.h.s.
257 *
258  temp = -rhs( j )
259  CALL zaxpy( n-j, temp, z( j+1, j ), 1, rhs( j+1 ), 1 )
260  10 CONTINUE
261 *
262 * Solve for U- part, lockahead for RHS(N) = +-1. This is not done
263 * In BSOLVE and will hopefully give us a better estimate because
264 * any ill-conditioning of the original matrix is transfered to U
265 * and not to L. U(N, N) is an approximation to sigma_min(LU).
266 *
267  CALL zcopy( n-1, rhs, 1, work, 1 )
268  work( n ) = rhs( n ) + cone
269  rhs( n ) = rhs( n ) - cone
270  splus = zero
271  sminu = zero
272  DO 30 i = n, 1, -1
273  temp = cone / z( i, i )
274  work( i ) = work( i )*temp
275  rhs( i ) = rhs( i )*temp
276  DO 20 k = i + 1, n
277  work( i ) = work( i ) - work( k )*( z( i, k )*temp )
278  rhs( i ) = rhs( i ) - rhs( k )*( z( i, k )*temp )
279  20 CONTINUE
280  splus = splus + abs( work( i ) )
281  sminu = sminu + abs( rhs( i ) )
282  30 CONTINUE
283  IF( splus.GT.sminu )
284  $ CALL zcopy( n, work, 1, rhs, 1 )
285 *
286 * Apply the permutations JPIV to the computed solution (RHS)
287 *
288  CALL zlaswp( 1, rhs, ldz, 1, n-1, jpiv, -1 )
289 *
290 * Compute the sum of squares
291 *
292  CALL zlassq( n, rhs, 1, rdscal, rdsum )
293  RETURN
294  END IF
295 *
296 * ENTRY IJOB = 2
297 *
298 * Compute approximate nullvector XM of Z
299 *
300  CALL zgecon( 'I', n, z, ldz, one, rtemp, work, rwork, info )
301  CALL zcopy( n, work( n+1 ), 1, xm, 1 )
302 *
303 * Compute RHS
304 *
305  CALL zlaswp( 1, xm, ldz, 1, n-1, ipiv, -1 )
306  temp = cone / sqrt( zdotc( n, xm, 1, xm, 1 ) )
307  CALL zscal( n, temp, xm, 1 )
308  CALL zcopy( n, xm, 1, xp, 1 )
309  CALL zaxpy( n, cone, rhs, 1, xp, 1 )
310  CALL zaxpy( n, -cone, xm, 1, rhs, 1 )
311  CALL zgesc2( n, z, ldz, rhs, ipiv, jpiv, scale )
312  CALL zgesc2( n, z, ldz, xp, ipiv, jpiv, scale )
313  IF( dzasum( n, xp, 1 ).GT.dzasum( n, rhs, 1 ) )
314  $ CALL zcopy( n, xp, 1, rhs, 1 )
315 *
316 * Compute the sum of squares
317 *
318  CALL zlassq( n, rhs, 1, rdscal, rdsum )
319  RETURN
320 *
321 * End of ZLATDF
322 *
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
Definition: zcopy.f:52
subroutine zlaswp(N, A, LDA, K1, K2, IPIV, INCX)
ZLASWP performs a series of row interchanges on a general rectangular matrix.
Definition: zlaswp.f:116
complex *16 function zdotc(N, ZX, INCX, ZY, INCY)
ZDOTC
Definition: zdotc.f:54
subroutine zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.
Definition: zlassq.f:108
subroutine zgecon(NORM, N, A, LDA, ANORM, RCOND, WORK, RWORK, INFO)
ZGECON
Definition: zgecon.f:126
double precision function dzasum(N, ZX, INCX)
DZASUM
Definition: dzasum.f:54
subroutine zgesc2(N, A, LDA, RHS, IPIV, JPIV, SCALE)
ZGESC2 solves a system of linear equations using the LU factorization with complete pivoting computed...
Definition: zgesc2.f:117
subroutine zaxpy(N, ZA, ZX, INCX, ZY, INCY)
ZAXPY
Definition: zaxpy.f:53
subroutine zscal(N, ZA, ZX, INCX)
ZSCAL
Definition: zscal.f:54

Here is the call graph for this function:

Here is the caller graph for this function: