Skip to main content

Module lu

Module lu 

Source
Expand description

Dynamic LU decomposition (partial pivoting) + determinant — canonical n×n LU. Dynamic LU decomposition with partial pivoting (P·A = L·U) and determinant.

The engine’s canonical dynamic LU. The fixed-size super::StaticLuDecomposition handles only 4×4; this is the general n×n routine that the specialized libraries call (they keep only a thin error-mapping facade). Row-major, fails closed on a shape mismatch; a zero pivot is recorded in [Lu::singular] (not an error) so the determinant correctly comes out 0.

Doolittle elimination with partial pivoting — O(n³), numerically robust.

Structs§

Lu
An in-place LU decomposition with partial pivoting (Doolittle), P·A = L·U.

Functions§

determinant
Determinant of a row-major n×n matrix via LU decomposition with partial pivoting. O(n³), numerically robust; returns 0.0 for a singular matrix.
lu_decompose
LU-decompose a row-major n×n matrix with partial pivoting. The reusable primitive behind determinant (and a building block for solves / condition estimates). O(n³). Returns SolversError::InvalidDimension for an empty or non-square input.
lu_solve
Solve a general row-major n×n system A x = b via LU with partial pivoting. None on a shape mismatch or a singular matrix. The canonical dense solve for the engine.