mtl5.sparse.splu#

mtl5.sparse.splu(A, ordering: str = 'colamd', threshold: float = 1.0, pivot_perturb: float = 0.0, accumulator: str | None = None)#

LU-factorize a square sparse matrix (Gilbert-Peierls, threshold pivoting).

Accepts an MTL5 or scipy sparse matrix. The dtype of A selects the precision of the factors — pass a float32 matrix to factor cheaply and recover accuracy with mtl5.mixed.iterative_refine.

ordering is one of orderings(): “colamd” (default; column minimum degree, suits unsymmetric matrices), “amd” (symmetric minimum degree), “rcm” (bandwidth reducing), “nd” (nested dissection, for large meshes) or “natural” (no fill reduction).

threshold is the partial-pivoting threshold: 1.0 is classic partial pivoting, smaller values trade stability for less fill. pivot_perturb, if nonzero, replaces a zero pivot instead of raising — check .num_perturbed afterwards.

The returned object exposes .solve(b) and .refactor(A2).

accumulator= types the dense numeric workspace, so a float32 factor can accumulate its updates in float64 (“f64”) or with an FMA (“fma32”/”fma64”). The factor itself stays in the element type — only the arithmetic that produced it widens. This is the mixed-precision knob a fixed-precision library cannot offer; see mtl5.sparse module docs for the measurement.