sparsax.umf_solve

sparsax.umf_solve(Ai, Aj, Ax, b)[source]

Solve A x = b for a general (non-symmetric) sparse A via UMFPACK.

Interchangeable with lu_solve() — same arguments, same result, same JIT/vmap/AD behaviour — but routed through SuiteSparse UMFPACK’s multifrontal LU rather than KLU. Prefer it when the graph is dense enough that KLU’s pivot-ordering reuse has stopped paying (see the module notes: KLU wins several-fold on contiguity-style graphs, UMFPACK wins several-fold once mean degree passes roughly 15-30, with the crossover falling as n grows). lu_backend() chooses between them from the pattern.

Parameters:
Ai

[n_nz] int32 — COO row indices.

Aj

[n_nz] int32 — COO column indices. As for lu_solve(), the full matrix is used (no upper-triangle folding).

Ax

[n_nz] float64 — COO values. Duplicates are summed.

b

[n] or [n, n_rhs] float64 — right-hand side(s).

Returns:

x with the same shape as b.

Raises:

Exception – if A is singular or holds a non-finite value (raised by the XLA runtime with the UMFPACK status in the message). set_options(on_failure="nan") returns NaN instead.

Note

Iterative refinement is off (UMFPACK’s default is two steps), so a solve costs the same triangular work as its KLU counterpart and the two backends can be timed against each other fairly.