zeros

Construct a new slice, filled with zeroes, of element type E and shape(lengths ...).

pure
zeros
(
E = double
size_t N
)
(
size_t[N] lengths...
)

Parameters

lengths size_t[N]

elements of shape

Return Value

Type: auto

new zeroes slice

Examples

import mir.algorithm.iteration : all;

//  -------
// | 0 0 0 |
// | 0 0 0 |
//  -------
auto z = zeros(2, 3);
assert(z.all!(x => x == 0));
assert(z.shape == [2, 3]);
assert(z == zeros([2, 3]));

Meta