Skip to content

Commit 61990ee

Browse files
committed
fix copy_dense!
1 parent 846c90d commit 61990ee

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/auxiliary/blockarrays.jl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
copy_dense(A) = copy_dense!(similar(first(A.blocks), size(A)), A)
22
function copy_dense!(Adense, A)
3-
for bj in blockaxes(A, 2)
4-
js = axes(A, 2)[bj]
5-
for bi in blockaxes(A, 1)
6-
a = view(A, bi, bj)
7-
is = axes(A, 1)[bi]
8-
Adense[is, js] = @view A[block_index...]
9-
end
3+
for block_index in Iterators.product(blockaxes(A)...)
4+
a = view(A, block_index...)
5+
indices = getindex.(axes(A), block_index)
6+
Adense[indices...] .= a
107
end
118
return Adense
129
end

0 commit comments

Comments
 (0)