MCPcopy Create free account
hub / github.com/Axect/Peroxide / ceye

Function ceye

src/complex/matrix.rs:1861–1867  ·  view source on GitHub ↗

MATLAB like eye - Identity matrix

(n: usize)

Source from the content-addressed store, hash-verified

1859
1860/// MATLAB like eye - Identity matrix
1861pub fn ceye(n: usize) -> ComplexMatrix {
1862 let mut m = cmatrix(vec![Complex::zero(); n * n], n, n, Shape::Row);
1863 for i in 0..n {
1864 m[(i, i)] = Complex::one();
1865 }
1866 m
1867}
1868
1869// =============================================================================
1870// Linear Algebra

Callers 1

luMethod · 0.85

Calls 1

cmatrixFunction · 0.85

Tested by

no test coverage detected