JuliaApproximation / DomainSets.jl

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

0.7: override broadcasting of domains for mapped domains #21

Closed dlfivefifty closed 3 years ago

dlfivefifty commented 6 years ago

Julia v0.7 has much improved support for broadcasting, for example, one can now more easily capture complex function calls like exp.( log.(x .+ 1) .+ 2)). We can exploit this for domains: if d is a domain then `exp.( log.(d .+ 1) .+ 2)) should be the mapped domain, and we can capture each function call and turn it into a composition of maps.

daanhb commented 5 years ago

That would be great!

daanhb commented 4 years ago

We have largely achieved this with #61, though more could be done. However, DomainSets has no knowledge of measures, so the interval exp.(0..1) would just be another interval 1..exp(1). There would not be a need to store the map. On the other hand, it is not possible to generically determine what a function maps a domain to, unless the function is known to be uniquely invertible.

The new maps in #61 do support jacobians, because they are convenient to have, but I don't think there is a use for them in DomainSets. I've introduced measures in DomainIntegrals.jl and a change of variables there does make use of the jacobian functionality in DomainSets.jl. There might be room for a FunctionMeasures package or something like that.