BlockArrays.jl icon indicating copy to clipboard operation
BlockArrays.jl copied to clipboard

Structure of blocks matrix lost on broadcast or `similar`

Open yha opened this issue 3 years ago • 0 comments

using BlocksArrays, NamedArrays
m1 = mortar(NamedArray([rand(i,j) for i=1:2, j=1:3], (x=["a","b"], y=["c","d","e"])))
m2 = mortar(NamedArray([rand(i,j) for i=1:2, j=1:3], (x=["a","b"], y=["c","d","e"])))

m1 .* m2  # 2×3-blocked 3×6 BlockMatrix{Float64}

The result does not have the named blocks of the original matrices (although NamedArray itself preserves names on broadcast). similar(m1) also has the blocks but not the names, which I guess might be the source of the problem?

yha avatar Sep 14 '21 21:09 yha