pub struct Lu {
pub lu: Vec<f64>,
pub pivots: Vec<usize>,
pub sign: f64,
pub singular: bool,
pub n: usize,
}Expand description
An in-place LU decomposition with partial pivoting (Doolittle), P·A = L·U.
Fields§
§lu: Vec<f64>Combined factors, row-major n×n: U on/above the diagonal, the strictly-lower
part of L below it (L’s unit diagonal is implicit).
pivots: Vec<usize>Row permutation: pivots[i] is the original row now in position i.
sign: f64Sign of the permutation (+1/-1), i.e. det(P).
singular: booltrue if a zero pivot was encountered (matrix is singular).
n: usizeImplementations§
Source§impl Lu
impl Lu
Sourcepub fn solve(&self, b: &[f64]) -> Option<Vec<f64>>
pub fn solve(&self, b: &[f64]) -> Option<Vec<f64>>
Solve A x = b using this factorization (apply P, forward-substitute L,
back-substitute U). None if the matrix is singular or b has the wrong length.
O(n²) given the existing O(n³) factorization — the reusable solve behind any
dense linear system (BVP Newton steps, implicit ODE stages, least-squares normal
equations).
Sourcepub fn determinant(&self) -> f64
pub fn determinant(&self) -> f64
det(A) = sign · Π U[i][i].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Lu
impl RefUnwindSafe for Lu
impl Send for Lu
impl Sync for Lu
impl Unpin for Lu
impl UnsafeUnpin for Lu
impl UnwindSafe for Lu
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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