pub struct QR<T, R, C>where
DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>>,
T: Scalar,
R: DimMin<C>,
C: Dim,{ /* private fields */ }Expand description
The QR decomposition of a rectangular matrix A ∈ R^(m × n) with m >= n.
Implementations§
Trait Implementations§
Source§impl<T, R, C> Clone for QR<T, R, C>where
DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>>,
T: Scalar + Clone,
R: DimMin<C> + Clone,
C: Dim + Clone,
impl<T, R, C> Clone for QR<T, R, C>where
DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>>,
T: Scalar + Clone,
R: DimMin<C> + Clone,
C: Dim + Clone,
Source§impl<T, R, C> Debug for QR<T, R, C>where
DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>>,
T: Scalar + Debug,
R: DimMin<C> + Debug,
C: Dim + Debug,
impl<T, R, C> Debug for QR<T, R, C>where
DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>>,
T: Scalar + Debug,
R: DimMin<C> + Debug,
C: Dim + Debug,
Source§impl<T, R, C> QrDecomposition<T, R, C> for QR<T, R, C>where
DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>> + Allocator<C>,
R: DimMin<C, Output = C>,
C: Dim,
T: Scalar + RealField + QrReal,
impl<T, R, C> QrDecomposition<T, R, C> for QR<T, R, C>where
DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>> + Allocator<C>,
R: DimMin<C, Output = C>,
C: Dim,
T: Scalar + RealField + QrReal,
Source§fn solve_mut<C2: Dim, S, S2>(
&self,
x: &mut Matrix<T, C, C2, S2>,
b: Matrix<T, R, C2, S>,
) -> Result<(), Error>where
S: RawStorageMut<T, R, C2> + IsContiguous,
S2: RawStorageMut<T, C, C2> + IsContiguous,
T: Zero,
fn solve_mut<C2: Dim, S, S2>(
&self,
x: &mut Matrix<T, C, C2, S2>,
b: Matrix<T, R, C2, S>,
) -> Result<(), Error>where
S: RawStorageMut<T, R, C2> + IsContiguous,
S2: RawStorageMut<T, C, C2> + IsContiguous,
T: Zero,
Solve the square or overdetermined system in
A X = B, where X ∈ R^(n × k),
B ∈ R^(m × k) in a least-squares sense, such that || A X - B||^2
is minimized. The solution is placed into the matrix X ∈ R^(n × k). Read moreSource§fn shape_generic(&self) -> (R, C)
fn shape_generic(&self) -> (R, C)
Shape of the original matrix
A.Source§fn solve<C2: Dim, S>(
&self,
rhs: Matrix<T, R, C2, S>,
) -> Result<OMatrix<T, C, C2>, Error>where
S: RawStorageMut<T, R, C2> + IsContiguous + Storage<T, R, C2>,
T: Zero,
DefaultAllocator: Allocator<C, C2> + Allocator<R, C2>,
fn solve<C2: Dim, S>(
&self,
rhs: Matrix<T, R, C2, S>,
) -> Result<OMatrix<T, C, C2>, Error>where
S: RawStorageMut<T, R, C2> + IsContiguous + Storage<T, R, C2>,
T: Zero,
DefaultAllocator: Allocator<C, C2> + Allocator<R, C2>,
Solve the overdetermined linear system with the given right hand side
in a least squares sense, see the comments on Self::solve_mut.
Source§fn q_mul_mut<C2, S>(&self, b: &mut Matrix<T, R, C2, S>) -> Result<(), Error>
fn q_mul_mut<C2, S>(&self, b: &mut Matrix<T, R, C2, S>) -> Result<(), Error>
Efficiently calculate the matrix product
Q B of the factor Q with a
given matrix B. Q acts as if it is a matrix of dimension m × m, so
we require B ∈ R^(m × k). The product is calculated in place and
must only be considered valid when the function returns without error.Source§fn q_tr_mul_mut<C2, S>(&self, b: &mut Matrix<T, R, C2, S>) -> Result<(), Error>
fn q_tr_mul_mut<C2, S>(&self, b: &mut Matrix<T, R, C2, S>) -> Result<(), Error>
Efficiently calculate the matrix product
Q^T B of the factor Q with a
given matrix B. Q acts as if it is a matrix of dimension m × m, so
we require B ∈ R^(m × k). The product is calculated in place and
must only be considered valid when the function returns without error.Source§fn mul_q_mut<R2, S>(&self, b: &mut Matrix<T, R2, R, S>) -> Result<(), Error>
fn mul_q_mut<R2, S>(&self, b: &mut Matrix<T, R2, R, S>) -> Result<(), Error>
Efficiently calculate the matrix product
B Q of the factor Q with a
given matrix B. Q acts as if it is a matrix of dimension m × m, so
we require B ∈ R^(k × m). The product is calculated in place and
must only be considered valid when the function returns without error.Source§fn mul_q_tr_mut<R2, S>(&self, b: &mut Matrix<T, R2, R, S>) -> Result<(), Error>
fn mul_q_tr_mut<R2, S>(&self, b: &mut Matrix<T, R2, R, S>) -> Result<(), Error>
Efficiently calculate the matrix product
B Q^T of the factor Q with a
given matrix B. Q acts as if it is a matrix of dimension m × m, so
we require B ∈ R^(k × m). The product is calculated in place and
must only be considered valid when the function returns without error.Source§fn r_mul_mut<C2, S2>(&self, b: &mut Matrix<T, C, C2, S2>) -> Result<(), Error>
fn r_mul_mut<C2, S2>(&self, b: &mut Matrix<T, C, C2, S2>) -> Result<(), Error>
Multiply
R*B and place the result in B. R is treated as an m × m
upper triangular matrix. The product is calculated in place and must
only be considered valid when the function returns
without error. Read moreSource§fn r_tr_mul_mut<C2, S2>(
&self,
b: &mut Matrix<T, C, C2, S2>,
) -> Result<(), Error>
fn r_tr_mul_mut<C2, S2>( &self, b: &mut Matrix<T, C, C2, S2>, ) -> Result<(), Error>
Multiply
R^T * B and place the result in B. R is treated as an m × m
upper triangular matrix. The product is calculated in place and must
only be considered valid when the function returns
without error. Read moreSource§fn mul_r_mut<R2, S2>(&self, b: &mut Matrix<T, R2, C, S2>) -> Result<(), Error>
fn mul_r_mut<R2, S2>(&self, b: &mut Matrix<T, R2, C, S2>) -> Result<(), Error>
Multiply
B*R and place the result in B. R is treated as an m × m
upper triangular matrix. The product is calculated in place and must
only be considered valid when the function returns
without error. Read moreSource§fn mul_r_tr_mut<R2, S2>(
&self,
b: &mut Matrix<T, R2, C, S2>,
) -> Result<(), Error>
fn mul_r_tr_mut<R2, S2>( &self, b: &mut Matrix<T, R2, C, S2>, ) -> Result<(), Error>
Multiply
B*R^T and place the result in B. R is treated as an m × m
upper triangular matrix. The product is calculated in place and must
only be considered valid when the function returns
without error. Read moreSource§fn q(&self) -> OMatrix<T, R, DimMinimum<R, C>>
fn q(&self) -> OMatrix<T, R, DimMinimum<R, C>>
Computes the orthonormal matrix
Q ∈ R^(m × n) of this decomposition.
Note that this matrix has economy dimensions, which means it is not
square unless A is square. It satisfies Q^T Q = I. Note further
that it is typically not necessary to compute Q explicitly. Rather,
check if some of the provided multiplication functions can help to
calculate the matrix products Q B, B Q, Q^T B, B Q^T more efficiently. Read moreSource§fn r(&self) -> OMatrix<T, DimMinimum<R, C>, C>where
DefaultAllocator: Allocator<R, C> + Allocator<R, DimMinimum<R, C>> + Allocator<DimMinimum<R, C>, C> + Allocator<DimMinimum<R, C>>,
fn r(&self) -> OMatrix<T, DimMinimum<R, C>, C>where
DefaultAllocator: Allocator<R, C> + Allocator<R, DimMinimum<R, C>> + Allocator<DimMinimum<R, C>, C> + Allocator<DimMinimum<R, C>>,
Retrieves the upper trapezoidal submatrix
R of this decomposition.
Note that it’s typically not necessary to construct this matrix directly
and check if any of the provided multiplication functions can be used
instead. Read moreimpl<T: Scalar + Copy, R: DimMin<C>, C: Dim> Copy for QR<T, R, C>where
DefaultAllocator: Allocator<R, C> + Allocator<DimMinimum<R, C>>,
OMatrix<T, R, C>: Copy,
OVector<T, DimMinimum<R, C>>: Copy,
Auto Trait Implementations§
impl<T, R, C> !Freeze for QR<T, R, C>
impl<T, R, C> !RefUnwindSafe for QR<T, R, C>
impl<T, R, C> !Send for QR<T, R, C>
impl<T, R, C> !Sync for QR<T, R, C>
impl<T, R, C> !Unpin for QR<T, R, C>
impl<T, R, C> !UnwindSafe for QR<T, R, C>
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§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.