pub fn eye_single_input(n: Dynamic) -> Result<Array, Box<EvalAltResult>>
Expand description
Returns an identity matrix. If argument is a single number, then the output is a square matrix. The argument can also be an array specifying the dimensions separately.
let matrix = eye(3);
assert_eq(matrix, [[1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, 0.0, 1.0]]);
let matrix = eye([3, 4]);
assert_eq(matrix, [[1.0, 0.0, 0.0, 0.0],
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0]]);