rlumod
rlumod is a safe, no_std Rust adaptation of LUmod, Michael A.
Saunders' software for maintaining a dense square factorization
L A = U as rows and columns of A are added, removed, or replaced.
Updating the existing factors avoids refactorizing the changed matrix 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. The original software describes LUmod as suitable for
dense simplex implementations and as a building block for updating sparse
factorizations through the Schur-complement method.
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.