pub struct TensorHermitianEigendecomposition {
pub eigenvalues: Vec<f64>,
pub eigenvectors: TensorDynLen,
pub eigenvector_index: DynIndex,
}Expand description
Hermitian eigendecomposition of a rank-2 TensorDynLen.
Eigenvectors are returned as a rank-2 tensor whose first index is the input matrix row index and whose second index labels eigenvector columns. The eigenvalues are detached primal values intended for nonsmooth selection logic such as truncation cutoffs.
§Examples
use tensor4all_core::{DynIndex, TensorDynLen};
let row = DynIndex::new_dyn(2);
let col = DynIndex::new_dyn(2);
let matrix = TensorDynLen::from_dense(
vec![row.clone(), col],
vec![1.0_f64, 0.0, 0.0, 2.0],
).unwrap();
let decomp = matrix.hermitian_eigendecomposition(1.0e-12).unwrap();
assert_eq!(decomp.eigenvalues, vec![1.0, 2.0]);
assert_eq!(
decomp.eigenvectors.indices(),
&[row, decomp.eigenvector_index.clone()]
);Fields§
§eigenvalues: Vec<f64>Real eigenvalues in backend Hermitian eigensolver order.
eigenvectors: TensorDynLenEigenvector matrix with one eigenvector in each column.
eigenvector_index: DynIndexIndex labeling the eigenvector columns.
Trait Implementations§
Source§impl Clone for TensorHermitianEigendecomposition
impl Clone for TensorHermitianEigendecomposition
Source§fn clone(&self) -> TensorHermitianEigendecomposition
fn clone(&self) -> TensorHermitianEigendecomposition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TensorHermitianEigendecomposition
impl !RefUnwindSafe for TensorHermitianEigendecomposition
impl Send for TensorHermitianEigendecomposition
impl Sync for TensorHermitianEigendecomposition
impl Unpin for TensorHermitianEigendecomposition
impl UnsafeUnpin for TensorHermitianEigendecomposition
impl !UnwindSafe for TensorHermitianEigendecomposition
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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