[][src]Function jamml::initializers::identity_mat

pub fn identity_mat<T: NumAssign + Copy>(m: usize) -> Mat<T>

Creates a m by m identity matrix of type T

let x = identity_mat::<i32>(4);
let y = vec![vec![1, 0, 0, 0],
             vec![0, 1, 0, 0],
             vec![0, 0, 1, 0],
             vec![0, 0, 0, 1]];
assert_eq!(x, y);