Skip to content

Commit

Permalink
disambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Oct 25, 2018
1 parent 3c7a45b commit 4ab88c1
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/is_intersection_empty.jl
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,6 @@ Note that this method can be used with any set ``P`` whose constraints are known
function is_intersection_empty(X::LazySet{N},
P::Union{HPolyhedron{N}, HPolytope{N}, AbstractHPolygon{N}}
)::Bool where N<:Real

for Hi in constraints_list(P)
if is_intersection_empty(X, Hi)
return true
Expand All @@ -858,13 +857,39 @@ function is_intersection_empty(X::LazySet{N},
return false
end

# symmetric function
# symmetric method
function is_intersection_empty(P::Union{HPolyhedron{N}, HPolytope{N}, AbstractHPolygon{N}},
X::LazySet{N}
)::Bool where N<:Real
return is_intersection_empty(X, P)
end

# disambiguity
function is_intersection_empty(P::Union{HPolyhedron{N}, HPolytope{N}, AbstractHPolygon{N}},
Q::Union{HPolyhedron{N}, HPolytope{N}, AbstractHPolygon{N}}
)::Bool where N<:Real
for Hi in constraints_list(P)
if is_intersection_empty(Q, Hi)
return true
end
end
return false
end

# disambiguity
function is_intersection_empty(P::Union{HPolyhedron{N}, HPolytope{N}, AbstractHPolygon{N}},
hs::HalfSpace{N}
)::Bool where N<:Real
return -ρ(-hs.a, P; kwargs...) > hs.b
end

# symmetric method
function is_intersection_empty(hs::HalfSpace{N}
P::Union{HPolyhedron{N}, HPolytope{N}, AbstractHPolygon{N}},
)::Bool where N<:Real
return is_intersection_empty(P, hs)
end

# --- alias ---


Expand Down

0 comments on commit 4ab88c1

Please sign in to comment.