chrissimpkins/vectora

Add `matrix!` macro for initialization of `Matrix` structs with array-like syntax

Opened this issue · 1 comments

Add a matrix! macro that supports the following Matrix struct initialization idioms:

With row vectors that define each ordered scalar value

let m = matrix!(
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
);

With row vectors that use an array-like repetition pattern

The following will make a 3 x 5 Matrix filled with 1's.

let m = matrix!(
    [1; 5],
    [1; 5],
    [1; 5]
);

This macro will take row vectors only.

Added in #84