Skip to content

Support broadcasting I #955

Open
Open
@LilithHafner

Description

@LilithHafner

It would be nice to create this matrix:

1 0 0 -1 0 0
0 1 0 0 -1 0
0 0 1 0 0 -1

with a single allocation by broadcasting I

x = Matrix{Int}(undef, 3, 6)
x[1:3, 1:3] .= I
x[1:3, 4:6] .= -I

Metadata

Metadata

Assignees

No one assigned

    Labels

    broadcastApplying a function over a collectionfeatureIndicates new feature / enhancement requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions