-
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
Add cache to Intersection #397
Comments
I like the idea of the (*) not sure about this fields name, because this name is already taken.. |
For a function only, right? The idea would be that we only use this field internally. And to me it describes perfectly what it should do.
If it is optional, it is okay. But I hesitate to make it the default behavior because the |
In #396 we implement the concrete intersection of two hyperrectangles. The issue with the lazy operation (
Intersection{N, <:AbstractHyperrectangle, <:AbstractHyperrectangle}
) is this: It needs to know whether the intersection is empty in advance. In the worst case this requires to compute the whole intersection, which to some extent breaks the point of the lazy operation.Given that we have to compute this information with the first support vector query (or other queries like
isempty
), we should cache this result and only compute it once.I guess that this observation is general for the intersection (in particular also for #375 and #262), so we should have a general caching mechanism for the lazy
Intersection
type. I cannot quite foresee how this cache would look like. For the moment it would suffice to have a new fieldisempty::Tribool
. ATribool
would be a (mutable) type that can betrue
,false
, orunknown
. The fieldisempty
would be initialized tounknown
and later be set totrue
orfalse
accordingly. (Note thatIntersection
would still be immutable.)Later we may require more specific information for intersections, depending on the set types. Then we could replace the
isempty
field by a general caching fieldcache::C
whereC
is a new type parameter of typeIntersectionCache
. The latter would be a new abstract type that we can instantiate for each respective combination of set types. In the instantiation we would store the respective information.So the question is: Do we want to have the
isempty
field for now, or directly go for the generalIntersectionCache
type?The text was updated successfully, but these errors were encountered: