Struct linfa_linalg::qr::QRDecomp
source · [−]pub struct QRDecomp<A, S: DataMut<Elem = A>> { /* private fields */ }
Expand description
Compact representation of a QR decomposition. Can be used to yield the Q
and R
matrices or
to calculate the inverse or solve a system.
Implementations
sourceimpl<A: NdFloat, S: DataMut<Elem = A>> QRDecomp<A, S>
impl<A: NdFloat, S: DataMut<Elem = A>> QRDecomp<A, S>
sourcepub fn generate_q(&self) -> Array2<A>
pub fn generate_q(&self) -> Array2<A>
Generate semi-orthogonal Q
matrix
sourcepub fn into_r(self) -> ArrayBase<S, Ix2>
pub fn into_r(self) -> ArrayBase<S, Ix2>
Consumes self
to generate the upper-triangular R
matrix
sourcepub fn solve_into<Si: DataMut<Elem = A>>(
&self,
b: ArrayBase<Si, Ix2>
) -> Result<ArrayBase<Si, Ix2>>
pub fn solve_into<Si: DataMut<Elem = A>>(
&self,
b: ArrayBase<Si, Ix2>
) -> Result<ArrayBase<Si, Ix2>>
Solves A * x = b
, where A
is the original matrix. Used to calculate least squares for
“thin” matrices (rows >= cols).
sourcepub fn solve_tr_into<Si: DataMut<Elem = A>>(
&self,
b: ArrayBase<Si, Ix2>
) -> Result<Array2<A>>
pub fn solve_tr_into<Si: DataMut<Elem = A>>(
&self,
b: ArrayBase<Si, Ix2>
) -> Result<Array2<A>>
Solves A.t * x = b
, where A
is the original matrix. Used to calculate least squares for
“wide” matrices (rows < cols).
sourcepub fn solve<Si: Data<Elem = A>>(
&self,
b: &ArrayBase<Si, Ix2>
) -> Result<Array2<A>>
pub fn solve<Si: Data<Elem = A>>(
&self,
b: &ArrayBase<Si, Ix2>
) -> Result<Array2<A>>
Solves A * x = b
, where A
is the original matrix.
sourcepub fn solve_tr<Si: Data<Elem = A>>(
&self,
b: &ArrayBase<Si, Ix2>
) -> Result<Array2<A>>
pub fn solve_tr<Si: Data<Elem = A>>(
&self,
b: &ArrayBase<Si, Ix2>
) -> Result<Array2<A>>
Solves A.t * x = b
, where A
is the original matrix.
sourcepub fn is_invertible(&self) -> bool
pub fn is_invertible(&self) -> bool
Checks if original matrix is invertible.
Trait Implementations
Auto Trait Implementations
impl<A, S> RefUnwindSafe for QRDecomp<A, S> where
A: RefUnwindSafe,
S: RefUnwindSafe,
impl<A, S> Send for QRDecomp<A, S> where
A: Send,
S: Send,
impl<A, S> Sync for QRDecomp<A, S> where
A: Sync,
S: Sync,
impl<A, S> Unpin for QRDecomp<A, S> where
S: Unpin,
impl<A, S> UnwindSafe for QRDecomp<A, S> where
A: RefUnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more