Skip to content

Broadcasting style for FillArrays? #188

Open
@jishnub

Description

@jishnub

Perhaps we need a broadcasting rule for FillArrays that takes precedence over Broadcast.DefaultArrayStyle{0}. Currently, we obtain the somewhat unsatisfactory

julia> x = Fill(2, 10)
10-element Fill{Int64}, with entries equal to 2

julia> 2 * x * 3
10-element Fill{Int64}, with entries equal to 12

julia> 2 .* x .* 3
10-element Fill{Int64}, with entries equal to 12

julia> @. 2 * x * 3
10-element Vector{Int64}:
 12
 12
 12
 12
 12
 12
 12
 12
 12
 12

This may be resolved by defining a custom broadcast style.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions