MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / main

Function main

19_numpy/rust/simple/examples/eigenvector.rs:4–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2use ndarray_linalg::*;
3
4fn main() {
5 let a = arr2(&[[2.0, 1.0, 2.0], [-2.0, 2.0, 1.0], [1.0, 2.0, -2.0]]);
6 let (e, vecs) = a.eig().unwrap();
7 println!("eigenvalues = \n{:?}", e);
8 println!("V = \n{:?}", vecs);
9 let a_c: Array2<c64> = a.map(|f| c64::new(*f, 0.0));
10 let av = a_c.dot(&vecs);
11 println!("AV = \n{:?}", av);
12}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected