BlockArrays.jl
BlockArrays.jl copied to clipboard
Structure of blocks matrix lost on broadcast or `similar`
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?