pub struct Lu<T, F = Vec<T>, P = Vec<usize>> {
pub n: usize,
pub factors: F,
pub perm: P,
/* private fields */
}Expand description
An LU factorization with partial pivoting of an n×n matrix. factors packs L below the diagonal and U on and above it. L’s diagonal is 1 and isn’t stored. Unlike the crate’s other matrices, factors is column-major: item (i, j) is factors[j * n + i]. Row i of L U is row perm[i] of the factored matrix. lu returns one that owns its factors. LuRef borrows them.
Fields§
§n: usize§factors: F§perm: PImplementations§
Source§impl<T: Factor, F: AsRef<[T]>, P: AsRef<[usize]>> Lu<T, F, P>
impl<T: Factor, F: AsRef<[T]>, P: AsRef<[usize]>> Lu<T, F, P>
Sourcepub fn solve(&self, b: &[T], k: usize) -> Vec<T>
pub fn solve(&self, b: &[T], k: usize) -> Vec<T>
The solution x of a x = b, for the factored a and the n×k matrix b, as an n×k matrix.
Sourcepub fn lower(&self) -> Vec<T>
pub fn lower(&self) -> Vec<T>
L as an n×n matrix, with ones on its diagonal and zeros above it.
Sourcepub fn determinant(&self) -> T
pub fn determinant(&self) -> T
The factored matrix’s determinant: the product of U’s diagonal, negated where perm is odd.
Sourcepub fn log_determinant(&self) -> (T, T::Real)
pub fn log_determinant(&self) -> (T, T::Real)
The factored matrix’s determinant as a sign and the natural logarithm of its magnitude, which can’t overflow. The sign has magnitude 1, or is 0 with a logarithm of -∞ for a singular matrix.
Trait Implementations§
impl<T: Copy, F: Copy, P: Copy> Copy for Lu<T, F, P>
impl<T: PartialEq, F: PartialEq, P: PartialEq> StructuralPartialEq for Lu<T, F, P>
Auto Trait Implementations§
impl<T, F, P> Forget for Lu<T, F, P>
impl<T, F, P> Freeze for Lu<T, F, P>
impl<T, F, P> RefUnwindSafe for Lu<T, F, P>
impl<T, F, P> Send for Lu<T, F, P>
impl<T, F, P> Sync for Lu<T, F, P>
impl<T, F, P> Unpin for Lu<T, F, P>
impl<T, F, P> UnsafeUnpin for Lu<T, F, P>
impl<T, F, P> UnwindSafe for Lu<T, F, P>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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