Function jamml::initializers::one_mat

source ·
pub fn one_mat<T: NumAssign + Copy>(m: usize, n: usize) -> Mat<T>
Expand description

Creates a m by n matrix of type T, where each element is T::one()

let x = one_mat::<i32>(3, 2);
let y = vec![vec![1, 1],
             vec![1, 1],
             vec![1, 1]];
assert_eq!(x, y)