pub struct DenseLuBacksolver { /* private fields */ }Expand description
Synthetic dense-LU backsolver. Used in this crate’s tests to
validate the sensitivity math against known-good linear-algebra
answers without standing up the full pounce IPM. Phase B.2 ships
a real pounce-algorithm-backed implementation; this stays for
regression tests and as a reference for the trait contract.
Stores a row-major n × n matrix and reuses an in-place
Gaussian-elimination LU factor with partial pivoting. Numerical
stability is fine for the small problem sizes the unit tests
exercise (n ≤ 16).
Implementations§
Source§impl DenseLuBacksolver
impl DenseLuBacksolver
Sourcepub fn from_dense(
n: usize,
a_row_major: &[f64],
) -> Result<DenseLuBacksolver, ()>
pub fn from_dense( n: usize, a_row_major: &[f64], ) -> Result<DenseLuBacksolver, ()>
Build from a row-major n × n matrix. Returns Err(()) if
the matrix is exactly singular at LU time (zero pivot after
pivoting).
Trait Implementations§
Source§impl Clone for DenseLuBacksolver
impl Clone for DenseLuBacksolver
Source§fn clone(&self) -> DenseLuBacksolver
fn clone(&self) -> DenseLuBacksolver
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DenseLuBacksolver
impl Debug for DenseLuBacksolver
Source§impl SensBacksolver for DenseLuBacksolver
impl SensBacksolver for DenseLuBacksolver
Source§fn dim(&self) -> usize
fn dim(&self) -> usize
Size of the linear system in entries (length of
lhs and
rhs). The backsolver’s notion of “full state” — pounce’s
IPM uses the compound (x, s, λ_c, λ_d, z_l, z_u, v_l, v_u)
concatenation here.Source§fn solve(&self, rhs: &[f64], lhs: &mut [f64]) -> bool
fn solve(&self, rhs: &[f64], lhs: &mut [f64]) -> bool
Solve
K · lhs = rhs. The implementation may use rhs as
scratch; callers should treat it as moved-from on return.
lhs must have length self.dim().Source§fn natural_units_factor(&self) -> Option<&[f64]>
fn natural_units_factor(&self) -> Option<&[f64]>
Per-row factor carrying a quantity read off the converged
iterate into the units
Self::solve answers in, indexed by
compound KKT row. None when the solve ran unscaled, which is
the identity. Read moreSource§fn bound_rows(&self) -> Option<&[BoundRow]>
fn bound_rows(&self) -> Option<&[BoundRow]>
The variable behind each bound-multiplier row.
None when the
backsolver cannot report it, which leaves
crate::boundcheck::refine_step_onto_bounds with no way to
release and so pinning only. Read moreSource§fn solve_released(
&self,
_released: &[usize],
_rhs: &[f64],
_lhs: &mut [f64],
) -> bool
fn solve_released( &self, _released: &[usize], _rhs: &[f64], _lhs: &mut [f64], ) -> bool
Solve against the system with the bounds named by
released –
compound multiplier rows – taken out of the active set. Read moreSource§fn solve_released_step(
&self,
_released: &[usize],
_rhs: &[f64],
_lhs: &mut [f64],
) -> bool
fn solve_released_step( &self, _released: &[usize], _rhs: &[f64], _lhs: &mut [f64], ) -> bool
Self::solve_released against a parametric right-hand side,
which additionally needs the released multipliers moved onto
their variables’ x rows. Read moreSource§fn solve_released_pinned(
&self,
_released: &[usize],
_pinned: &[usize],
_rhs: &[f64],
_lhs: &mut [f64],
) -> bool
fn solve_released_pinned( &self, _released: &[usize], _pinned: &[usize], _rhs: &[f64], _lhs: &mut [f64], ) -> bool
Self::solve_released with each primal KKT row in
pinned carrying an extra diagonal stiff enough to hold that
coordinate in place. Read moreSource§fn supports_release(&self) -> bool
fn supports_release(&self) -> bool
Whether
Self::solve_released is implemented.Auto Trait Implementations§
impl Freeze for DenseLuBacksolver
impl RefUnwindSafe for DenseLuBacksolver
impl Send for DenseLuBacksolver
impl Sync for DenseLuBacksolver
impl Unpin for DenseLuBacksolver
impl UnsafeUnpin for DenseLuBacksolver
impl UnwindSafe for DenseLuBacksolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more