JuliaArrays / BlockArrays.jl

BlockArrays for Julia
http://juliaarrays.github.io/BlockArrays.jl/
Other
195 stars 29 forks source link

a[Block(1,1)] .= bug #36

Closed dlfivefifty closed 6 years ago

dlfivefifty commented 6 years ago

The following is a bug:

julia> using BlockArrays

julia> k = 2;  N = 20; 

julia> a = BlockArray(fill(zeros(2,2),N,1), k*ones(Int64,N), [k]);

julia> a[Block(1,1)] .= [0 1; 1 0];

julia> a
20×1-blocked 40×2 BlockArrays.BlockArray{Float64,2,Array{Float64,2}}:
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
 ────────
 0.0  1.0
 1.0  0.0
dlfivefifty commented 6 years ago

Hmm, just realized the issue is that it's sharing the same zeros(2,2) for all the blocks, nevermind.