1ZPPSVX(1) LAPACK driver routine (version 3.2) ZPPSVX(1)
2
3
4
6 ZPPSVX - uses the Cholesky factorization A = U**H*U or A = L*L**H to
7 compute the solution to a complex system of linear equations A * X =
8 B,
9
11 SUBROUTINE ZPPSVX( FACT, UPLO, N, NRHS, AP, AFP, EQUED, S, B, LDB, X,
12 LDX, RCOND, FERR, BERR, WORK, RWORK, INFO )
13
14 CHARACTER EQUED, FACT, UPLO
15
16 INTEGER INFO, LDB, LDX, N, NRHS
17
18 DOUBLE PRECISION RCOND
19
20 DOUBLE PRECISION BERR( * ), FERR( * ), RWORK( * ), S( * )
21
22 COMPLEX*16 AFP( * ), AP( * ), B( LDB, * ), WORK( * ), X( LDX, *
23 )
24
26 ZPPSVX uses the Cholesky factorization A = U**H*U or A = L*L**H to com‐
27 pute the solution to a complex system of linear equations
28 A * X = B, where A is an N-by-N Hermitian positive definite matrix
29 stored in packed format and X and B are N-by-NRHS matrices.
30 Error bounds on the solution and a condition estimate are also pro‐
31 vided.
32
34 The following steps are performed:
35 1. If FACT = 'E', real scaling factors are computed to equilibrate
36 the system:
37 diag(S) * A * diag(S) * inv(diag(S)) * X = diag(S) * B
38 Whether or not the system will be equilibrated depends on the
39 scaling of the matrix A, but if equilibration is used, A is
40 overwritten by diag(S)*A*diag(S) and B by diag(S)*B.
41 2. If FACT = 'N' or 'E', the Cholesky decomposition is used to
42 factor the matrix A (after equilibration if FACT = 'E') as
43 A = U'* U , if UPLO = 'U', or
44 A = L * L', if UPLO = 'L',
45 where U is an upper triangular matrix, L is a lower triangular
46 matrix, and ' indicates conjugate transpose.
47 3. If the leading i-by-i principal minor is not positive definite,
48 then the routine returns with INFO = i. Otherwise, the factored
49 form of A is used to estimate the condition number of the matrix
50 A. If the reciprocal of the condition number is less than machine
51 precision, INFO = N+1 is returned as a warning, but the routine
52 still goes on to solve for X and compute error bounds as
53 described below.
54 4. The system of equations is solved for X using the factored form
55 of A.
56 5. Iterative refinement is applied to improve the computed solution
57 matrix and calculate error bounds and backward error estimates
58 for it.
59 6. If equilibration was used, the matrix X is premultiplied by
60 diag(S) so that it solves the original system before
61 equilibration.
62
64 FACT (input) CHARACTER*1
65 Specifies whether or not the factored form of the matrix A is
66 supplied on entry, and if not, whether the matrix A should be
67 equilibrated before it is factored. = 'F': On entry, AFP con‐
68 tains the factored form of A. If EQUED = 'Y', the matrix A has
69 been equilibrated with scaling factors given by S. AP and AFP
70 will not be modified. = 'N': The matrix A will be copied to
71 AFP and factored.
72 = 'E': The matrix A will be equilibrated if necessary, then
73 copied to AFP and factored.
74
75 UPLO (input) CHARACTER*1
76 = 'U': Upper triangle of A is stored;
77 = 'L': Lower triangle of A is stored.
78
79 N (input) INTEGER
80 The number of linear equations, i.e., the order of the matrix
81 A. N >= 0.
82
83 NRHS (input) INTEGER
84 The number of right hand sides, i.e., the number of columns of
85 the matrices B and X. NRHS >= 0.
86
87 AP (input/output) COMPLEX*16 array, dimension (N*(N+1)/2)
88 On entry, the upper or lower triangle of the Hermitian matrix
89 A, packed columnwise in a linear array, except if FACT = 'F'
90 and EQUED = 'Y', then A must contain the equilibrated matrix
91 diag(S)*A*diag(S). The j-th column of A is stored in the array
92 AP as follows: if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for
93 1<=i<=j; if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for
94 j<=i<=n. See below for further details. A is not modified if
95 FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.
96 On exit, if FACT = 'E' and EQUED = 'Y', A is overwritten by
97 diag(S)*A*diag(S).
98
99 AFP (input or output) COMPLEX*16 array, dimension (N*(N+1)/2)
100 If FACT = 'F', then AFP is an input argument and on entry con‐
101 tains the triangular factor U or L from the Cholesky factoriza‐
102 tion A = U**H*U or A = L*L**H, in the same storage format as A.
103 If EQUED .ne. 'N', then AFP is the factored form of the equili‐
104 brated matrix A. If FACT = 'N', then AFP is an output argument
105 and on exit returns the triangular factor U or L from the
106 Cholesky factorization A = U**H*U or A = L*L**H of the original
107 matrix A. If FACT = 'E', then AFP is an output argument and on
108 exit returns the triangular factor U or L from the Cholesky
109 factorization A = U**H*U or A = L*L**H of the equilibrated
110 matrix A (see the description of AP for the form of the equili‐
111 brated matrix).
112
113 EQUED (input or output) CHARACTER*1
114 Specifies the form of equilibration that was done. = 'N': No
115 equilibration (always true if FACT = 'N').
116 = 'Y': Equilibration was done, i.e., A has been replaced by
117 diag(S) * A * diag(S). EQUED is an input argument if FACT =
118 'F'; otherwise, it is an output argument.
119
120 S (input or output) DOUBLE PRECISION array, dimension (N)
121 The scale factors for A; not accessed if EQUED = 'N'. S is an
122 input argument if FACT = 'F'; otherwise, S is an output argu‐
123 ment. If FACT = 'F' and EQUED = 'Y', each element of S must be
124 positive.
125
126 B (input/output) COMPLEX*16 array, dimension (LDB,NRHS)
127 On entry, the N-by-NRHS right hand side matrix B. On exit, if
128 EQUED = 'N', B is not modified; if EQUED = 'Y', B is overwrit‐
129 ten by diag(S) * B.
130
131 LDB (input) INTEGER
132 The leading dimension of the array B. LDB >= max(1,N).
133
134 X (output) COMPLEX*16 array, dimension (LDX,NRHS)
135 If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X to
136 the original system of equations. Note that if EQUED = 'Y', A
137 and B are modified on exit, and the solution to the equili‐
138 brated system is inv(diag(S))*X.
139
140 LDX (input) INTEGER
141 The leading dimension of the array X. LDX >= max(1,N).
142
143 RCOND (output) DOUBLE PRECISION
144 The estimate of the reciprocal condition number of the matrix A
145 after equilibration (if done). If RCOND is less than the
146 machine precision (in particular, if RCOND = 0), the matrix is
147 singular to working precision. This condition is indicated by
148 a return code of INFO > 0.
149
150 FERR (output) DOUBLE PRECISION array, dimension (NRHS)
151 The estimated forward error bound for each solution vector X(j)
152 (the j-th column of the solution matrix X). If XTRUE is the
153 true solution corresponding to X(j), FERR(j) is an estimated
154 upper bound for the magnitude of the largest element in (X(j) -
155 XTRUE) divided by the magnitude of the largest element in X(j).
156 The estimate is as reliable as the estimate for RCOND, and is
157 almost always a slight overestimate of the true error.
158
159 BERR (output) DOUBLE PRECISION array, dimension (NRHS)
160 The componentwise relative backward error of each solution vec‐
161 tor X(j) (i.e., the smallest relative change in any element of
162 A or B that makes X(j) an exact solution).
163
164 WORK (workspace) COMPLEX*16 array, dimension (2*N)
165
166 RWORK (workspace) DOUBLE PRECISION array, dimension (N)
167
168 INFO (output) INTEGER
169 = 0: successful exit
170 < 0: if INFO = -i, the i-th argument had an illegal value
171 > 0: if INFO = i, and i is
172 <= N: the leading minor of order i of A is not positive defi‐
173 nite, so the factorization could not be completed, and the
174 solution has not been computed. RCOND = 0 is returned. = N+1:
175 U is nonsingular, but RCOND is less than machine precision,
176 meaning that the matrix is singular to working precision. Nev‐
177 ertheless, the solution and error bounds are computed because
178 there are a number of situations where the computed solution
179 can be more accurate than the value of RCOND would suggest.
180
182 The packed storage scheme is illustrated by the following example when
183 N = 4, UPLO = 'U':
184 Two-dimensional storage of the Hermitian matrix A:
185 a11 a12 a13 a14
186 a22 a23 a24
187 a33 a34 (aij = conjg(aji))
188 a44
189 Packed storage of the upper triangle of A:
190 AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]
191
192
193
194 LAPACK driver routine (version 3.N2o)vember 2008 ZPPSVX(1)