Skip to content

Commit c62d761

Browse files
committed
Define dataids for PseudoBlockArrays (#364)
1 parent ab3dce9 commit c62d761

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
@@ -343,6 +343,9 @@ end
343343
fill!(q2, 0)
344344
copyto!(q2, view(BA_1, Block(1)))
345345
@test q2 == q
346+
347+
@test Base.mightalias(BA_1, view(BA_1, Block(1,1)))
348+
@test Base.mightalias(BA_1, axes(BA_1, 1))
346349
end
347350
fill!(BA_1, 1.0)
348351
@test BA_1 == ones(size(BA_1))

0 commit comments

Comments
 (0)