gaioguys / GAIO.jl

A Julia package for set oriented computations.
MIT License
9 stars 4 forks source link

Another Documentation Update #78

Closed April-Hannah-Lena closed 1 year ago

April-Hannah-Lena commented 1 year ago

I've updated the documentation to include some new things:

The FTLE algorithm has also been updated to make more sense and fit with the GAIO.jl usage pattern.

BoxFun also got two added features:

If a BoxSet B is passed as the third argument, then the integration is restricted to the boxes in B

\int_{Q \cap \bigcup_{b \in B} b} f \, d\mu .

The notation μ(B) is offered to compute \mu (\bigcup_{b \in B} b).

gaioguy commented 1 year ago

Nice, thanks. Great idea to enable the precomposition with the map. Would it be possible to make a BoxFun behave like a vector, i.e. have addition and scalar multiplication?

April-Hannah-Lena commented 1 year ago

Nice, thanks. Great idea to enable the precomposition with the map. Would it be possible to make a BoxFun behave like a vector, i.e. have addition and scalar multiplication?

It definitely would be possible, though the interface for custom broadcasting in julia is a bit complicated. I suppose also we have to ask: fundamentally, should a BoxFun be viewed as a vector (where broadcasting etc makes sense), or as a function (operations should be done through composition with other functions)?

The current functionality to would be to use findnz from SparseArrays to get a vector, perform whatever vector operations on the result, and then create a new BoxFun from that vector. But that requires some knowledge on the internals of the struct. Maybe that workflow can be simplified, e.g. something like

mu = # existing BoxFun

vals = Vector(mu)

A = # some kind of matrix maybe
vals_new = A * vals .+ exp.(vals)    # some operation

mu_new = BoxFun(mu, vals_new)
gaioguy commented 1 year ago

Sorry, I actually meant function, and so more precisely the question is whether we can give the BoxFuns a vector space structure.