JuliaApproximation / DomainSets.jl

A Julia package for describing domains as continuous sets of elements
MIT License
72 stars 12 forks source link

ProductDomain -> VcatDomain #44

Closed dlfivefifty closed 4 years ago

dlfivefifty commented 5 years ago

The notion of a product of domains is really about concatenation of the inputs. Renaming it to VcatDomain makes this clear, and opens up the possibility of HcatDomain and HvcatDomain, so that:

[1; 2] in VcatDomain(1..2, 2..3)
[1 2] in HcatDomain(1..2, 2..3)
[1 2; 3 4] in HvcatDomain([1..2 1...2; 3..4 3..4])
dlfivefifty commented 5 years ago

Wait, I got it: all we need is ApplyDomain and BroadcastDomain which will replace ProductDomain, MappedDomain, etc.

So x in ApplyDomain(f, A, B, ...) if there exists a in A and b in B such that x == f(a,b). So [1,2] in ApplyDomain(vcat, 0..1, 1..2).

daanhb commented 4 years ago

This is a neat idea and I've used it partially in #55. The current implementation is such that a lazy domain implements its in method in terms of the domains it contains: it can (1) map the point x to something else, (2) distribute the result over the composing domains, and finally (3) combine the outcomes. This is governed by the functions preprocess, composition and combine.

daanhb commented 4 years ago

The VcatDomain now exists, a flexible "broadcast" way of constructing domains does not exist yet.