-
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
#350 - Add forget_sets! function to CacheMinkowskiSum #354
Conversation
src/MinkowskiSum.jl
Outdated
|
||
- `cms` -- caching Minkowski sum | ||
|
||
# Output |
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.
(minor) ### Output
src/MinkowskiSum.jl
Outdated
""" | ||
forget_sets!(cms::CacheMinkowskiSum)::Int | ||
|
||
Tell a caching Minkowski sum to forget the stored sets. |
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.
... without actually deleting the cache, if i understand correctly?
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.
Yep, of course 😁
src/MinkowskiSum.jl
Outdated
|
||
This implementation is optimistic and first tries to remove all sets. | ||
However, it verifies that for all cached directions the support vector has been | ||
computed before. |
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 don't quite follow this sentence. isn't it necessary to have computed a support vector, in order to cache a direction? is there a use case where there is a cached direction for which the support vector has not been computed?
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.
Okay, okay, this is not clearly explained 😼
You can add two sets to the sum, then compute the support vector, and then add another three sets to the sum. Now the cache only contains the vector for the first two sets.
The function forget_sets!
wants to remove all five sets, but then detects that there is at least one direction which is only cached for the first two sets. Thus it only "forgets" the first two sets.
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.
Ah, got it now. Sounds good.
docs/src/lib/operations.md
Outdated
@@ -105,6 +105,7 @@ CacheMinkowskiSum | |||
array(::CacheMinkowskiSum{Float64, LazySet{Float64}}) | |||
dim(::CacheMinkowskiSum{Float64, LazySet{Float64}}) | |||
σ(::AbstractVector{Float64}, ::CacheMinkowskiSum{Float64, LazySet{Float64}}) | |||
forget(::CacheMinkowskiSum) |
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 think this would be forget_sets!
Closes #350.