Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#619 Is intersection empty for polytopes #624

Merged
merged 9 commits into from
Sep 18, 2018
21 changes: 21 additions & 0 deletions src/is_intersection_empty.jl
Original file line number Diff line number Diff line change
Expand Up @@ -574,3 +574,24 @@ function is_intersection_empty(P::AbstractPolytope{N},
return isempty_flag
end
end

# method disambiguation
function is_intersection_empty(point::AbstractSingleton{N},
set::AbstractPolytope{N},
witness::Bool=false
)::Union{Bool,Tuple{Bool,Vector{N}}} where {N<:Real}
empty_intersection = !∈(element(point), set)
if witness
return (empty_intersection, empty_intersection ? N[] : element(S))
else
return empty_intersection
end
end

# symmetric function
function is_intersection_empty(set::AbstractPolytope{N},
point::AbstractSingleton{N},
witness::Bool=false
)::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real}
return is_intersection_empty(point, set, witness)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line 😃

Copy link
Member Author

@mforets mforets Sep 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agghhh there is some obscure setting in my editor (atom) which removes the empty lines