Function jamml::initializers::fn_mat
source · Expand description
Creates a m
by n
matrix of by using function f
to determine each element.
f
shound be a function that takes no arguments and return T
let x = fn_mat(4, 2, ||{2*4});
let y = vec![vec![8, 8],
vec![8, 8],
vec![8, 8],
vec![8, 8]];
assert_eq!(x, y);