Skip to content

Commit ab44000

Browse files
authored
Add Support for BitVector and BitMatrix Indexing
Fixes #707 .
1 parent cc71b51 commit ab44000

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/atoms/IndexAtom.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ function Base.getindex(x::AbstractExpr, I::AbstractVector{Bool})
117117
return [xi for (xi, ii) in zip(x, I) if ii]
118118
end
119119

120+
function Base.getindex(x::AbstractExpr, I::BitMatrix)
121+
return [xi for (xi, ii) in zip(x, I) if ii]
122+
end
123+
124+
function Base.getindex(x::AbstractExpr, I::BitVector)
125+
return [xi for (xi, ii) in zip(x, I) if ii]
126+
end
127+
120128
# All rows and columns
121129
Base.getindex(x::AbstractExpr, ::Colon, ::Colon) = x
122130

0 commit comments

Comments
 (0)