Skip to content

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

@chrissimpkins

Description

@chrissimpkins

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions