pub struct SvdResult<T: TensorScalar> { /* private fields */ }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_col_major(vec![2, 2], vec![1.0, 0.0, 0.0, 2.0])?;
let result = svd_backend(&a)?;
assert_eq!(result.u().shape(), &[2, 2]);
assert_eq!(result.s().shape(), &[2]);
assert_eq!(result.vt().shape(), &[2, 2]);Implementations§
Source§impl<T: TensorScalar> SvdResult<T>
impl<T: TensorScalar> SvdResult<T>
Sourcepub fn into_parts(
self,
) -> (TypedTensor<T>, TypedTensor<T::Real>, TypedTensor<T>)
pub fn into_parts( self, ) -> (TypedTensor<T>, TypedTensor<T::Real>, TypedTensor<T>)
Consume the decomposition into (U, S, Vt).
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for SvdResult<T>
impl<T> !RefUnwindSafe for SvdResult<T>
impl<T> !UnwindSafe for SvdResult<T>
impl<T> Send for SvdResult<T>
impl<T> Sync for SvdResult<T>
impl<T> Unpin for SvdResult<T>
impl<T> UnsafeUnpin for SvdResult<T>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
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