We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d871530 commit f031693Copy full SHA for f031693
1 file changed
src/auxiliary/blockarrays.jl
@@ -1,12 +1,9 @@
1
copy_dense(A) = copy_dense!(similar(first(A.blocks), size(A)), A)
2
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
+ for block_index in Iterators.product(blockaxes(A))
+ a = view(A, block_index...)
+ indices = getindex.(axes(block_array), block_index)
+ Adense[indices...] .= a
10
end
11
return Adense
12
0 commit comments