-
Notifications
You must be signed in to change notification settings - Fork 32
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
#375 - Intersection of a halfspace with polyhedron: line search method #677
Conversation
How come that |
sorry, i forgot to push that part. just a second. |
do you agree about my definition of |
Here i get julia> σ([1., 1], p∩h)
2-element Array{Float64,1}:
1.5
1.5 but i think it should be Also julia> σ([-1., 1], p∩h)
2-element Array{Float64,1}:
-0.707107
0.707107 gives a point which does not belong to |
ok the problem is that for instance to test that the support function is correct, consider the same example but using template directions (which evaluates the supp func) instead of iterative refinement (which evaluates the supp vector): using LazySets.Approximations
p = Ball2(ones(2), 1.0)
h = HalfSpace([1.0, 0.0], 1.0) # x <= 1
pint = overapproximate(p∩h, BoxDiagDirections(2))
pint = convert(HPolygon, pint)
plot(p, aspectratio=1, alpha=0.2, 1e-3)
plot!(pint, aspectratio=1, alpha=0.2, color="red") |
Yes, this does not work in general. julia> b = BallInf([0., 0.], 1.); d = [1., 0.5];
julia> ρ(d, b)
1.5
julia> ρ(d, b) * d
2-element Array{Float64,1}:
1.5
0.75
julia> ρ(d, b) * d ∈ b
false
julia> σ(d, b)
2-element Array{Float64,1}:
1.0
1.0 |
Yes, thanks for checking. I don't have a formula for the support vector, so i propose to move on with the computation of supp func for now. It remains to add a add a unit test and the function to the docs. Regarding the function __init__()
@require Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029" load_polyhedra()
@require Optim = "????" load_optim()
end The theorem on |
A preliminary idea for the support vector |
I look it up in |
Do we use "ℓ" for directions now? (I am not against that choice.) I would also add an option to skip the emptiness check. In practice we want to do that in advance before computing ρ. The name of that option is tricky: A possible name |
i was using it because i was following the notation from the paper. but i shall switch back to
good idea. maybe |
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.
Here is my late review 🐌
|
||
# Symmetric case | ||
ρ(ℓ::AbstractVector{N}, cap::Intersection{N, <:HalfSpace, <:LazySet}; | ||
algorithm::String="line_search", kwargs...) where {N<:AbstractFloat} = ρ(ℓ, cap.Y ∩ cap.X; algorithm=algorithm, kwargs...) |
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.
The check_intersection
argument is missing here.
MathProgBase 0.7 | ||
RecipesBase 0.3 | ||
Requires 0.4 | ||
Optim 0.14.1 |
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.
new line
|
||
# line search using Optim | ||
using Optim | ||
@test ρ(d, X ∩ H) == ρ(d, X ∩ H) == 1.0 |
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.
Should the second expression be the symmetric case?
Thanks for the comments. I put them in #681 |
Closes #375.