Open mforets opened 5 years ago
Is it not even worse if the removal of redundant constraints from an empty set results in a non-empty set?
@schillic true, i've reopened this issue with a different title to suggest that some action should be taken, either make it clear in removehredundancy!
docs that the input polyhedron should not be empty, or revise the algorithm.
Isn't the bug in CDD ?
Isn't the bug in CDD ?
The problem also occurs with the "default library". (EDIT: simplified the numbers)
for backend in [CDDLib.Library(), default_library(2, Float64)]
p = polyhedron(hrep([HalfSpace([1.0, 0.0], 0.3),
HalfSpace([-1.0, 0.0], -0.2),
HalfSpace([0.0, 1.0], 0.1),
HalfSpace([0.0, -1.0], 0.1)]), backend)
q = polyhedron(hrep([HalfSpace([-1.0, 0.0], 0.0),
HalfSpace([-0.7, -1.0], 0.0),
HalfSpace([0.7, 1.0], 0.0)]), backend)
P = Polyhedra.intersect(p, q)
Polyhedra.removehredundancy!(P)
println(P)
end
HyperPlane([1.0, 0.0], 0.3)
∩ HyperPlane([-1.0, 0.0], -0.2)
∩ HyperPlane([0.0, 1.0], 0.1)
HyperPlane([0.7, 1.0], 0.0) :
The following example shows what i think is a bug in
removehredundancy!
:(reported here @schillic)
(EDITED)
I had a quick look at a workaround using a Polyhedra.Ray:
i just plotted this in geogebra; the intersection is actually empty :)
indeed:
and
given this, i take back my assumption that
removehredundancy!
is buggy.