Skip to content

Commit

Permalink
Merge pull request #3333 from JuliaReach/schillic/3226
Browse files Browse the repository at this point in the history
Do not use GLPK's presolver by default
  • Loading branch information
schillic authored Jun 5, 2023
2 parents 6ab9dca + 8ce5fd7 commit 494db08
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ConcreteOperations/intersection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -746,13 +746,13 @@ function intersection(P1::Union{VPolygon,VPolytope},
Q2 = polyhedron(P2; backend=backend)
Pint = Polyhedra.intersect(Q1, Q2)

N = promote_type(eltype(P1), eltype(P2))
if isnothing(prunefunc)
prunefunc = (X -> removevredundancy!(X; ztol=_ztol(eltype(P1))))
prunefunc = (X -> removevredundancy!(X; ztol=_ztol(N)))
end
prunefunc(Pint)

if isempty(Pint)
N = promote_type(eltype(P1), eltype(P2))
return EmptySet{N}(n)
end
return VPolytope(Pint)
Expand Down
3 changes: 1 addition & 2 deletions src/Sets/HPolytope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ backend; for the default backend used in `LazySets` see
backends see
[Polyhedra's documentation](https://juliapolyhedra.github.io/Polyhedra.jl/).
"""
function vertices_list(P::HPolytope;
backend=nothing, prune::Bool=true)
function vertices_list(P::HPolytope; backend=nothing, prune::Bool=true)
N = eltype(P)
if isempty(P.constraints)
return Vector{N}(Vector{N}(undef, 0)) # illegal polytope
Expand Down
5 changes: 3 additions & 2 deletions src/Sets/VPolytope.jl
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,13 @@ function remove_redundant_vertices(P::VPolytope{N};
Q = polyhedron(P; backend=backend)
if Polyhedra.supportssolver(typeof(Q))
if isnothing(solver)
solver = default_lp_solver_polyhedra(N)
# presolver prints warnings about infeasible solutions (#3226)
solver = default_lp_solver_polyhedra(N; presolve=false)
end
vQ = Polyhedra.vrep(Q)
Polyhedra.setvrep!(Q, Polyhedra.removevredundancy(vQ, solver))
else
Polyhedra.removevredundancy!(Q; ztol=_ztol(N))
removevredundancy!(Q; ztol=_ztol(N))
end
return VPolytope(Q)
end
Expand Down

0 comments on commit 494db08

Please sign in to comment.