DomainSets.jl icon indicating copy to clipboard operation
DomainSets.jl copied to clipboard

Support `iterate` for finite-dimensional sets

Open dlfivefifty opened this issue 3 years ago • 2 comments

Ran into an issue where a piece of code would have worked if I could iterate over a VcatDomain (something like VcatDomain(OneTo(3), OneTo(5)))

Would be nice if we supported iterate. I started an implementation but wasn't obvious, probably just need to replicate the code for CartesianIndex

dlfivefifty avatar Aug 17 '22 14:08 dlfivefifty

Product iteration is simple only in hindsight :-)

daanhb avatar Aug 17 '22 16:08 daanhb

Hmm, this will be difficult to get right. There is a fairly comprehensive framework for iterating over combinations of function sets in BasisFunctions.jl, which I'm still not entirely happy with. By implementing axes and friends, I managed to reuse the standard iterators of arrays for product structures and of BlockArrays for composite structures. However, some extensions are needed when combining them: in this package that would be product domains of uniondomains.

It's certainly doable, but I'm not sure it is worth the effort here.

daanhb avatar Aug 19 '22 06:08 daanhb