pub struct DynLu<T> { /* private fields */ }Expand description
LU decomposition of a dynamically-sized square matrix.
Stores the packed L/U factors and permutation vector.
§Example
use numeris::{DynMatrix, DynVector};
let a = DynMatrix::from_slice(2, 2, &[2.0_f64, 1.0, 5.0, 3.0]);
let lu = a.lu().unwrap();
let b = DynVector::from_slice(&[4.0, 11.0]);
let x = lu.solve(&b);
assert!((x[0] - 1.0).abs() < 1e-12);
assert!((x[1] - 2.0).abs() < 1e-12);Implementations§
Source§impl<T: LinalgScalar> DynLu<T>
impl<T: LinalgScalar> DynLu<T>
Sourcepub fn new(a: &DynMatrix<T>) -> Result<Self, LinalgError>
pub fn new(a: &DynMatrix<T>) -> Result<Self, LinalgError>
Decompose a matrix. Returns an error if the matrix is singular.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for DynLu<T>
impl<T> RefUnwindSafe for DynLu<T>where
T: RefUnwindSafe,
impl<T> Send for DynLu<T>where
T: Send,
impl<T> Sync for DynLu<T>where
T: Sync,
impl<T> Unpin for DynLu<T>where
T: Unpin,
impl<T> UnsafeUnpin for DynLu<T>
impl<T> UnwindSafe for DynLu<T>where
T: UnwindSafe,
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