pub struct Svd2 {
pub u: Mat2,
pub s: Vec2,
pub vt: Mat2,
}Expand description
The SVD of a 2x2 matrix (f32 precision).
Fields§
§u: Mat2The left orthogonal matrix U.
s: Vec2The singular values (diagonal entries of S).
vt: Mat2The transposed right orthogonal matrix V^T.
Implementations§
Source§impl Svd2
impl Svd2
Sourcepub fn from_matrix(m: Mat2) -> Self
pub fn from_matrix(m: Mat2) -> Self
Computes the SVD of a 2x2 matrix.
Returns the decomposition M = U * S * V^T where:
Uis an orthogonal matrixSis a diagonal matrix (stored as a vector of singular values)V^Tis the transpose of an orthogonal matrix
The singular values are sorted in descending order (s.x >= s.y).
Trait Implementations§
impl Copy for Svd2
impl StructuralPartialEq for Svd2
Auto Trait Implementations§
impl Freeze for Svd2
impl RefUnwindSafe for Svd2
impl Send for Svd2
impl Sync for Svd2
impl Unpin for Svd2
impl UnwindSafe for Svd2
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<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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.