1DSYSVXX(1) LAPACK driver routine (version 3.2) DSYSVXX(1)
2
3
4
6 DSYSVXX - DSYSVXX use the diagonal pivoting factorization to compute
7 the solution to a double precision system of linear equations A * X =
8 B, where A is an N-by-N symmetric matrix and X and B are N-by-NRHS
9 matrices
10
12 SUBROUTINE DSYSVXX( FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, EQUED,
13 S, B, LDB, X, LDX, RCOND, RPVGRW, BERR, N_ERR_BNDS,
14 ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS,
15 WORK, IWORK, INFO )
16
17 IMPLICIT NONE
18
19 CHARACTER EQUED, FACT, UPLO
20
21 INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS, NPARAMS,
22 N_ERR_BNDS
23
24 DOUBLE PRECISION RCOND, RPVGRW
25
26 INTEGER IPIV( * ), IWORK( * )
27
28 DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ),
29 X( LDX, * ), WORK( * )
30
31 DOUBLE PRECISION S( * ), PARAMS( * ), BERR( * ),
32 ERR_BNDS_NORM( NRHS, * ), ERR_BNDS_COMP( NRHS, * )
33
35 DSYSVXX uses the diagonal pivoting factorization to compute the
36 solution to a double precision system of linear equations A * X = B,
37 where A
38 is an N-by-N symmetric matrix and X and B are N-by-NRHS matrices.
39 If requested, both normwise and maximum componentwise error bounds
40 are returned. DSYSVXX will return a solution with a tiny
41 guaranteed error (O(eps) where eps is the working machine
42 precision) unless the matrix is very ill-conditioned, in which
43 case a warning is returned. Relevant condition numbers also are
44 calculated and returned.
45 DSYSVXX accepts user-provided factorizations and equilibration
46 factors; see the definitions of the FACT and EQUED options.
47 Solving with refinement and using a factorization from a previous
48 DSYSVXX call will also produce a solution with either O(eps)
49 errors or warnings, but we cannot make that claim for general
50 user-provided factorizations and equilibration factors if they
51 differ from what DSYSVXX would itself produce.
52
54 The following steps are performed:
55 1. If FACT = 'E', double precision scaling factors are computed to
56 equilibrate
57 the system:
58 diag(S)*A*diag(S) *inv(diag(S))*X = diag(S)*B
59 Whether or not the system will be equilibrated depends on the
60 scaling of the matrix A, but if equilibration is used, A is
61 overwritten by diag(S)*A*diag(S) and B by diag(S)*B.
62 2. If FACT = 'N' or 'E', the LU decomposition is used to factor
63 the matrix A (after equilibration if FACT = 'E') as
64 A = U * D * U**T, if UPLO = 'U', or
65 A = L * D * L**T, if UPLO = 'L',
66 where U (or L) is a product of permutation and unit upper (lower)
67 triangular matrices, and D is symmetric and block diagonal with
68 1-by-1 and 2-by-2 diagonal blocks.
69 3. If some D(i,i)=0, so that D is exactly singular, then the
70 routine returns with INFO = i. Otherwise, the factored form of A
71 is used to estimate the condition number of the matrix A (see
72 argument RCOND). If the reciprocal of the condition number is
73 less than machine precision, the routine still goes on to solve
74 for X and compute error bounds as described below.
75 4. The system of equations is solved for X using the factored form
76 of A.
77 5. By default (unless PARAMS(LA_LINRX_ITREF_I) is set to zero),
78 the routine will use iterative refinement to try to get a small
79 error and error bounds. Refinement calculates the residual to at
80 least twice the working precision.
81 6. If equilibration was used, the matrix X is premultiplied by
82 diag(R) so that it solves the original system before
83 equilibration.
84
86 Some optional parameters are bundled in the PARAMS array. These set‐
87 tings determine how refinement is performed, but often the defaults are
88 acceptable. If the defaults are acceptable, users can pass NPARAMS = 0
89 which prevents the source code from accessing the PARAMS argument.
90
91 FACT (input) CHARACTER*1
92 Specifies whether or not the factored form of the matrix A is
93 supplied on entry, and if not, whether the matrix A should be
94 equilibrated before it is factored. = 'F': On entry, AF and
95 IPIV contain the factored form of A. If EQUED is not 'N', the
96 matrix A has been equilibrated with scaling factors given by S.
97 A, AF, and IPIV are not modified. = 'N': The matrix A will be
98 copied to AF and factored.
99 = 'E': The matrix A will be equilibrated if necessary, then
100 copied to AF and factored.
101
102 N (input) INTEGER
103 The number of linear equations, i.e., the order of the matrix
104 A. N >= 0.
105
106 NRHS (input) INTEGER
107 The number of right hand sides, i.e., the number of columns of
108 the matrices B and X. NRHS >= 0.
109
110 A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
111 The symmetric matrix A. If UPLO = 'U', the leading N-by-N
112 upper triangular part of A contains the upper triangular part
113 of the matrix A, and the strictly lower triangular part of A is
114 not referenced. If UPLO = 'L', the leading N-by-N lower trian‐
115 gular part of A contains the lower triangular part of the
116 matrix A, and the strictly upper triangular part of A is not
117 referenced. On exit, if FACT = 'E' and EQUED = 'Y', A is over‐
118 written by diag(S)*A*diag(S).
119
120 LDA (input) INTEGER
121 The leading dimension of the array A. LDA >= max(1,N).
122
123 AF (input or output) DOUBLE PRECISION array, dimension (LDAF,N)
124 If FACT = 'F', then AF is an input argument and on entry con‐
125 tains the block diagonal matrix D and the multipliers used to
126 obtain the factor U or L from the factorization A = U*D*U**T or
127 A = L*D*L**T as computed by DSYTRF. If FACT = 'N', then AF is
128 an output argument and on exit returns the block diagonal
129 matrix D and the multipliers used to obtain the factor U or L
130 from the factorization A = U*D*U**T or A = L*D*L**T.
131
132 LDAF (input) INTEGER
133 The leading dimension of the array AF. LDAF >= max(1,N).
134
135 IPIV (input or output) INTEGER array, dimension (N)
136 If FACT = 'F', then IPIV is an input argument and on entry con‐
137 tains details of the interchanges and the block structure of D,
138 as determined by DSYTRF. If IPIV(k) > 0, then rows and columns
139 k and IPIV(k) were interchanged and D(k,k) is a 1-by-1 diagonal
140 block. If UPLO = 'U' and IPIV(k) = IPIV(k-1) < 0, then rows
141 and columns k-1 and -IPIV(k) were interchanged and
142 D(k-1:k,k-1:k) is a 2-by-2 diagonal block. If UPLO = 'L' and
143 IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1 and -IPIV(k)
144 were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal
145 block. If FACT = 'N', then IPIV is an output argument and on
146 exit contains details of the interchanges and the block struc‐
147 ture of D, as determined by DSYTRF.
148
149 EQUED (input or output) CHARACTER*1
150 Specifies the form of equilibration that was done. = 'N': No
151 equilibration (always true if FACT = 'N').
152 = 'Y': Both row and column equilibration, i.e., A has been
153 replaced by diag(S) * A * diag(S). EQUED is an input argument
154 if FACT = 'F'; otherwise, it is an output argument.
155
156 S (input or output) DOUBLE PRECISION array, dimension (N)
157 The scale factors for A. If EQUED = 'Y', A is multiplied on
158 the left and right by diag(S). S is an input argument if FACT
159 = 'F'; otherwise, S is an output argument. If FACT = 'F' and
160 EQUED = 'Y', each element of S must be positive. If S is out‐
161 put, each element of S is a power of the radix. If S is input,
162 each element of S should be a power of the radix to ensure a
163 reliable solution and error estimates. Scaling by powers of the
164 radix does not cause rounding errors unless the result under‐
165 flows or overflows. Rounding errors during scaling lead to
166 refining with a matrix that is not equivalent to the input
167 matrix, producing error estimates that may not be reliable.
168
169 B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS)
170 On entry, the N-by-NRHS right hand side matrix B. On exit, if
171 EQUED = 'N', B is not modified; if EQUED = 'Y', B is overwrit‐
172 ten by diag(S)*B;
173
174 LDB (input) INTEGER
175 The leading dimension of the array B. LDB >= max(1,N).
176
177 X (output) DOUBLE PRECISION array, dimension (LDX,NRHS)
178 If INFO = 0, the N-by-NRHS solution matrix X to the original
179 system of equations. Note that A and B are modified on exit if
180 EQUED .ne. 'N', and the solution to the equilibrated system is
181 inv(diag(S))*X.
182
183 LDX (input) INTEGER
184 The leading dimension of the array X. LDX >= max(1,N).
185
186 RCOND (output) DOUBLE PRECISION
187 Reciprocal scaled condition number. This is an estimate of the
188 reciprocal Skeel condition number of the matrix A after equili‐
189 bration (if done). If this is less than the machine precision
190 (in particular, if it is zero), the matrix is singular to work‐
191 ing precision. Note that the error may still be small even if
192 this number is very small and the matrix appears ill- condi‐
193 tioned.
194
195 RPVGRW (output) DOUBLE PRECISION
196 Reciprocal pivot growth. On exit, this contains the reciprocal
197 pivot growth factor norm(A)/norm(U). The "max absolute element"
198 norm is used. If this is much less than 1, then the stability
199 of the LU factorization of the (equilibrated) matrix A could be
200 poor. This also means that the solution X, estimated condition
201 numbers, and error bounds could be unreliable. If factorization
202 fails with 0<INFO<=N, then this contains the reciprocal pivot
203 growth factor for the leading INFO columns of A.
204
205 BERR (output) DOUBLE PRECISION array, dimension (NRHS)
206 Componentwise relative backward error. This is the component‐
207 wise relative backward error of each solution vector X(j)
208 (i.e., the smallest relative change in any element of A or B
209 that makes X(j) an exact solution). N_ERR_BNDS (input) INTEGER
210 Number of error bounds to return for each right hand side and
211 each type (normwise or componentwise). See ERR_BNDS_NORM and
212 ERR_BNDS_COMP below.
213
214 ERR_BNDS_NORM (output) DOUBLE PRECISION array, dimension (NRHS,
215 N_ERR_BNDS)
216 For each right-hand side, this array contains informa‐
217 tion about various error bounds and condition numbers
218 corresponding to the normwise relative error, which is
219 defined as follows: Normwise relative error in the ith
220 solution vector: max_j (abs(XTRUE(j,i) - X(j,i)))
221 ------------------------------ max_j abs(X(j,i)) The
222 array is indexed by the type of error information as
223 described below. There currently are up to three pieces
224 of information returned. The first index in
225 ERR_BNDS_NORM(i,:) corresponds to the ith right-hand
226 side. The second index in ERR_BNDS_NORM(:,err) contains
227 the following three fields: err = 1 "Trust/don't trust"
228 boolean. Trust the answer if the reciprocal condition
229 number is less than the threshold sqrt(n) *
230 dlamch('Epsilon'). err = 2 "Guaranteed" error bound:
231 The estimated forward error, almost certainly within a
232 factor of 10 of the true error so long as the next entry
233 is greater than the threshold sqrt(n) *
234 dlamch('Epsilon'). This error bound should only be
235 trusted if the previous boolean is true. err = 3
236 Reciprocal condition number: Estimated normwise recipro‐
237 cal condition number. Compared with the threshold
238 sqrt(n) * dlamch('Epsilon') to determine if the error
239 estimate is "guaranteed". These reciprocal condition
240 numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for
241 some appropriately scaled matrix Z. Let Z = S*A, where
242 S scales each row by a power of the radix so all abso‐
243 lute row sums of Z are approximately 1. See Lapack
244 Working Note 165 for further details and extra cautions.
245
246 ERR_BNDS_COMP (output) DOUBLE PRECISION array, dimension (NRHS,
247 N_ERR_BNDS)
248 For each right-hand side, this array contains informa‐
249 tion about various error bounds and condition numbers
250 corresponding to the componentwise relative error, which
251 is defined as follows: Componentwise relative error in
252 the ith solution vector: abs(XTRUE(j,i) - X(j,i)) max_j
253 ---------------------- abs(X(j,i)) The array is indexed
254 by the right-hand side i (on which the componentwise
255 relative error depends), and the type of error informa‐
256 tion as described below. There currently are up to three
257 pieces of information returned for each right-hand side.
258 If componentwise accuracy is not requested (PARAMS(3) =
259 0.0), then ERR_BNDS_COMP is not accessed. If N_ERR_BNDS
260 .LT. 3, then at most the first (:,N_ERR_BNDS) entries
261 are returned. The first index in ERR_BNDS_COMP(i,:)
262 corresponds to the ith right-hand side. The second
263 index in ERR_BNDS_COMP(:,err) contains the following
264 three fields: err = 1 "Trust/don't trust" boolean. Trust
265 the answer if the reciprocal condition number is less
266 than the threshold sqrt(n) * dlamch('Epsilon'). err = 2
267 "Guaranteed" error bound: The estimated forward error,
268 almost certainly within a factor of 10 of the true error
269 so long as the next entry is greater than the threshold
270 sqrt(n) * dlamch('Epsilon'). This error bound should
271 only be trusted if the previous boolean is true. err =
272 3 Reciprocal condition number: Estimated componentwise
273 reciprocal condition number. Compared with the thresh‐
274 old sqrt(n) * dlamch('Epsilon') to determine if the
275 error estimate is "guaranteed". These reciprocal condi‐
276 tion numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf))
277 for some appropriately scaled matrix Z. Let Z =
278 S*(A*diag(x)), where x is the solution for the current
279 right-hand side and S scales each row of A*diag(x) by a
280 power of the radix so all absolute row sums of Z are
281 approximately 1. See Lapack Working Note 165 for fur‐
282 ther details and extra cautions. NPARAMS (input) INTE‐
283 GER Specifies the number of parameters set in PARAMS.
284 If .LE. 0, the PARAMS array is never referenced and
285 default values are used.
286
287 PARAMS (input / output) DOUBLE PRECISION array, dimension NPARAMS
288 Specifies algorithm parameters. If an entry is .LT. 0.0, then
289 that entry will be filled with default value used for that
290 parameter. Only positions up to NPARAMS are accessed; defaults
291 are used for higher-numbered parameters.
292 PARAMS(LA_LINRX_ITREF_I = 1) : Whether to perform iterative
293 refinement or not. Default: 1.0D+0
294 = 0.0 : No refinement is performed, and no error bounds are
295 computed. = 1.0 : Use the extra-precise refinement algorithm.
296 (other values are reserved for future use)
297 PARAMS(LA_LINRX_ITHRESH_I = 2) : Maximum number of residual
298 computations allowed for refinement. Default: 10
299 Aggressive: Set to 100 to permit convergence using approximate
300 factorizations or factorizations other than LU. If the factor‐
301 ization uses a technique other than Gaussian elimination, the
302 guarantees in err_bnds_norm and err_bnds_comp may no longer be
303 trustworthy. PARAMS(LA_LINRX_CWISE_I = 3) : Flag determining
304 if the code will attempt to find a solution with small compo‐
305 nentwise relative error in the double-precision algorithm.
306 Positive is true, 0.0 is false. Default: 1.0 (attempt compo‐
307 nentwise convergence)
308
309 WORK (workspace) DOUBLE PRECISION array, dimension (4*N)
310
311 IWORK (workspace) INTEGER array, dimension (N)
312
313 INFO (output) INTEGER
314 = 0: Successful exit. The solution to every right-hand side is
315 guaranteed. < 0: If INFO = -i, the i-th argument had an ille‐
316 gal value
317 > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization
318 has been completed, but the factor U is exactly singular, so
319 the solution and error bounds could not be computed. RCOND = 0
320 is returned. = N+J: The solution corresponding to the Jth
321 right-hand side is not guaranteed. The solutions corresponding
322 to other right- hand sides K with K > J may not be guaranteed
323 as well, but only the first such right-hand side is reported.
324 If a small componentwise error is not requested (PARAMS(3) =
325 0.0) then the Jth right-hand side is the first with a normwise
326 error bound that is not guaranteed (the smallest J such that
327 ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth
328 right-hand side is the first with either a normwise or compo‐
329 nentwise error bound that is not guaranteed (the smallest J
330 such that either ERR_BNDS_NORM(J,1) = 0.0 or ERR_BNDS_COMP(J,1)
331 = 0.0). See the definition of ERR_BNDS_NORM(:,1) and
332 ERR_BNDS_COMP(:,1). To get information about all of the right-
333 hand sides check ERR_BNDS_NORM or ERR_BNDS_COMP.
334
335
336
337 LAPACK driver routine (versionNo3v.e2m)ber 2008 DSYSVXX(1)