Skip to content

Commit

Permalink
Merge pull request #3666 from JuliaReach/schillic/in_emptyset
Browse files Browse the repository at this point in the history
Assertion in `in` for `EmptySet`
  • Loading branch information
schillic authored Dec 13, 2024
2 parents aa43c7b + 6b6af35 commit 64800d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Sets/EmptySet/in.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
function (::AbstractVector, ::EmptySet)
function (v::AbstractVector, ∅::EmptySet)
@assert length(v) == dim(∅) "the dimensions should match, but they are $(length(v)) and " *
"$(dim(∅)), respectively"
return false
end
2 changes: 1 addition & 1 deletion src/Sets/EmptySet/isapprox.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function (∅₁::EmptySet, ∅₂::EmptySet)
@assert dim(∅₁) == dim(∅₂) "the dimensions of the given sets should match, " *
"but they are $(dim(∅₁)) and $(dim(∅₂)), respectively"
"but they are $(dim(∅₁)) and $(dim(∅₂)), respectively"
return true
end
2 changes: 1 addition & 1 deletion test/Sets/EmptySet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ for N in [Float64, Rational{Int}, Float32]
@test !isuniversal(E) && !res && w E

# membership
@test N[0] E
@test_throws AssertionError N[0] E
@test N[0, 0] E

# subset
Expand Down

0 comments on commit 64800d3

Please sign in to comment.