Skip to content

Commit d4939b3

Browse files
authored
Define dataids for PseudoBlockArrays (#364)
1 parent 7f7ee11 commit d4939b3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/pseudo_blockarray.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ AbstractArray{T,N}(A::PseudoBlockArray) where {T,N} = PseudoBlockArray(AbstractA
192192

193193
copy(A::PseudoBlockArray) = PseudoBlockArray(copy(A.blocks), A.axes)
194194

195+
Base.dataids(A::PseudoBlockArray) = (Base.dataids(A.blocks)..., mapreduce(Base.dataids, (x,y) -> (x..., y...), A.axes)...)
196+
195197
###########################
196198
# AbstractArray Interface #
197199
###########################

test/test_blockarrays.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ end
379379
fill!(q2, 0)
380380
copyto!(q2, view(BA_1, Block(1)))
381381
@test q2 == q
382+
383+
@test Base.mightalias(BA_1, view(BA_1, Block(1,1)))
384+
@test Base.mightalias(BA_1, axes(BA_1, 1))
382385
end
383386
fill!(BA_1, 1.0)
384387
@test BA_1 == ones(size(BA_1))

0 commit comments

Comments
 (0)