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

Overapproximate CH with 0-gens zonotope #2994

Closed
mforets opened this issue Jul 10, 2022 · 0 comments · Fixed by #2995
Closed

Overapproximate CH with 0-gens zonotope #2994

mforets opened this issue Jul 10, 2022 · 0 comments · Fixed by #2995
Assignees
Labels
bug 🐛 Something isn't working

Comments

@mforets
Copy link
Member

mforets commented Jul 10, 2022

julia> X = Zonotope([0.2553862516469573, 0.9780152852016689], Matrix{Float64}(undef, 2, 0));

julia> Y = Zonotope([0.6127892528289145, 0.827561464100999], [0.4943828526889149 0.20515399000349377; 0.9913211225797134 0.7315677123098985]);

julia> CH(X, Y)
ConvexHull{Float64, Zonotope{Float64, Vector{Float64}, Matrix{Float64}}, Zonotope{Float64, Vector{Float64}, Matrix{Float64}}}(Zonotope{Float64, Vector{Float64}, Matrix{Float64}}([0.2553862516469573, 0.9780152852016689], Matrix{Float64}(undef, 2, 0)), Zonotope{Float64, Vector{Float64}, Matrix{Float64}}([0.6127892528289145, 0.827561464100999], [0.4943828526889149 0.20515399000349377; 0.9913211225797134 0.7315677123098985]))

julia> overapproximate(CH(X, Y), Zonotope)
ERROR: ArgumentError: the target order should be at least 1, but it is 0
Stacktrace:
 [1] reduce_order(Z::Zonotope{Float64, Vector{Float64}, Matrix{Float64}}, r::Int64, method::LazySets.GIR05) (repeats 2 times)
   @ LazySets ~/JuliaReach/LazySets.jl/src/Sets/Zonotope.jl:355
 [2] _overapproximate_convex_hull_zonotope_G05(X::ConvexHull{Float64, Zonotope{Float64, Vector{Float64}, Matrix{Float64}}, Zonotope{Float64, Vector{Float64}, Matrix{Float64}}})
   @ LazySets.Approximations ~/JuliaReach/LazySets.jl/src/Approximations/overapproximate.jl:249
 [3] #overapproximate#9
   @ ~/JuliaReach/LazySets.jl/src/Approximations/overapproximate.jl:237 [inlined]
 [4] overapproximate(X::ConvexHull{Float64, Zonotope{Float64, Vector{Float64}, Matrix{Float64}}, Zonotope{Float64, Vector{Float64}, Matrix{Float64}}}, ::Type{Zonotope})
   @ LazySets.Approximations ~/JuliaReach/LazySets.jl/src/Approximations/overapproximate.jl:236
 [5] top-level scope
   @ REPL[5]:1

Expected result:

julia> plot(X)

julia> plot!(Y)

julia> plot!(CH(X, Y))

julia> plot!(overapproximate(CH(X, Y), Zonotope), ls=:dash)

Screenshot from 2022-07-10 17-39-34

@mforets mforets added the bug 🐛 Something isn't working label Jul 10, 2022
@mforets mforets self-assigned this Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant