-
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
Incorrect intersection (not sure if due to underlying optimizer) #2296
Comments
Quick comments without looking at the rest: positive_orthant(X) = positive_orthant = HPolytope(Diagonal(-ones(dim(X))), zeros(dim(X)))
|
It was copy pasted from a line into a function, which is why the variable name is there. It doesn't make a difference though (confirmed)
Fair enough (the constructor allows it, but I guess the finer point is that certain assumptions may fail later on). That change also does not make a difference (also confirmed) |
yes. we've recently added a more efficient method for checking boundedness, so we may reconsider to check that HPolytopes are bounded upon construction (with an optional flag, as usual). |
intersection of HPolygon is buggy (see here). maybe related? |
Does that problem extend to hpolytopes in general? The set I'm working with was 3D (and later 4D) to avoid the pitfalls of simplifications that are only possible in 2D. After calling Edit: |
actually my comment is not relevant because the method used in the OP is intersection of HPolytope's which works fine.
after thinking this further, i don't see a problem in the obtained result. when you plot it would be nice to visualize this argument with a 3d plot but it's atm broken upstream :/ as a side note regarding the currently the function calling directly the linear map, z = linear_map(M, hpp, backend=CDDLib.Library())
z = linear_map(M, hpp, algorithm="vrep", backend=CDDLib.Library()) but these don't work as i'd expect, i think that's because we have to fix the on the other hand, doing directly z = linear_map(M, VPolytope(vertices_list(hpp, backend=CDDLib.Library()))); does return the same set as with the default backend. |
Just to clarify: in general |
here is an example in 2D: using LazySets: project, Interval
x = VPolygon([[-1.0, 1.0], [-0.5, -0.1], [2.0, -1.0], [0.5, 1.0]])
p = convert(Interval, project(x, [1]))
y = intersection(x, positive_orthant(x))
q = convert(Interval, project(y, [1]));
plot([0], seriestype = [:vline, :hline], l = (:black, :dash, 2), lab="")
plot!(x, lab="x", legend=:topleft, c=:lightblue)
ϵ = 0.03
lp = LineSegment([min(p), -ϵ], [max(p), -ϵ])
plot!(lp, lw=3.0, lab="proj x ", c=:green)
lq = LineSegment([min(q), ϵ], [max(q), ϵ])
plot!(lq, lw=3.0, lab="proj int x, O", c=:blue) |
Indeed I know! I am confirming whether this is what is happening or if this issue is real. I am actually trying to use precisely this idea to try to prune the number of sets in the concrete rectification. By first intersecting with the positive orthant, a lot of the set may be lost. Comparing the support vector before and after this intersection can reveal which dimensions are important for the rectification. |
sorry, could you reformulate what is the issue?
i disagree; but it should hold that |
If there was really a problem with intersection. You are both right, however, that I am wrong! I must have expected to see the entire positive projection covered because I was viewing many plots of rectifications beforehand (and for a couple of days...), and that let me down a misleading rabbit hole. There is no issue as far as I can tell, including after checking with MeshCat in 3D. |
alright! feel free to keep bringing issues even under doubt :) it's very useful for the library. |
I was testing some code related to my recent suggestion in #1176 when I ran into this. In particular, I was plotting the intersection of an HPolytope with the positive orthant; see below.
Note that the projection operation in
plotproj
yields the warningwhich is the same one mentioned in #2278 (comment). This made me think at first the problem is optimizer related, but I confirmed it occurs only during the projection, and therefore the support vector test demonstrates that the problem may be elsewhere (or overlapping?)
The text was updated successfully, but these errors were encountered: