-
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
#640 - Check for empty intersection of compact set with Hyperplane #650
Conversation
src/is_intersection_empty.jl
Outdated
|
||
### Output | ||
|
||
* If `witness` option is deactivated: `true` iff ``P ∩ Q = ∅`` |
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.
P
-> X
, Q
-> hp
src/is_intersection_empty.jl
Outdated
witness::Bool=false | ||
)::Union{Bool, Tuple{Bool,Vector{N}}} where N<:Real | ||
sv_left = σ(-hp.a, X) | ||
if -dot(sv_left, -hp.a) <= hp.b |
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.
maybe use ρ(d, X)
directly. for eventual optimizations #600.
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.
I need the support vector below anyway.
left and right, and then take the intersection of the line with the hyperplane. | ||
We follow | ||
[this algorithm](https://en.wikipedia.org/wiki/Line%E2%80%93plane_intersection#Algebraic_form) | ||
for the line-hyperplane intersection. |
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.
Nice idea!
I was thinking how can we use it outside this function but then realized we don't have "hyperlines". See #652.
src/is_intersection_empty.jl
Outdated
point_hp = an_element(hp) | ||
point_line = sv_left | ||
dir_line = sv_right - sv_left | ||
d = dot((point_hp - point_line), hp.a) / dot(dir_line, hp.a) |
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.
maybe use normal_hp
or normal_hyperplane
here and above
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.
I do not understand.
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.
i was suggesting to give a variable name to hp.a
. for readability of the code. not a big deal.
3ad6e5f
to
8917699
Compare
8917699
to
1231076
Compare
Closes #640.