pub struct Eigen<R> { /* private fields */ }Expand description
The eigendecomposition A·V = V·Λ of a square matrix: its eigenvalues, the diagonal of Λ,
and its eigenvectors, the columns of V, complex in general, each of length 1. When A has
a full set of independent eigenvectors, A = V·Λ·V⁻¹. From Matrix::eigen.
§Examples
use a::math::complex::Complex;
use a::math::matrix::Matrix;
let a: Matrix<f64> = Matrix::from_rows(&[[2.0, 1.0], [1.0, 2.0]]);
let e = a.eigen();
let (v, w) = (e.vectors(), e.values());
// Each column is an eigenvector: A·v = λ·v.
let a = a.map(|&x| Complex::from(x));
for (j, &w) in w.iter().enumerate() {
let v = Matrix::from_columns(&[v.column(j)]);
let d = &(&a * &v) - &(&v * w);
assert!(d.as_slice().iter().all(|x| x.abs() < 1e-14));
}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Eigen<R>
impl<R> RefUnwindSafe for Eigen<R>
impl<R> Send for Eigen<R>
impl<R> Sync for Eigen<R>
impl<R> Unpin for Eigen<R>
impl<R> UnsafeUnpin for Eigen<R>
impl<R> UnwindSafe for Eigen<R>
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