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
Intersection of two sets #139
Comments
|
yes, i think |
Okay, I edited the first post. |
Is it correct that, assuming that the intersection is nonempty, the support vector is just the minimum/maximum of both operands' support vectors? function σ(d::AbstractVector{N}, I::Intersection{N, S1, S2})::AbstractVector{N} where {N<:Real}
v = copy(d)
sv1 = σ(d, I.X1)
sv2 = σ(d, I.X2)
for i in 1:length(d)
v[i] = d[i] < 0 ? max(sv1[i], sv2[i]) : min(sv1[i], sv2[i])
end
end I am not sure about the case where a vector entry is 0. And of course we need to detect that the intersection is nonempty. Can we just ask |
cc: @viryfrederic |
Okay, this is Section 8.1, first paragraph in Le Guernic's thesis. I just have to study it. EDIT: Actually, this section is only for detecting emptiness, which would rather fit for #67. And forget my algorithm above. I think it works for hyperrectangles, but definitely not for arbitrary sets (take two circles for instance). |
The implementation we have now just crashes when asked for the support vector. We should think about what we can do here, maybe solve a complicated optimization problem or resort to subcases. |
we could also write an |
@mforets found this paper about the general case. |
We should pull out the |
still this is open:
one approach is to compute the concrete intersection (done in #173), and ask for the support vector. but i wouldn't do it this way since this wouldn't be a lazy operation at all. seems to me that it will be preferable to apply Lemma 4 from Frehse and Ray. |
Well, there are different levels of laziness.
|
Lots of interesting material: https://www.geometrictools.com/Documentation/Documentation.html |
Another interesting page: http://www.realtimerendering.com/intersections.html |
Closing this one and continuing the meta collection in #1391. |
Add a lazy binary operator type
Intersection
(and maybe an n-ary variant) representing the intersection of two setsS1
andS2
.Also have a convenience alias
∩(S1, S2)
, for which Julia's built-in alias isintersect
.Related but simpler: #67
The text was updated successfully, but these errors were encountered: