lcp-solver 0.9.0

Lemke's algorithm for the Linear Complementarity Problem (LCP), used by general-simulator to select which piecewise-linear device segment is active each timestep instead of Newton-Raphson + voltage limiting.
Documentation
//! Lemke's algorithm for the Linear Complementarity Problem (LCP).
//!
//! Given a matrix `M` (n x n) and a vector `q` (n), find `w, z in R^n` such that
//!
//! ```text
//! w = M z + q
//! w >= 0
//! z >= 0
//! w . z = 0        (complementary: for every i, w_i == 0 or z_i == 0)
//! ```
//!
//! This is the numerical primitive `general-simulator` uses to decide, once per timestep, which
//! linear segment of each piecewise-linear device (ideal diode, ideal switch) is active — replacing
//! Newton-Raphson + voltage limiting entirely. See `docs/architecture.md` in this repository
//! for how device segments map onto `(M, q)`.
//!
//! This crate has no knowledge of circuits, devices, or `general-mna`; it only implements the
//! LCP numerics, so it can be tested and trusted in isolation first (see `tests/fixtures.rs`
//! for hand-solved textbook cases).

mod lemke;
mod tableau;

pub use lemke::{solve, solve_with_covering_vector, LcpError, Solution};