identity

Function identity 

Source
pub fn identity(dim: usize) -> Matrix
Expand description

Returns a square Identity Matrix with length and width provided by the parameter dim.

ยงExamples

use matrix_mc::{matrix, identity};
 
let method1 = matrix![
    1, 0, 0;
    0, 1, 0;
    0, 0, 1
];
 
let method2 = identity(3);
 
assert_eq!(method1, method2);