JuliaApproximation / QuasiArrays.jl

A package for representing quasi-arrays
MIT License
12 stars 2 forks source link

Add support for `setindex` for extending a function #76

Open dlfivefifty opened 3 years ago

dlfivefifty commented 3 years ago

Sometimes we want to embed say a Chebyshev expansion in R so that it is defined to be zero outside. I was thinking the "right" notation would be:

T = ChebyshevT()
T_ex = setindex(Zeros(Inclusion(ℝ), axes(T,2)), T, axes(T,1), :)

Here this would return a

ApplyQuasiArray(setindex, Zeros(Inclusion(ℝ), axes(T,2)), T, axes(T,1), :)

Cf. the recently added PaddedArray which is equivalent to ApplyArray(setindex, ...)

https://github.com/JuliaArrays/LazyArrays.jl/blob/a2ad804b83d3c7aaba798e0f258f92fa65fa2621/src/lazyconcat.jl#L1249