You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, using TracerSparsityDetector{G,H} with H something other than Set{Tuple{Int,Int}} will fail. But one might like to try:
G = MySet{Int} and H = MySet{Tuple{Int,Int}} (definitely)
G = MySet{Int} and H = MyOtherSet2Tuple{Int,Int}} (maybe)
To remedy this, here are the steps to take:
Allow MySet to accept things beyond Number (easy)
Implement union! for MySet (easy except for RecursiveSet)
Make sure that the result of the Cartesian product x(::MySet1{Int}, ::MySet1{Int}) can be union-ed with MySet{Tuple{Int,Int}}. This can be solved in two non-mutually-exclusive ways:
Make x(::MySet{Int}, ::MySet{Int}) return a MySet{Tuple{Int,Int}}. That way, the existing homogeneous union(::MySet{T}, ::MySet{T}) will work
Implement heterogeneous unions union(::MySet{T}, ::AbstractSet{T}). I don't like this option because it will presumably be very slow, in a way that is not directly visible to the user.
The text was updated successfully, but these errors were encountered:
I've spent a lot of time thinking about this and think that the cleanest solution is to implement several methods
×(::Type{H}, grad1::G, grad2::G)
for HessianTracer{G,H} / TracerSparsityDetector{G,H}.
It solves options 1 and 2 and avoids some of the pitfalls of heterogeneous Hessian-set unions, since H is specified prior to computing a Hessian-set union.
At the moment, using
TracerSparsityDetector{G,H}
withH
something other thanSet{Tuple{Int,Int}}
will fail. But one might like to try:G = MySet{Int}
andH = MySet{Tuple{Int,Int}}
(definitely)G = MySet{Int}
andH = MyOtherSet2Tuple{Int,Int}}
(maybe)To remedy this, here are the steps to take:
MySet
to accept things beyondNumber
(easy)union!
forMySet
(easy except forRecursiveSet
)x(::MySet1{Int}, ::MySet1{Int})
can beunion
-ed withMySet{Tuple{Int,Int}}
. This can be solved in two non-mutually-exclusive ways:x(::MySet{Int}, ::MySet{Int})
return aMySet{Tuple{Int,Int}}
. That way, the existing homogeneousunion(::MySet{T}, ::MySet{T})
will workunion(::MySet{T}, ::AbstractSet{T})
. I don't like this option because it will presumably be very slow, in a way that is not directly visible to the user.The text was updated successfully, but these errors were encountered: