pub struct SvdResult<T: TensorScalar> {
pub u: TypedTensor<T>,
pub s: TypedTensor<T::Real>,
pub vt: TypedTensor<T>,
}Expand description
Result of SVD decomposition A = U * diag(S) * Vt.
The singular values are stored in a real-valued typed tensor, even when the input matrix is complex.
§Examples
use tensor4all_tensorbackend::svd_backend;
use tenferro::TypedTensor;
let a = TypedTensor::<f64>::from_vec(vec![2, 2], vec![1.0, 0.0, 0.0, 2.0]);
let result = svd_backend(&a).unwrap();
assert_eq!(result.u.shape, vec![2, 2]);
assert_eq!(result.s.shape, vec![2]);
assert_eq!(result.vt.shape, vec![2, 2]);Fields§
§u: TypedTensor<T>Left singular vectors.
s: TypedTensor<T::Real>Singular values.
vt: TypedTensor<T>Right singular vectors transposed.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for SvdResult<T>
impl<T> RefUnwindSafe for SvdResult<T>where
T: RefUnwindSafe,
<T as TensorScalar>::Real: RefUnwindSafe,
impl<T> Send for SvdResult<T>
impl<T> Sync for SvdResult<T>
impl<T> Unpin for SvdResult<T>
impl<T> UnsafeUnpin for SvdResult<T>
impl<T> UnwindSafe for SvdResult<T>where
T: UnwindSafe,
<T as TensorScalar>::Real: 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,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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