1
/* ========================================================================== */
2
/* === umfpack_solve ======================================================== */
3
/* ========================================================================== */
5
/* -------------------------------------------------------------------------- */
6
/* UMFPACK Version 4.1 (Apr. 30, 2003), Copyright (c) 2003 by Timothy A. */
7
/* Davis. All Rights Reserved. See ../README for License. */
8
/* email: davis@cise.ufl.edu CISE Department, Univ. of Florida. */
9
/* web: http://www.cise.ufl.edu/research/sparse/umfpack */
10
/* -------------------------------------------------------------------------- */
21
const double Control [UMFPACK_CONTROL],
22
double Info [UMFPACK_INFO]
34
const double Control [UMFPACK_CONTROL],
35
double Info [UMFPACK_INFO]
43
const double Ax [ ], const double Az [ ],
44
double Xx [ ], double Xz [ ],
45
const double Bx [ ], const double Bz [ ],
47
const double Control [UMFPACK_CONTROL],
48
double Info [UMFPACK_INFO]
56
const double Ax [ ], const double Az [ ],
57
double Xx [ ], double Xz [ ],
58
const double Bx [ ], const double Bz [ ],
60
const double Control [UMFPACK_CONTROL],
61
double Info [UMFPACK_INFO]
69
int status, *Ap, *Ai, sys ;
70
double *B, *X, *Ax, Info [UMFPACK_INFO], Control [UMFPACK_CONTROL] ;
71
status = umfpack_di_solve (sys, Ap, Ai, Ax, X, B, Numeric, Control, Info) ;
77
long status, *Ap, *Ai, sys ;
78
double *B, *X, *Ax, Info [UMFPACK_INFO], Control [UMFPACK_CONTROL] ;
79
status = umfpack_dl_solve (sys, Ap, Ai, Ax, X, B, Numeric, Control, Info) ;
85
int status, *Ap, *Ai, sys ;
86
double *Bx, *Bz, *Xx, *Xz, *Ax, *Az, Info [UMFPACK_INFO],
87
Control [UMFPACK_CONTROL] ;
88
status = umfpack_zi_solve (sys, Ap, Ai, Ax, Az, Xx, Xz, Bx, Bz, Numeric,
95
long status, *Ap, *Ai, sys ;
96
double *Bx, *Bz, *Xx, *Xz, *Ax, *Az, Info [UMFPACK_INFO],
97
Control [UMFPACK_CONTROL] ;
98
status = umfpack_zl_solve (sys, Ap, Ai, Ax, Az, Xx, Xz, Bx, Bz, Numeric,
103
Given LU factors computed by umfpack_*_numeric (PAQ=LU, PRAQ=LU, or
104
P(R\A)Q=LU) and the right-hand-side, B, solve a linear system for the
105
solution X. Iterative refinement is optionally performed. Only square
106
systems are handled. Singular matrices result in a divide-by-zero for all
107
systems except those involving just the matrix L. Iterative refinement is
108
not performed for singular matrices. In the discussion below, n is equal
109
to n_row and n_col, because only square systems are handled.
113
The status code is returned. See Info [UMFPACK_STATUS], below.
117
Int sys ; Input argument, not modified.
119
Defines which system to solve. (') is the linear algebraic transpose
120
(complex conjugate if A is complex), and (.') is the array transpose.
122
sys value system solved
129
UMFPACK_Lat_P L.'Px=b
134
UMFPACK_Q_Uat QU.'x=b
138
Iterative refinement can be optionally performed when sys is any of
145
For the other values of the sys argument, iterative refinement is not
146
performed (Control [UMFPACK_IRSTEP], Ap, Ai, Ax, and Az are ignored).
148
Earlier versions used a string argument for sys. It was changed to an
149
integer to make it easier for a Fortran code to call UMFPACK.
151
Int Ap [n+1] ; Input argument, not modified.
152
Int Ai [nz] ; Input argument, not modified.
153
double Ax [nz] ; Input argument, not modified.
154
double Az [nz] ; Input argument, not modified, for complex versions.
156
If iterative refinement is requested (Control [UMFPACK_IRSTEP] >= 1,
157
Ax=b, A'x=b, or A.'x=b is being solved, and A is nonsingular), then
158
these arrays must be identical to the same ones passed to
159
umfpack_*_numeric. The umfpack_*_solve routine does not check the
160
contents of these arguments, so the results are undefined if Ap, Ai, Ax,
161
and/or Az are modified between the calls the umfpack_*_numeric and
162
umfpack_*_solve. These three arrays do not need to be present (NULL
163
pointers can be passed) if Control [UMFPACK_IRSTEP] is zero, or if a
164
system other than Ax=b, A'x=b, or A.'x=b is being solved, or if A is
165
singular, since in each of these cases A is not accessed.
167
Future complex version: if Ax is present and Az is NULL, then both real
168
and imaginary parts will be contained in Ax[0..2*nz-1], with Ax[2*k]
169
and Ax[2*k+1] being the real and imaginary part of the kth entry.
171
double X [n] ; Output argument.
173
double Xx [n] ; Output argument, real part.
174
double Xz [n] ; Output argument, imaginary part.
176
The solution to the linear system, where n = n_row = n_col is the
177
dimension of the matrices A, L, and U.
179
Future complex version: if Xx is present and Xz is NULL, then both real
180
and imaginary parts will be returned in Xx[0..2*n-1], with Xx[2*k] and
181
Xx[2*k+1] being the real and imaginary part of the kth entry.
183
double B [n] ; Input argument, not modified.
185
double Bx [n] ; Input argument, not modified, real part.
186
double Bz [n] ; Input argument, not modified, imaginary part.
188
The right-hand side vector, b, stored as a conventional array of size n
189
(or two arrays of size n for complex versions). This routine does not
190
solve for multiple right-hand-sides, nor does it allow b to be stored in
191
a sparse-column form.
193
Future complex version: if Bx is present and Bz is NULL, then both real
194
and imaginary parts will be contained in Bx[0..2*n-1], with Bx[2*k]
195
and Bx[2*k+1] being the real and imaginary part of the kth entry.
197
void *Numeric ; Input argument, not modified.
199
Numeric must point to a valid Numeric object, computed by
202
double Control [UMFPACK_CONTROL] ; Input argument, not modified.
204
If a (double *) NULL pointer is passed, then the default control
205
settings are used. Otherwise, the settings are determined from the
206
Control array. See umfpack_*_defaults on how to fill the Control
207
array with the default settings. If Control contains NaN's, the
208
defaults are used. The following Control parameters are used:
210
Control [UMFPACK_IRSTEP]: The maximum number of iterative refinement
211
steps to attempt. A value less than zero is treated as zero. If
212
less than 1, or if Ax=b, A'x=b, or A.'x=b is not being solved, or
213
if A is singular, then the Ap, Ai, Ax, and Az arguments are not
214
accessed. Default: 2.
216
double Info [UMFPACK_INFO] ; Output argument.
218
Contains statistics about the solution factorization. If a
219
(double *) NULL pointer is passed, then no statistics are returned in
220
Info (this is not an error condition). The following statistics are
221
computed in umfpack_*_solve:
223
Info [UMFPACK_STATUS]: status code. This is also the return value,
224
whether or not Info is present.
228
The linear system was successfully solved.
230
UMFPACK_WARNING_singular_matrix
232
A divide-by-zero occured. Your solution will contain Inf's
233
and/or NaN's. Some parts of the solution may be valid. For
234
example, solving Ax=b with
236
A = [2 0] b = [ 1 ] returns x = [ 0.5 ]
239
UMFPACK_ERROR_out_of_memory
241
Insufficient memory to solve the linear system.
243
UMFPACK_ERROR_argument_missing
245
One or more required arguments are missing. The B, X, (or
246
Bx, Bz, Xx and Xz for the complex versions) arguments
247
are always required. Info and Control are not required. Ap,
248
Ai, Ax (and Az for complex versions) are required if Ax=b,
249
A'x=b, A.'x=b is to be solved, the (default) iterative
250
refinement is requested, and the matrix A is nonsingular.
252
UMFPACK_ERROR_invalid_system
254
The sys argument is not valid, or the matrix A is not square.
256
UMFPACK_ERROR_invalid_Numeric_object
258
The Numeric object is not valid.
260
Info [UMFPACK_NROW], Info [UMFPACK_NCOL]:
261
The dimensions of the matrix A (L is n_row-by-n_inner and
262
U is n_inner-by-n_col, with n_inner = min(n_row,n_col)).
264
Info [UMFPACK_NZ]: the number of entries in the input matrix, Ap [n],
265
if iterative refinement is requested (Ax=b, A'x=b, or A.'x=b is
266
being solved, Control [UMFPACK_IRSTEP] >= 1, and A is nonsingular).
268
Info [UMFPACK_IR_TAKEN]: The number of iterative refinement steps
269
effectively taken. The number of steps attempted may be one more
270
than this; the refinement algorithm backtracks if the last
271
refinement step worsens the solution.
273
Info [UMFPACK_IR_ATTEMPTED]: The number of iterative refinement steps
274
attempted. The number of times a linear system was solved is one
275
more than this (once for the initial Ax=b, and once for each Ay=r
276
solved for each iterative refinement step attempted).
278
Info [UMFPACK_OMEGA1]: sparse backward error estimate, omega1, if
279
iterative refinement was performed, or -1 if iterative refinement
282
Info [UMFPACK_OMEGA2]: sparse backward error estimate, omega2, if
283
iterative refinement was performed, or -1 if iterative refinement
286
Info [UMFPACK_SOLVE_FLOPS]: the number of floating point operations
287
performed to solve the linear system. This includes the work
288
taken for all iterative refinement steps, including the backtrack
291
Info [UMFPACK_SOLVE_TIME]: The time taken, in seconds.
293
------------------------------------------------------------------------
294
The following statistic was added to Version 4.1:
295
------------------------------------------------------------------------
297
Info [UMFPACK_SOLVE_WALLTIME]: The wallclock time taken, in seconds.
299
Only the above listed Info [...] entries are accessed. The remaining
300
entries of Info are not accessed or modified by umfpack_*_solve.
301
Future versions might modify different parts of Info.