sparsax.umf_solve¶
- sparsax.umf_solve(Ai, Aj, Ax, b)[source]¶
Solve
A x = bfor a general (non-symmetric) sparseAvia 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 asngrows).lu_backend()chooses between them from the pattern.- Parameters:¶
- Ai¶
[n_nz]int32 — COO row indices.- Aj¶
[n_nz]int32 — COO column indices. As forlu_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:¶
xwith the same shape asb.- Raises:¶
Exception – if
Ais 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.