pub struct PQLU<M: MatrixTrait> {
pub p: Vec<usize>,
pub q: Vec<usize>,
pub l: M,
pub u: M,
}
Expand description
Data structure for Complete Pivoting LU decomposition
§Usage
use peroxide::fuga::*;
let a = ml_matrix("1 2;3 4");
let pqlu = a.lu();
let (p, q, l, u) = pqlu.extract();
// p, q are permutations
// l, u are matrices
l.print(); // lower triangular
u.print(); // upper triangular
Fields§
§p: Vec<usize>
§q: Vec<usize>
§l: M
§u: M
Implementations§
source§impl PQLU<ComplexMatrix>
impl PQLU<ComplexMatrix>
sourcepub fn extract(&self) -> (Vec<usize>, Vec<usize>, ComplexMatrix, ComplexMatrix)
pub fn extract(&self) -> (Vec<usize>, Vec<usize>, ComplexMatrix, ComplexMatrix)
Extract PQLU
§Usage
extern crate peroxide;
use peroxide::fuga::*;
let a = cmatrix(vec![C64::new(1f64, 1f64),
C64::new(2f64, 2f64),
C64::new(3f64, 3f64),
C64::new(4f64, 4f64)],
2, 2, Row
);
let pqlu = a.lu();
let (p, q, l, u) = pqlu.extract();
// p, q are permutations
// l, u are matrices
println!("{}", l); // lower triangular
println!("{}", u); // upper triangular
pub fn det(&self) -> C64
pub fn inv(&self) -> ComplexMatrix
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for PQLU<M>where
M: Freeze,
impl<M> RefUnwindSafe for PQLU<M>where
M: RefUnwindSafe,
impl<M> Send for PQLU<M>where
M: Send,
impl<M> Sync for PQLU<M>where
M: Sync,
impl<M> Unpin for PQLU<M>where
M: Unpin,
impl<M> UnwindSafe for PQLU<M>where
M: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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