JuliaReach / LazySets.jl

Scalable symbolic-numeric set computations in Julia
https://juliareach.github.io/LazySets.jl/
Other
226 stars 32 forks source link

Wrong dimension in concrete cartesian product of VPolytope #2529

Closed mforets closed 3 years ago

mforets commented 3 years ago
using LazySets, Polyhedra
using LazySets: Interval, dim

x = rand(Interval); p = rand(VPolygon);

#A = cartesian_product(x, p) # missing

B = cartesian_product(convert(VPolytope, x), convert(VPolytope, p))

dim(B)

2

this is related to the default Polyhedra solver:

using CDDLib

B = cartesian_product(convert(VPolytope, x), convert(VPolytope, p), backend=CDDLib.Library())

dim(B)

3

we should open an issue in Polyhedra.jl

cc: @blegat

mforets commented 3 years ago

Ah wait, default_polyhedra_backend(P1) is not the same as default_polyhedra_backend(P2) here, since P1 is one-dimensional! https://github.com/JuliaReach/LazySets.jl/blob/ede6c23837a7b8d066c8f852ec57548227789947/src/ConcreteOperations/cartesian_product.jl#L22

so we're using Polyhedra.polyhedron(P2; backend=backend) for a 2D set P2 and with backend=IntervalLibrary{Float64}(). perhaps this could raise an error but it's a different kind of problem.