Skip to main content

Crate gridoxide_sparse

Crate gridoxide_sparse 

Source
Expand description

The sparse linear algebra under gridoxide’s solvers.

Every Newton loop in gridoxide factors a real sparse system whose pattern is fixed and whose values change every iteration. sparse::LinearSolver is that contract, and each backend here implements it:

  • sparse::RealSparseSystem, on faer — the default;
  • klu_native::KluNativeSystem, a pure-Rust port of SuiteSparse KLU;
  • sparse_klu::KluRealSystem, the vendored KLU over FFI (feature klu);
  • sparse_pardiso::PardisoRealSystem, oneMKL PARDISO (feature pardiso).

lu::SparseLu picks one of them at run time. block_sparse is the 2×2-block LU power flow’s Block backend uses, and sparse also holds the complex and fully-fixed factorizations the linear methods need.

Modules§

block_sparse
Experimental block-per-bus sparse LU backend for symmetric power flow, mirroring power-grid-model’s approach of grouping each bus’s own unknowns (angle, voltage magnitude) into one dense 2×2 block instead of two separate scalar unknowns scattered across the Jacobian.
klu_native
A from-scratch Rust port of the vendored SuiteSparse KLU solver (vendor/suitesparse/{BTF,AMD,KLU}/, v7.12.2 — see vendor/suitesparse/PROVENANCE.md for the upstream tag/commit this was ported from) — a fourth, always-built JacobianBackend alongside Scalar, Block, and the FFI-backed Klu (sparse_klu.rs).
lu
The sparse LU backend, chosen at run time.
sparse
Thin internal wrapper around faer’s sparse LU, isolating gridoxide’s power-flow math from the specific sparse-solver backend. Both a general (non-symmetric, since phase-shifting transformers make the admittance matrix non-Hermitian) complex solve and a real solve are provided, since Newton-Raphson needs the latter for its Jacobian and the linear initial-guess warm start needs the former for the Y-bus.