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

Add constraints list of an intersection of polytopes #1051

Closed
mforets opened this issue Jan 22, 2019 · 2 comments
Closed

Add constraints list of an intersection of polytopes #1051

mforets opened this issue Jan 22, 2019 · 2 comments
Assignees
Labels
feature ➕ A new feature

Comments

@mforets
Copy link
Member

mforets commented Jan 22, 2019

Add constraints_list(Intersection(::AbstractPolytope, ::AbstractPolytope), which is just the concatenation of the constraints of each argument. We could optionally remove the redundant constraints, or leave that as an option for later.

julia> using LazySets

julia> using Polyhedra

julia> rand(HPolytope)
HPolytope{Float64}(LazySets.HalfSpace{Float64}[HalfSpace{Float64}([-0.0159433, -0.35622], 0.297744), HalfSpace{Float64}([-0.216196, -0.316775], -0.0149291), HalfSpace{Float64}([0.107764, 0.210512], 0.0259863)])

julia> constraints_list(rand(HPolytope)  rand(Hyperrectangle))
ERROR: MethodError: no method matching constraints_list(::Intersection{Float64,HPolytope{Float64},Hyperrectangle{Float64}})
Closest candidates are:
  constraints_list(::LazySets.HalfSpace{N<:Real}) where N<:Real at /Users/forets/.julia/dev/LazySets/src/HalfSpace.jl:244
  constraints_list(::AbstractHyperrectangle{N<:Real}) where N<:Real at /Users/forets/.julia/dev/LazySets/src/AbstractHyperrectangle.jl:80
  constraints_list(::AbstractHPolygon{N<:Real}) where N<:Real at /Users/forets/.julia/dev/LazySets/src/AbstractHPolygon.jl:153
  ...
Stacktrace:
 [1] top-level scope at none:0
@schillic schillic added the feature ➕ A new feature label Jan 22, 2019
@mforets mforets self-assigned this Jan 22, 2019
@mforets
Copy link
Member Author

mforets commented Jan 22, 2019

to do this, i think that we should rather refactor remove_redundant_constraints! to receive a list of constraints, so it can be used more generally.

@schillic
Copy link
Member

I would still have it the way it exists now. But we can offer a second method.

schillic added a commit that referenced this issue Jan 24, 2019
#1051 - Add more list of constraints methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ➕ A new feature
Projects
None yet
Development

No branches or pull requests

2 participants