Macro matrix

Source
macro_rules! matrix {
    ($([$($elem:expr),* $(,)*]),* $(,)*) => { ... };
}
Expand description

Creates a matrix from the arguments.

ยงExamples

let a = matrix![
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0]
];
assert_eq!(2, a.row_count());
assert_eq!(3, a.col_count());
assert_eq!(false, a.is_transposed());
assert_eq!(vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0], a.elems());