Skip to content

Commit 52d3cca

Browse files
committed
Update for DiagonalArrays
1 parent 7143f78 commit 52d3cca

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ext/KroneckerArraysBlockSparseArraysExt/KroneckerArraysBlockSparseArraysExt.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ function block_axes(ax::NTuple{N,AbstractUnitRange{<:Integer}}, I::Block{N}) whe
5656
return block_axes(ax, Tuple(I)...)
5757
end
5858

59+
using DiagonalArrays: ShapeInitializer
60+
5961
## TODO: Is this needed?
6062
function Base.getindex(
6163
a::ZeroBlocks{N,KroneckerArray{T,N,A1,A2}}, I::Vararg{Int,N}
@@ -69,9 +71,9 @@ function Base.getindex(
6971
return if isactive(A1) == isactive(A2)
7072
ZeroBlocks{N,A1}(ax_a1)[I...] ZeroBlocks{N,A2}(ax_a2)[I...]
7173
elseif isactive(A1)
72-
ZeroBlocks{N,A1}(ax_a1)[I...] A2(block_ax_a2)
74+
ZeroBlocks{N,A1}(ax_a1)[I...] A2(ShapeInitializer(), block_ax_a2)
7375
elseif isactive(A2)
74-
A1(block_ax_a1) ZeroBlocks{N,A2}(ax_a2)[I...]
76+
A1(ShapeInitializer(), block_ax_a1) ZeroBlocks{N,A2}(ax_a2)[I...]
7577
end
7678
end
7779

0 commit comments

Comments
 (0)