LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zsysvxx.f
Go to the documentation of this file.
1*> \brief <b> ZSYSVXX computes the solution to system of linear equations A * X = B for SY matrices</b>
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZSYSVXX + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zsysvxx.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zsysvxx.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zsysvxx.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZSYSVXX( FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV,
20* EQUED, S, B, LDB, X, LDX, RCOND, RPVGRW, BERR,
21* N_ERR_BNDS, ERR_BNDS_NORM, ERR_BNDS_COMP,
22* NPARAMS, PARAMS, WORK, RWORK, INFO )
23*
24* .. Scalar Arguments ..
25* CHARACTER EQUED, FACT, UPLO
26* INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
27* $ N_ERR_BNDS
28* DOUBLE PRECISION RCOND, RPVGRW
29* ..
30* .. Array Arguments ..
31* INTEGER IPIV( * )
32* COMPLEX*16 A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
33* $ X( LDX, * ), WORK( * )
34* DOUBLE PRECISION S( * ), PARAMS( * ), BERR( * ),
35* $ ERR_BNDS_NORM( NRHS, * ),
36* $ ERR_BNDS_COMP( NRHS, * ), RWORK( * )
37* ..
38*
39*
40*> \par Purpose:
41* =============
42*>
43*> \verbatim
44*>
45*> ZSYSVXX uses the diagonal pivoting factorization to compute the
46*> solution to a complex*16 system of linear equations A * X = B, where
47*> A is an N-by-N symmetric matrix and X and B are N-by-NRHS
48*> matrices.
49*>
50*> If requested, both normwise and maximum componentwise error bounds
51*> are returned. ZSYSVXX will return a solution with a tiny
52*> guaranteed error (O(eps) where eps is the working machine
53*> precision) unless the matrix is very ill-conditioned, in which
54*> case a warning is returned. Relevant condition numbers also are
55*> calculated and returned.
56*>
57*> ZSYSVXX accepts user-provided factorizations and equilibration
58*> factors; see the definitions of the FACT and EQUED options.
59*> Solving with refinement and using a factorization from a previous
60*> ZSYSVXX call will also produce a solution with either O(eps)
61*> errors or warnings, but we cannot make that claim for general
62*> user-provided factorizations and equilibration factors if they
63*> differ from what ZSYSVXX would itself produce.
64*> \endverbatim
65*
66*> \par Description:
67* =================
68*>
69*> \verbatim
70*>
71*> The following steps are performed:
72*>
73*> 1. If FACT = 'E', double precision scaling factors are computed to equilibrate
74*> the system:
75*>
76*> diag(S)*A*diag(S) *inv(diag(S))*X = diag(S)*B
77*>
78*> Whether or not the system will be equilibrated depends on the
79*> scaling of the matrix A, but if equilibration is used, A is
80*> overwritten by diag(S)*A*diag(S) and B by diag(S)*B.
81*>
82*> 2. If FACT = 'N' or 'E', the LU decomposition is used to factor
83*> the matrix A (after equilibration if FACT = 'E') as
84*>
85*> A = U * D * U**T, if UPLO = 'U', or
86*> A = L * D * L**T, if UPLO = 'L',
87*>
88*> where U (or L) is a product of permutation and unit upper (lower)
89*> triangular matrices, and D is symmetric and block diagonal with
90*> 1-by-1 and 2-by-2 diagonal blocks.
91*>
92*> 3. If some D(i,i)=0, so that D is exactly singular, then the
93*> routine returns with INFO = i. Otherwise, the factored form of A
94*> is used to estimate the condition number of the matrix A (see
95*> argument RCOND). If the reciprocal of the condition number is
96*> less than machine precision, the routine still goes on to solve
97*> for X and compute error bounds as described below.
98*>
99*> 4. The system of equations is solved for X using the factored form
100*> of A.
101*>
102*> 5. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero),
103*> the routine will use iterative refinement to try to get a small
104*> error and error bounds. Refinement calculates the residual to at
105*> least twice the working precision.
106*>
107*> 6. If equilibration was used, the matrix X is premultiplied by
108*> diag(R) so that it solves the original system before
109*> equilibration.
110*> \endverbatim
111*
112* Arguments:
113* ==========
114*
115*> \verbatim
116*> Some optional parameters are bundled in the PARAMS array. These
117*> settings determine how refinement is performed, but often the
118*> defaults are acceptable. If the defaults are acceptable, users
119*> can pass NPARAMS = 0 which prevents the source code from accessing
120*> the PARAMS argument.
121*> \endverbatim
122*>
123*> \param[in] FACT
124*> \verbatim
125*> FACT is CHARACTER*1
126*> Specifies whether or not the factored form of the matrix A is
127*> supplied on entry, and if not, whether the matrix A should be
128*> equilibrated before it is factored.
129*> = 'F': On entry, AF and IPIV contain the factored form of A.
130*> If EQUED is not 'N', the matrix A has been
131*> equilibrated with scaling factors given by S.
132*> A, AF, and IPIV are not modified.
133*> = 'N': The matrix A will be copied to AF and factored.
134*> = 'E': The matrix A will be equilibrated if necessary, then
135*> copied to AF and factored.
136*> \endverbatim
137*>
138*> \param[in] UPLO
139*> \verbatim
140*> UPLO is CHARACTER*1
141*> = 'U': Upper triangle of A is stored;
142*> = 'L': Lower triangle of A is stored.
143*> \endverbatim
144*>
145*> \param[in] N
146*> \verbatim
147*> N is INTEGER
148*> The number of linear equations, i.e., the order of the
149*> matrix A. N >= 0.
150*> \endverbatim
151*>
152*> \param[in] NRHS
153*> \verbatim
154*> NRHS is INTEGER
155*> The number of right hand sides, i.e., the number of columns
156*> of the matrices B and X. NRHS >= 0.
157*> \endverbatim
158*>
159*> \param[in,out] A
160*> \verbatim
161*> A is COMPLEX*16 array, dimension (LDA,N)
162*> The symmetric matrix A. If UPLO = 'U', the leading N-by-N
163*> upper triangular part of A contains the upper triangular
164*> part of the matrix A, and the strictly lower triangular
165*> part of A is not referenced. If UPLO = 'L', the leading
166*> N-by-N lower triangular part of A contains the lower
167*> triangular part of the matrix A, and the strictly upper
168*> triangular part of A is not referenced.
169*>
170*> On exit, if FACT = 'E' and EQUED = 'Y', A is overwritten by
171*> diag(S)*A*diag(S).
172*> \endverbatim
173*>
174*> \param[in] LDA
175*> \verbatim
176*> LDA is INTEGER
177*> The leading dimension of the array A. LDA >= max(1,N).
178*> \endverbatim
179*>
180*> \param[in,out] AF
181*> \verbatim
182*> AF is COMPLEX*16 array, dimension (LDAF,N)
183*> If FACT = 'F', then AF is an input argument and on entry
184*> contains the block diagonal matrix D and the multipliers
185*> used to obtain the factor U or L from the factorization A =
186*> U*D*U**T or A = L*D*L**T as computed by ZSYTRF.
187*>
188*> If FACT = 'N', then AF is an output argument and on exit
189*> returns the block diagonal matrix D and the multipliers
190*> used to obtain the factor U or L from the factorization A =
191*> U*D*U**T or A = L*D*L**T.
192*> \endverbatim
193*>
194*> \param[in] LDAF
195*> \verbatim
196*> LDAF is INTEGER
197*> The leading dimension of the array AF. LDAF >= max(1,N).
198*> \endverbatim
199*>
200*> \param[in,out] IPIV
201*> \verbatim
202*> IPIV is INTEGER array, dimension (N)
203*> If FACT = 'F', then IPIV is an input argument and on entry
204*> contains details of the interchanges and the block
205*> structure of D, as determined by ZSYTRF. If IPIV(k) > 0,
206*> then rows and columns k and IPIV(k) were interchanged and
207*> D(k,k) is a 1-by-1 diagonal block. If UPLO = 'U' and
208*> IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and
209*> -IPIV(k) were interchanged and D(k-1:k,k-1:k) is a 2-by-2
210*> diagonal block. If UPLO = 'L' and IPIV(k) = IPIV(k+1) < 0,
211*> then rows and columns k+1 and -IPIV(k) were interchanged
212*> and D(k:k+1,k:k+1) is a 2-by-2 diagonal block.
213*>
214*> If FACT = 'N', then IPIV is an output argument and on exit
215*> contains details of the interchanges and the block
216*> structure of D, as determined by ZSYTRF.
217*> \endverbatim
218*>
219*> \param[in,out] EQUED
220*> \verbatim
221*> EQUED is CHARACTER*1
222*> Specifies the form of equilibration that was done.
223*> = 'N': No equilibration (always true if FACT = 'N').
224*> = 'Y': Both row and column equilibration, i.e., A has been
225*> replaced by diag(S) * A * diag(S).
226*> EQUED is an input argument if FACT = 'F'; otherwise, it is an
227*> output argument.
228*> \endverbatim
229*>
230*> \param[in,out] S
231*> \verbatim
232*> S is DOUBLE PRECISION array, dimension (N)
233*> The scale factors for A. If EQUED = 'Y', A is multiplied on
234*> the left and right by diag(S). S is an input argument if FACT =
235*> 'F'; otherwise, S is an output argument. If FACT = 'F' and EQUED
236*> = 'Y', each element of S must be positive. If S is output, each
237*> element of S is a power of the radix. If S is input, each element
238*> of S should be a power of the radix to ensure a reliable solution
239*> and error estimates. Scaling by powers of the radix does not cause
240*> rounding errors unless the result underflows or overflows.
241*> Rounding errors during scaling lead to refining with a matrix that
242*> is not equivalent to the input matrix, producing error estimates
243*> that may not be reliable.
244*> \endverbatim
245*>
246*> \param[in,out] B
247*> \verbatim
248*> B is COMPLEX*16 array, dimension (LDB,NRHS)
249*> On entry, the N-by-NRHS right hand side matrix B.
250*> On exit,
251*> if EQUED = 'N', B is not modified;
252*> if EQUED = 'Y', B is overwritten by diag(S)*B;
253*> \endverbatim
254*>
255*> \param[in] LDB
256*> \verbatim
257*> LDB is INTEGER
258*> The leading dimension of the array B. LDB >= max(1,N).
259*> \endverbatim
260*>
261*> \param[out] X
262*> \verbatim
263*> X is COMPLEX*16 array, dimension (LDX,NRHS)
264*> If INFO = 0, the N-by-NRHS solution matrix X to the original
265*> system of equations. Note that A and B are modified on exit if
266*> EQUED .ne. 'N', and the solution to the equilibrated system is
267*> inv(diag(S))*X.
268*> \endverbatim
269*>
270*> \param[in] LDX
271*> \verbatim
272*> LDX is INTEGER
273*> The leading dimension of the array X. LDX >= max(1,N).
274*> \endverbatim
275*>
276*> \param[out] RCOND
277*> \verbatim
278*> RCOND is DOUBLE PRECISION
279*> Reciprocal scaled condition number. This is an estimate of the
280*> reciprocal Skeel condition number of the matrix A after
281*> equilibration (if done). If this is less than the machine
282*> precision (in particular, if it is zero), the matrix is singular
283*> to working precision. Note that the error may still be small even
284*> if this number is very small and the matrix appears ill-
285*> conditioned.
286*> \endverbatim
287*>
288*> \param[out] RPVGRW
289*> \verbatim
290*> RPVGRW is DOUBLE PRECISION
291*> Reciprocal pivot growth. On exit, this contains the reciprocal
292*> pivot growth factor norm(A)/norm(U). The "max absolute element"
293*> norm is used. If this is much less than 1, then the stability of
294*> the LU factorization of the (equilibrated) matrix A could be poor.
295*> This also means that the solution X, estimated condition numbers,
296*> and error bounds could be unreliable. If factorization fails with
297*> 0<INFO<=N, then this contains the reciprocal pivot growth factor
298*> for the leading INFO columns of A.
299*> \endverbatim
300*>
301*> \param[out] BERR
302*> \verbatim
303*> BERR is DOUBLE PRECISION array, dimension (NRHS)
304*> Componentwise relative backward error. This is the
305*> componentwise relative backward error of each solution vector X(j)
306*> (i.e., the smallest relative change in any element of A or B that
307*> makes X(j) an exact solution).
308*> \endverbatim
309*>
310*> \param[in] N_ERR_BNDS
311*> \verbatim
312*> N_ERR_BNDS is INTEGER
313*> Number of error bounds to return for each right hand side
314*> and each type (normwise or componentwise). See ERR_BNDS_NORM and
315*> ERR_BNDS_COMP below.
316*> \endverbatim
317*>
318*> \param[out] ERR_BNDS_NORM
319*> \verbatim
320*> ERR_BNDS_NORM is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS)
321*> For each right-hand side, this array contains information about
322*> various error bounds and condition numbers corresponding to the
323*> normwise relative error, which is defined as follows:
324*>
325*> Normwise relative error in the ith solution vector:
326*> max_j (abs(XTRUE(j,i) - X(j,i)))
327*> ------------------------------
328*> max_j abs(X(j,i))
329*>
330*> The array is indexed by the type of error information as described
331*> below. There currently are up to three pieces of information
332*> returned.
333*>
334*> The first index in ERR_BNDS_NORM(i,:) corresponds to the ith
335*> right-hand side.
336*>
337*> The second index in ERR_BNDS_NORM(:,err) contains the following
338*> three fields:
339*> err = 1 "Trust/don't trust" boolean. Trust the answer if the
340*> reciprocal condition number is less than the threshold
341*> sqrt(n) * dlamch('Epsilon').
342*>
343*> err = 2 "Guaranteed" error bound: The estimated forward error,
344*> almost certainly within a factor of 10 of the true error
345*> so long as the next entry is greater than the threshold
346*> sqrt(n) * dlamch('Epsilon'). This error bound should only
347*> be trusted if the previous boolean is true.
348*>
349*> err = 3 Reciprocal condition number: Estimated normwise
350*> reciprocal condition number. Compared with the threshold
351*> sqrt(n) * dlamch('Epsilon') to determine if the error
352*> estimate is "guaranteed". These reciprocal condition
353*> numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some
354*> appropriately scaled matrix Z.
355*> Let Z = S*A, where S scales each row by a power of the
356*> radix so all absolute row sums of Z are approximately 1.
357*>
358*> See Lapack Working Note 165 for further details and extra
359*> cautions.
360*> \endverbatim
361*>
362*> \param[out] ERR_BNDS_COMP
363*> \verbatim
364*> ERR_BNDS_COMP is DOUBLE PRECISION array, dimension (NRHS, N_ERR_BNDS)
365*> For each right-hand side, this array contains information about
366*> various error bounds and condition numbers corresponding to the
367*> componentwise relative error, which is defined as follows:
368*>
369*> Componentwise relative error in the ith solution vector:
370*> abs(XTRUE(j,i) - X(j,i))
371*> max_j ----------------------
372*> abs(X(j,i))
373*>
374*> The array is indexed by the right-hand side i (on which the
375*> componentwise relative error depends), and the type of error
376*> information as described below. There currently are up to three
377*> pieces of information returned for each right-hand side. If
378*> componentwise accuracy is not requested (PARAMS(3) = 0.0), then
379*> ERR_BNDS_COMP is not accessed. If N_ERR_BNDS < 3, then at most
380*> the first (:,N_ERR_BNDS) entries are returned.
381*>
382*> The first index in ERR_BNDS_COMP(i,:) corresponds to the ith
383*> right-hand side.
384*>
385*> The second index in ERR_BNDS_COMP(:,err) contains the following
386*> three fields:
387*> err = 1 "Trust/don't trust" boolean. Trust the answer if the
388*> reciprocal condition number is less than the threshold
389*> sqrt(n) * dlamch('Epsilon').
390*>
391*> err = 2 "Guaranteed" error bound: The estimated forward error,
392*> almost certainly within a factor of 10 of the true error
393*> so long as the next entry is greater than the threshold
394*> sqrt(n) * dlamch('Epsilon'). This error bound should only
395*> be trusted if the previous boolean is true.
396*>
397*> err = 3 Reciprocal condition number: Estimated componentwise
398*> reciprocal condition number. Compared with the threshold
399*> sqrt(n) * dlamch('Epsilon') to determine if the error
400*> estimate is "guaranteed". These reciprocal condition
401*> numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some
402*> appropriately scaled matrix Z.
403*> Let Z = S*(A*diag(x)), where x is the solution for the
404*> current right-hand side and S scales each row of
405*> A*diag(x) by a power of the radix so all absolute row
406*> sums of Z are approximately 1.
407*>
408*> See Lapack Working Note 165 for further details and extra
409*> cautions.
410*> \endverbatim
411*>
412*> \param[in] NPARAMS
413*> \verbatim
414*> NPARAMS is INTEGER
415*> Specifies the number of parameters set in PARAMS. If <= 0, the
416*> PARAMS array is never referenced and default values are used.
417*> \endverbatim
418*>
419*> \param[in,out] PARAMS
420*> \verbatim
421*> PARAMS is DOUBLE PRECISION array, dimension NPARAMS
422*> Specifies algorithm parameters. If an entry is < 0.0, then
423*> that entry will be filled with default value used for that
424*> parameter. Only positions up to NPARAMS are accessed; defaults
425*> are used for higher-numbered parameters.
426*>
427*> PARAMS(LA_LINRX_ITREF_I = 1) : Whether to perform iterative
428*> refinement or not.
429*> Default: 1.0D+0
430*> = 0.0: No refinement is performed, and no error bounds are
431*> computed.
432*> = 1.0: Use the extra-precise refinement algorithm.
433*> (other values are reserved for future use)
434*>
435*> PARAMS(LA_LINRX_ITHRESH_I = 2) : Maximum number of residual
436*> computations allowed for refinement.
437*> Default: 10
438*> Aggressive: Set to 100 to permit convergence using approximate
439*> factorizations or factorizations other than LU. If
440*> the factorization uses a technique other than
441*> Gaussian elimination, the guarantees in
442*> err_bnds_norm and err_bnds_comp may no longer be
443*> trustworthy.
444*>
445*> PARAMS(LA_LINRX_CWISE_I = 3) : Flag determining if the code
446*> will attempt to find a solution with small componentwise
447*> relative error in the double-precision algorithm. Positive
448*> is true, 0.0 is false.
449*> Default: 1.0 (attempt componentwise convergence)
450*> \endverbatim
451*>
452*> \param[out] WORK
453*> \verbatim
454*> WORK is COMPLEX*16 array, dimension (2*N)
455*> \endverbatim
456*>
457*> \param[out] RWORK
458*> \verbatim
459*> RWORK is DOUBLE PRECISION array, dimension (2*N)
460*> \endverbatim
461*>
462*> \param[out] INFO
463*> \verbatim
464*> INFO is INTEGER
465*> = 0: Successful exit. The solution to every right-hand side is
466*> guaranteed.
467*> < 0: If INFO = -i, the i-th argument had an illegal value
468*> > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization
469*> has been completed, but the factor U is exactly singular, so
470*> the solution and error bounds could not be computed. RCOND = 0
471*> is returned.
472*> = N+J: The solution corresponding to the Jth right-hand side is
473*> not guaranteed. The solutions corresponding to other right-
474*> hand sides K with K > J may not be guaranteed as well, but
475*> only the first such right-hand side is reported. If a small
476*> componentwise error is not requested (PARAMS(3) = 0.0) then
477*> the Jth right-hand side is the first with a normwise error
478*> bound that is not guaranteed (the smallest J such
479*> that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0)
480*> the Jth right-hand side is the first with either a normwise or
481*> componentwise error bound that is not guaranteed (the smallest
482*> J such that either ERR_BNDS_NORM(J,1) = 0.0 or
483*> ERR_BNDS_COMP(J,1) = 0.0). See the definition of
484*> ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information
485*> about all of the right-hand sides check ERR_BNDS_NORM or
486*> ERR_BNDS_COMP.
487*> \endverbatim
488*
489* Authors:
490* ========
491*
492*> \author Univ. of Tennessee
493*> \author Univ. of California Berkeley
494*> \author Univ. of Colorado Denver
495*> \author NAG Ltd.
496*
497*> \ingroup hesvxx
498*
499* =====================================================================
500 SUBROUTINE zsysvxx( FACT, UPLO, N, NRHS, A, LDA, AF, LDAF,
501 $ IPIV,
502 $ EQUED, S, B, LDB, X, LDX, RCOND, RPVGRW, BERR,
503 $ N_ERR_BNDS, ERR_BNDS_NORM, ERR_BNDS_COMP,
504 $ NPARAMS, PARAMS, WORK, RWORK, INFO )
505*
506* -- LAPACK driver routine --
507* -- LAPACK is a software package provided by Univ. of Tennessee, --
508* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
509*
510* .. Scalar Arguments ..
511 CHARACTER EQUED, FACT, UPLO
512 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
513 $ N_ERR_BNDS
514 DOUBLE PRECISION RCOND, RPVGRW
515* ..
516* .. Array Arguments ..
517 INTEGER IPIV( * )
518 COMPLEX*16 A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
519 $ X( LDX, * ), WORK( * )
520 DOUBLE PRECISION S( * ), PARAMS( * ), BERR( * ),
521 $ err_bnds_norm( nrhs, * ),
522 $ err_bnds_comp( nrhs, * ), rwork( * )
523* ..
524*
525* ==================================================================
526*
527* .. Parameters ..
528 DOUBLE PRECISION ZERO, ONE
529 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0 )
530 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
531 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
532 INTEGER CMP_ERR_I, PIV_GROWTH_I
533 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
534 $ berr_i = 3 )
535 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
536 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
537 $ piv_growth_i = 9 )
538* ..
539* .. Local Scalars ..
540 LOGICAL EQUIL, NOFACT, RCEQU
541 INTEGER INFEQU, J
542 DOUBLE PRECISION AMAX, BIGNUM, SMIN, SMAX, SCOND, SMLNUM
543* ..
544* .. External Functions ..
545 EXTERNAL lsame, dlamch, zla_syrpvgrw
546 LOGICAL LSAME
547 DOUBLE PRECISION DLAMCH, ZLA_SYRPVGRW
548* ..
549* .. External Subroutines ..
550 EXTERNAL zsyequb, zsytrf, zsytrs, zlacpy,
552* ..
553* .. Intrinsic Functions ..
554 INTRINSIC max, min
555* ..
556* .. Executable Statements ..
557*
558 info = 0
559 nofact = lsame( fact, 'N' )
560 equil = lsame( fact, 'E' )
561 smlnum = dlamch( 'Safe minimum' )
562 bignum = one / smlnum
563 IF( nofact .OR. equil ) THEN
564 equed = 'N'
565 rcequ = .false.
566 ELSE
567 rcequ = lsame( equed, 'Y' )
568 ENDIF
569*
570* Default is failure. If an input parameter is wrong or
571* factorization fails, make everything look horrible. Only the
572* pivot growth is set here, the rest is initialized in ZSYRFSX.
573*
574 rpvgrw = zero
575*
576* Test the input parameters. PARAMS is not tested until ZSYRFSX.
577*
578 IF( .NOT.nofact .AND. .NOT.equil .AND. .NOT.
579 $ lsame( fact, 'F' ) ) THEN
580 info = -1
581 ELSE IF( .NOT.lsame(uplo, 'U') .AND.
582 $ .NOT.lsame(uplo, 'L') ) THEN
583 info = -2
584 ELSE IF( n.LT.0 ) THEN
585 info = -3
586 ELSE IF( nrhs.LT.0 ) THEN
587 info = -4
588 ELSE IF( lda.LT.max( 1, n ) ) THEN
589 info = -6
590 ELSE IF( ldaf.LT.max( 1, n ) ) THEN
591 info = -8
592 ELSE IF( lsame( fact, 'F' ) .AND. .NOT.
593 $ ( rcequ .OR. lsame( equed, 'N' ) ) ) THEN
594 info = -10
595 ELSE
596 IF ( rcequ ) THEN
597 smin = bignum
598 smax = zero
599 DO 10 j = 1, n
600 smin = min( smin, s( j ) )
601 smax = max( smax, s( j ) )
602 10 CONTINUE
603 IF( smin.LE.zero ) THEN
604 info = -11
605 ELSE IF( n.GT.0 ) THEN
606 scond = max( smin, smlnum ) / min( smax, bignum )
607 ELSE
608 scond = one
609 END IF
610 END IF
611 IF( info.EQ.0 ) THEN
612 IF( ldb.LT.max( 1, n ) ) THEN
613 info = -13
614 ELSE IF( ldx.LT.max( 1, n ) ) THEN
615 info = -15
616 END IF
617 END IF
618 END IF
619*
620 IF( info.NE.0 ) THEN
621 CALL xerbla( 'ZSYSVXX', -info )
622 RETURN
623 END IF
624*
625 IF( equil ) THEN
626*
627* Compute row and column scalings to equilibrate the matrix A.
628*
629 CALL zsyequb( uplo, n, a, lda, s, scond, amax, work,
630 $ infequ )
631 IF( infequ.EQ.0 ) THEN
632*
633* Equilibrate the matrix.
634*
635 CALL zlaqsy( uplo, n, a, lda, s, scond, amax, equed )
636 rcequ = lsame( equed, 'Y' )
637 END IF
638
639 END IF
640*
641* Scale the right hand-side.
642*
643 IF( rcequ ) CALL zlascl2( n, nrhs, s, b, ldb )
644*
645 IF( nofact .OR. equil ) THEN
646*
647* Compute the LDL^T or UDU^T factorization of A.
648*
649 CALL zlacpy( uplo, n, n, a, lda, af, ldaf )
650 CALL zsytrf( uplo, n, af, ldaf, ipiv, work, 5*max(1,n),
651 $ info )
652*
653* Return if INFO is non-zero.
654*
655 IF( info.GT.0 ) THEN
656*
657* Pivot in column INFO is exactly 0
658* Compute the reciprocal pivot growth factor of the
659* leading rank-deficient INFO columns of A.
660*
661 IF ( n.GT.0 )
662 $ rpvgrw = zla_syrpvgrw( uplo, n, info, a, lda, af,
663 $ ldaf, ipiv, rwork )
664 RETURN
665 END IF
666 END IF
667*
668* Compute the reciprocal pivot growth factor RPVGRW.
669*
670 IF ( n.GT.0 )
671 $ rpvgrw = zla_syrpvgrw( uplo, n, info, a, lda, af, ldaf,
672 $ ipiv, rwork )
673*
674* Compute the solution matrix X.
675*
676 CALL zlacpy( 'Full', n, nrhs, b, ldb, x, ldx )
677 CALL zsytrs( uplo, n, nrhs, af, ldaf, ipiv, x, ldx, info )
678*
679* Use iterative refinement to improve the computed solution and
680* compute error bounds and backward error estimates for it.
681*
682 CALL zsyrfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv,
683 $ s, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
684 $ err_bnds_comp, nparams, params, work, rwork, info )
685*
686* Scale solutions.
687*
688 IF ( rcequ ) THEN
689 CALL zlascl2 (n, nrhs, s, x, ldx )
690 END IF
691*
692 RETURN
693*
694* End of ZSYSVXX
695*
696 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zsyequb(uplo, n, a, lda, s, scond, amax, work, info)
ZSYEQUB
Definition zsyequb.f:131
subroutine zsyrfsx(uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv, s, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)
ZSYRFSX
Definition zsyrfsx.f:401
subroutine zsysvxx(fact, uplo, n, nrhs, a, lda, af, ldaf, ipiv, equed, s, b, ldb, x, ldx, rcond, rpvgrw, berr, n_err_bnds, err_bnds_norm, err_bnds_comp, nparams, params, work, rwork, info)
ZSYSVXX computes the solution to system of linear equations A * X = B for SY matrices
Definition zsysvxx.f:505
subroutine zsytrf(uplo, n, a, lda, ipiv, work, lwork, info)
ZSYTRF
Definition zsytrf.f:180
subroutine zsytrs(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
ZSYTRS
Definition zsytrs.f:118
double precision function zla_syrpvgrw(uplo, n, info, a, lda, af, ldaf, ipiv, work)
ZLA_SYRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric indefinite m...
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
Definition zlacpy.f:101
double precision function dlamch(cmach)
DLAMCH
Definition dlamch.f:69
subroutine zlaqsy(uplo, n, a, lda, s, scond, amax, equed)
ZLAQSY scales a symmetric/Hermitian matrix, using scaling factors computed by spoequ.
Definition zlaqsy.f:132
subroutine zlascl2(m, n, d, x, ldx)
ZLASCL2 performs diagonal scaling on a matrix.
Definition zlascl2.f:89
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48