Skip to content
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

Merged
merged 1 commit into from
May 27, 2018
Merged

Conversation

schillic
Copy link
Member

Closes #350.

@schillic schillic requested a review from mforets May 27, 2018 13:13

- `cms` -- caching Minkowski sum

# Output
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(minor) ### Output

"""
forget_sets!(cms::CacheMinkowskiSum)::Int

Tell a caching Minkowski sum to forget the stored sets.
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, of course 😁


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.
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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.

@@ -105,6 +105,7 @@ CacheMinkowskiSum
array(::CacheMinkowskiSum{Float64, LazySet{Float64}})
dim(::CacheMinkowskiSum{Float64, LazySet{Float64}})
σ(::AbstractVector{Float64}, ::CacheMinkowskiSum{Float64, LazySet{Float64}})
forget(::CacheMinkowskiSum)
Copy link
Member

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!

@schillic schillic merged commit 92e7920 into master May 27, 2018
@schillic schillic deleted the schillic/350 branch May 27, 2018 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants