LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
chesvxx.f
Go to the documentation of this file.
1*> \brief <b> CHESVXX computes the solution to system of linear equations A * X = B for HE matrices</b>
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download CHESVXX + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/chesvxx.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/chesvxx.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/chesvxx.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE CHESVXX( 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* REAL RCOND, RPVGRW
29* ..
30* .. Array Arguments ..
31* INTEGER IPIV( * )
32* COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
33* $ WORK( * ), X( LDX, * )
34* REAL S( * ), PARAMS( * ), BERR( * ), RWORK( * ),
35* $ ERR_BNDS_NORM( NRHS, * ),
36* $ ERR_BNDS_COMP( NRHS, * )
37* ..
38*
39*
40*> \par Purpose:
41* =============
42*>
43*> \verbatim
44*>
45*> CHESVXX uses the diagonal pivoting factorization to compute the
46*> solution to a complex system of linear equations A * X = B, where
47*> A is an N-by-N Hermitian 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. CHESVXX 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*> CHESVXX 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*> CHESVXX 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 CHESVXX 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', real 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 Hermitian 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 array, dimension (LDA,N)
162*> The Hermitian 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 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**H or A = L*D*L**H as computed by CHETRF.
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**H or A = L*D*L**H.
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 CHETRF. 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 CHETRF.
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 REAL 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 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 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 REAL
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 REAL
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 REAL 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 REAL 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) * slamch('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) * slamch('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) * slamch('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 REAL 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) * slamch('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) * slamch('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) * slamch('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 REAL 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.0
430*> = 0.0: No refinement is performed, and no error bounds are
431*> computed.
432*> = 1.0: Use the double-precision refinement algorithm,
433*> possibly with doubled-single computations if the
434*> compilation environment does not support DOUBLE
435*> PRECISION.
436*> (other values are reserved for future use)
437*>
438*> PARAMS(LA_LINRX_ITHRESH_I = 2) : Maximum number of residual
439*> computations allowed for refinement.
440*> Default: 10
441*> Aggressive: Set to 100 to permit convergence using approximate
442*> factorizations or factorizations other than LU. If
443*> the factorization uses a technique other than
444*> Gaussian elimination, the guarantees in
445*> err_bnds_norm and err_bnds_comp may no longer be
446*> trustworthy.
447*>
448*> PARAMS(LA_LINRX_CWISE_I = 3) : Flag determining if the code
449*> will attempt to find a solution with small componentwise
450*> relative error in the double-precision algorithm. Positive
451*> is true, 0.0 is false.
452*> Default: 1.0 (attempt componentwise convergence)
453*> \endverbatim
454*>
455*> \param[out] WORK
456*> \verbatim
457*> WORK is COMPLEX array, dimension (5*N)
458*> \endverbatim
459*>
460*> \param[out] RWORK
461*> \verbatim
462*> RWORK is REAL array, dimension (2*N)
463*> \endverbatim
464*>
465*> \param[out] INFO
466*> \verbatim
467*> INFO is INTEGER
468*> = 0: Successful exit. The solution to every right-hand side is
469*> guaranteed.
470*> < 0: If INFO = -i, the i-th argument had an illegal value
471*> > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization
472*> has been completed, but the factor U is exactly singular, so
473*> the solution and error bounds could not be computed. RCOND = 0
474*> is returned.
475*> = N+J: The solution corresponding to the Jth right-hand side is
476*> not guaranteed. The solutions corresponding to other right-
477*> hand sides K with K > J may not be guaranteed as well, but
478*> only the first such right-hand side is reported. If a small
479*> componentwise error is not requested (PARAMS(3) = 0.0) then
480*> the Jth right-hand side is the first with a normwise error
481*> bound that is not guaranteed (the smallest J such
482*> that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0)
483*> the Jth right-hand side is the first with either a normwise or
484*> componentwise error bound that is not guaranteed (the smallest
485*> J such that either ERR_BNDS_NORM(J,1) = 0.0 or
486*> ERR_BNDS_COMP(J,1) = 0.0). See the definition of
487*> ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information
488*> about all of the right-hand sides check ERR_BNDS_NORM or
489*> ERR_BNDS_COMP.
490*> \endverbatim
491*
492* Authors:
493* ========
494*
495*> \author Univ. of Tennessee
496*> \author Univ. of California Berkeley
497*> \author Univ. of Colorado Denver
498*> \author NAG Ltd.
499*
500*> \ingroup hesvxx
501*
502* =====================================================================
503 SUBROUTINE chesvxx( FACT, UPLO, N, NRHS, A, LDA, AF, LDAF,
504 $ IPIV,
505 $ EQUED, S, B, LDB, X, LDX, RCOND, RPVGRW, BERR,
506 $ N_ERR_BNDS, ERR_BNDS_NORM, ERR_BNDS_COMP,
507 $ NPARAMS, PARAMS, WORK, RWORK, INFO )
508*
509* -- LAPACK driver routine --
510* -- LAPACK is a software package provided by Univ. of Tennessee, --
511* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
512*
513* .. Scalar Arguments ..
514 CHARACTER EQUED, FACT, UPLO
515 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
516 $ N_ERR_BNDS
517 REAL RCOND, RPVGRW
518* ..
519* .. Array Arguments ..
520 INTEGER IPIV( * )
521 COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
522 $ WORK( * ), X( LDX, * )
523 REAL S( * ), PARAMS( * ), BERR( * ), RWORK( * ),
524 $ err_bnds_norm( nrhs, * ),
525 $ err_bnds_comp( nrhs, * )
526* ..
527*
528* ==================================================================
529*
530* .. Parameters ..
531 REAL ZERO, ONE
532 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
533 INTEGER FINAL_NRM_ERR_I, FINAL_CMP_ERR_I, BERR_I
534 INTEGER RCOND_I, NRM_RCOND_I, NRM_ERR_I, CMP_RCOND_I
535 INTEGER CMP_ERR_I, PIV_GROWTH_I
536 parameter( final_nrm_err_i = 1, final_cmp_err_i = 2,
537 $ berr_i = 3 )
538 parameter( rcond_i = 4, nrm_rcond_i = 5, nrm_err_i = 6 )
539 parameter( cmp_rcond_i = 7, cmp_err_i = 8,
540 $ piv_growth_i = 9 )
541* ..
542* .. Local Scalars ..
543 LOGICAL EQUIL, NOFACT, RCEQU
544 INTEGER INFEQU, J
545 REAL AMAX, BIGNUM, SMIN, SMAX, SCOND, SMLNUM
546* ..
547* .. External Functions ..
548 EXTERNAL lsame, slamch, cla_herpvgrw
549 LOGICAL LSAME
550 REAL SLAMCH, CLA_HERPVGRW
551* ..
552* .. External Subroutines ..
553 EXTERNAL cheequb, chetrf, chetrs, clacpy,
555* ..
556* .. Intrinsic Functions ..
557 INTRINSIC max, min
558* ..
559* .. Executable Statements ..
560*
561 info = 0
562 nofact = lsame( fact, 'N' )
563 equil = lsame( fact, 'E' )
564 smlnum = slamch( 'Safe minimum' )
565 bignum = one / smlnum
566 IF( nofact .OR. equil ) THEN
567 equed = 'N'
568 rcequ = .false.
569 ELSE
570 rcequ = lsame( equed, 'Y' )
571 ENDIF
572*
573* Default is failure. If an input parameter is wrong or
574* factorization fails, make everything look horrible. Only the
575* pivot growth is set here, the rest is initialized in CHERFSX.
576*
577 rpvgrw = zero
578*
579* Test the input parameters. PARAMS is not tested until CHERFSX.
580*
581 IF( .NOT.nofact .AND. .NOT.equil .AND. .NOT.
582 $ lsame( fact, 'F' ) ) THEN
583 info = -1
584 ELSE IF( .NOT.lsame( uplo, 'U' ) .AND.
585 $ .NOT.lsame( uplo, 'L' ) ) THEN
586 info = -2
587 ELSE IF( n.LT.0 ) THEN
588 info = -3
589 ELSE IF( nrhs.LT.0 ) THEN
590 info = -4
591 ELSE IF( lda.LT.max( 1, n ) ) THEN
592 info = -6
593 ELSE IF( ldaf.LT.max( 1, n ) ) THEN
594 info = -8
595 ELSE IF( lsame( fact, 'F' ) .AND. .NOT.
596 $ ( rcequ .OR. lsame( equed, 'N' ) ) ) THEN
597 info = -9
598 ELSE
599 IF ( rcequ ) THEN
600 smin = bignum
601 smax = zero
602 DO 10 j = 1, n
603 smin = min( smin, s( j ) )
604 smax = max( smax, s( j ) )
605 10 CONTINUE
606 IF( smin.LE.zero ) THEN
607 info = -10
608 ELSE IF( n.GT.0 ) THEN
609 scond = max( smin, smlnum ) / min( smax, bignum )
610 ELSE
611 scond = one
612 END IF
613 END IF
614 IF( info.EQ.0 ) THEN
615 IF( ldb.LT.max( 1, n ) ) THEN
616 info = -12
617 ELSE IF( ldx.LT.max( 1, n ) ) THEN
618 info = -14
619 END IF
620 END IF
621 END IF
622*
623 IF( info.NE.0 ) THEN
624 CALL xerbla( 'CHESVXX', -info )
625 RETURN
626 END IF
627*
628 IF( equil ) THEN
629*
630* Compute row and column scalings to equilibrate the matrix A.
631*
632 CALL cheequb( uplo, n, a, lda, s, scond, amax, work,
633 $ infequ )
634 IF( infequ.EQ.0 ) THEN
635*
636* Equilibrate the matrix.
637*
638 CALL claqhe( uplo, n, a, lda, s, scond, amax, equed )
639 rcequ = lsame( equed, 'Y' )
640 END IF
641 END IF
642*
643* Scale the right-hand side.
644*
645 IF( rcequ ) CALL clascl2( n, nrhs, s, b, ldb )
646*
647 IF( nofact .OR. equil ) THEN
648*
649* Compute the LDL^H or UDU^H factorization of A.
650*
651 CALL clacpy( uplo, n, n, a, lda, af, ldaf )
652 CALL chetrf( uplo, n, af, ldaf, ipiv, work, 5*max(1,n),
653 $ info )
654*
655* Return if INFO is non-zero.
656*
657 IF( info.GT.0 ) THEN
658*
659* Pivot in column INFO is exactly 0
660* Compute the reciprocal pivot growth factor of the
661* leading rank-deficient INFO columns of A.
662*
663 IF( n.GT.0 )
664 $ rpvgrw = cla_herpvgrw( uplo, n, info, a, lda, af,
665 $ ldaf,
666 $ ipiv, rwork )
667 RETURN
668 END IF
669 END IF
670*
671* Compute the reciprocal pivot growth factor RPVGRW.
672*
673 IF( n.GT.0 )
674 $ rpvgrw = cla_herpvgrw( uplo, n, info, a, lda, af, ldaf,
675 $ ipiv,
676 $ rwork )
677*
678* Compute the solution matrix X.
679*
680 CALL clacpy( 'Full', n, nrhs, b, ldb, x, ldx )
681 CALL chetrs( uplo, n, nrhs, af, ldaf, ipiv, x, ldx, info )
682*
683* Use iterative refinement to improve the computed solution and
684* compute error bounds and backward error estimates for it.
685*
686 CALL cherfsx( uplo, equed, n, nrhs, a, lda, af, ldaf, ipiv,
687 $ s, b, ldb, x, ldx, rcond, berr, n_err_bnds, err_bnds_norm,
688 $ err_bnds_comp, nparams, params, work, rwork, info )
689*
690* Scale solutions.
691*
692 IF ( rcequ ) THEN
693 CALL clascl2 ( n, nrhs, s, x, ldx )
694 END IF
695*
696 RETURN
697*
698* End of CHESVXX
699*
700 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine cheequb(uplo, n, a, lda, s, scond, amax, work, info)
CHEEQUB
Definition cheequb.f:131
subroutine cherfsx(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)
CHERFSX
Definition cherfsx.f:400
subroutine chesvxx(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)
CHESVXX computes the solution to system of linear equations A * X = B for HE matrices
Definition chesvxx.f:508
subroutine chetrf(uplo, n, a, lda, ipiv, work, lwork, info)
CHETRF
Definition chetrf.f:175
subroutine chetrs(uplo, n, nrhs, a, lda, ipiv, b, ldb, info)
CHETRS
Definition chetrs.f:118
real function cla_herpvgrw(uplo, n, info, a, lda, af, ldaf, ipiv, work)
CLA_HERPVGRW
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
Definition clacpy.f:101
real function slamch(cmach)
SLAMCH
Definition slamch.f:68
subroutine claqhe(uplo, n, a, lda, s, scond, amax, equed)
CLAQHE scales a Hermitian matrix.
Definition claqhe.f:132
subroutine clascl2(m, n, d, x, ldx)
CLASCL2 performs diagonal scaling on a matrix.
Definition clascl2.f:89
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48