pub fn zeros_single_input(n: Dynamic) -> Result<Array, Box<EvalAltResult>>
Expand description
Return a matrix of zeros. Can be called with a single integer argument (indicating the square matrix of that size) or with an array argument (indicating the size for each dimension).
let matrix = zeros(3);
assert_eq(matrix, [[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0]]);
let matrix = zeros([3, 3]);
assert_eq(matrix, [[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0]]);
let matrix = zeros([3]);
assert_eq(matrix, [0.0, 0.0, 0.0]);
let matrix = zeros([3, 3, 3]);
assert_eq(matrix, [[[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0]],
[[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0]],
[[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0]]]);