Trait ArrayLinalgEigen

Source
pub trait ArrayLinalgEigen<N: NumericOps>
where Self: Sized + Clone,
{ // Required methods fn eigvals(&self) -> Result<Vec<Array<N>>, ArrayError>; fn eig(&self) -> LinalgResult<N>; }
Expand description

ArrayTrait - Array Linalg Eigen functions

Required Methods§

Source

fn eigvals(&self) -> Result<Vec<Array<N>>, ArrayError>

Compute the eigenvalues of a square array

§Examples
use arr_rs::prelude::*;

let array = Array::new(vec![12., -51., 4., 6., 167., -68., -4., 24., -41.], vec![3, 3]).unwrap();
let vals = array.eigvals().unwrap()[0].clone();
assert_eq!(Array::flat(vec![156.20350762022625, -35.473244608879945, 17.26973698865371]).unwrap(), vals);
§Errors

may returns ArrayError

Source

fn eig(&self) -> LinalgResult<N>

Compute the eigenvalues and right eigenvectors of a square array

§Examples
use arr_rs::prelude::*;

let array = Array::new(vec![12., -51., 4., 6., 167., -68., -4., 24., -41.], vec![3, 3]).unwrap();
let (vals, vecs) = array.eig().unwrap()[0].clone();
assert_eq!(Array::flat(vec![156.20350762022625, -35.473244608879945, 17.26973698865371]).unwrap(), vals);
assert_eq!(Array::new(vec![0.3274744043621118, 0.2741043942532785, -0.9929229419852038, -0.9370666300603048, 0.3040145084128465, 0.08536232642252124, -0.12110592601150529, 0.9123825731158716, 0.08256696983166067], vec![3, 3]).unwrap(), vecs);
§Errors

may returns ArrayError

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<N: NumericOps> ArrayLinalgEigen<N> for Result<Array<N>, ArrayError>

Implementors§