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§
source§impl<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 into_decomp(self) -> (Array2<A>, ArrayBase<S, Ix2>)
pub fn into_decomp(self) -> (Array2<A>, ArrayBase<S, Ix2>)
Generate both Q
and R
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> Freeze for QRDecomp<A, S>where
S: Freeze,
impl<A, S> RefUnwindSafe for QRDecomp<A, S>where
S: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, S> Send for QRDecomp<A, S>
impl<A, S> Sync for QRDecomp<A, S>
impl<A, S> Unpin for QRDecomp<A, S>where
S: Unpin,
impl<A, S> UnwindSafe for QRDecomp<A, S>where
S: UnwindSafe,
A: RefUnwindSafe,
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
)