rlumod
rlumod is a safe, no_std Rust adaptation of LUmod, Michael A.
Saunders' software for updating a square matrix as rows and columns are added,
removed, or replaced, and for solving systems with the updated matrix. It
maintains the required internal representation across changes instead of
rebuilding it from scratch.
The rlumod project is an independent Rust adaptation and is not affiliated
with, endorsed by, or maintained by Michael A. Saunders or SOL.
The crate provides:
- row-and-column insertion, row replacement, column replacement, and row-and-column removal;
- in-place solution of
A x = bandA^T x = b; - safe, zero-based APIs for both
f32andf64; - caller-owned factor and workspace storage, with no heap allocation during updates or solves; and
- an optional
lumod-cfeature exposing a lower-level Rust slice API with the original LUmod names and mode arguments.
Example
use ;
let capacity = 2;
let lengths = storage_lengths.unwrap;
let mut l = vec!;
let mut u = vec!;
let = ;
let mut workspace = new.unwrap;
let mut factors =
from_storage.unwrap;
factors.push.unwrap;
factors.push.unwrap;
// The represented matrix is [[2, 5], [3, 7]].
let mut rhs = ;
factors.solve_in_place.unwrap;
assert!;
assert!;
Documentation
The API documentation describes storage requirements, preconditions, update semantics, and error behavior in detail. Build and open it locally with:
cargo doc --open
To include the compatibility API in the generated documentation:
cargo doc --all-features --open
About LUmod and SOL
The original LUmod was written by Michael A. Saunders at Stanford University's
Systems Optimization Laboratory (SOL). It maintains the factorization
L A = U, where L is a product of stabilized elementary transformations and
U is upper triangular.
See the original LUmod page at SOL for the algorithm's provenance, original distributions, and references.
License
This Rust adaptation is distributed under the MIT License. The original LUmod is used under SOL's MIT license option. Its copyright and license notice are retained in LICENSES/SOL-LUMOD-MIT.txt.