-
Notifications
You must be signed in to change notification settings - Fork 33
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
#2646 - Add intersection between star set and halfspace #2654
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm if tests pass
we could also add a check of the in-place transformation.
Co-authored-by: Marcelo Forets <[email protected]>
The new test doesn't pass in my machine, but I don't see why it wouldn't |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general!
👍 let's wait until tests & docs pass.. |
This in-place intersection is problematic if the constraints use a vector type different from julia> using LazySets
julia> N = Float64;
julia> S = Star(N[3, 3], N[1 0; 0 1], BallInf(N[0, 0], N(1)));
julia> H = HalfSpace(N[0, 1], N(0));
julia> I = intersection(S, H)
ERROR: MethodError: Cannot `convert` an object of type
HalfSpace{Float64{},Vector{Float64}} to an object of type
HalfSpace{Float64{},LazySets.Arrays.SingleEntryVector{Float64}} I do not see an easy way out. I suggest that in the method function intersection(X::STAR{N, VN, MN, PT}, H::HalfSpace) where {N, VN, MN, PT<:Union{HPoly, HPolygon, HPolygonOpt}}
return intersection!(copy(X), H)
end we check whether the vector type is |
Co-authored-by: Christian Schilling <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from my comment here this looks good!
LazySets.Star: Test Failed at /home/travis/build/JuliaReach/LazySets.jl/test/Sets/Star.jl:47
Expression: isequivalent(S, P)
Stacktrace:
[1] top-level scope at /home/travis/build/JuliaReach/LazySets.jl/test/Sets/Star.jl:47
[2] include(::String) at ./client.jl:457
[3] macro expansion at /home/travis/build/JuliaReach/LazySets.jl/test/runtests.jl:136 [inlined]
[4] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1119 [inlined]
[5] macro expansion at /home/travis/build/JuliaReach/LazySets.jl/test/runtests.jl:136 [inlined]
[6] macro expansion at ./timing.jl:174 [inlined]
[7] top-level scope at /home/travis/build/JuliaReach/LazySets.jl/test/runtests.jl:136
LazySets.Star: Test Failed at /home/travis/build/JuliaReach/LazySets.jl/test/Sets/Star.jl:47
Expression: isequivalent(S, P) |
|
Closes #2646.