JuliaApproximation / ContinuumArrays.jl

A package for representing quasi arrays with continuous indices
MIT License
27 stars 6 forks source link

Refine tensor transform interface #170

Closed dlfivefifty closed 10 months ago

dlfivefifty commented 10 months ago

This refines the tensor transform interface. In particular:

  1. grid(P) and grid(P,n::Int) return just a vector of points
  2. grid(P, (n,)), grid(P, (m,n)) etc. return a tuple of vectors of points in each dimension.
  3. Similar for plan_grid_transform.

Thus one can do a 1D transform that gets out at least 5 coefficients via eg:

x = grid(P, 5)
P = plan_transform(P, 5)
P * f.(x)

or a 2D transform

x,y = grid(P, (5,6))
P = plan_transform(P, (5,6))
P * f.(x, y')

Note the "1D" and "2D" don't necessarily mean dimension of the geometry, eg, when combined with MultivariateOrthogonalPolynomials.jl the interface of a tensor product of disks would be:

Z = Zernike()
x,y = grid(Z, (Block(5),Block(6)))
P = plan_transform(Z, (Block(5),Block(6)))
P * f.(x, y')

@TSGut this might be of use for you.

dlfivefifty commented 10 months ago

Now only overload plan_transform and grid: plan_grid_transform won't be used anymore.

A consequence is that the default fallback transform of using Vandermonde+LeastSquares creates the grid twice. Whooptydoo.

codecov[bot] commented 10 months ago

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (5bcf055) 91.59% compared to head (88f606e) 91.69%. Report is 8 commits behind head on master.

Files Patch % Lines
ext/ContinuumArraysMakieExt.jl 0.00% 3 Missing :warning:
src/maps.jl 92.30% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #170 +/- ## ========================================== + Coverage 91.59% 91.69% +0.10% ========================================== Files 11 11 Lines 761 783 +22 ========================================== + Hits 697 718 +21 - Misses 64 65 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.