Skip to content

Broadcast for diagonal should be lazy #48871

Open
@putianyi889

Description

@putianyi889

Similar issue #48443
Many other functions that should be equivalent to their broadcasted version have the same problem (although some of them don't even lazy broadcast to ranges). Here is an example.

julia> Diagonal(1:5)+Diagonal(1:5) |> typeof
Diagonal{Int64, StepRangeLen{Int64, Int64, Int64, Int64}}

julia> Diagonal(1:5).+Diagonal(1:5) |> typeof
Diagonal{Int64, Vector{Int64}}

julia> (1:5) .+ (1:5) |> typeof
StepRangeLen{Int64, Int64, Int64, Int64}

Metadata

Metadata

Assignees

No one assigned

    Labels

    broadcastApplying a function over a collection

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions