Open dstahlke opened 1 year ago
Without this patch, norm(zero(x)) gives the following error in ApproxFunBase/src/Multivariate/ProductFun.jl:177:
ERROR: LoadError: BoundsError: attempt to access 0×0 Matrix{Float64} at index [1:1, 1:1]
Fixing ProductFun to handle empty coefficients just leads to a similar error later on. So it seems this package generally assumes that the coefficients vector is not empty. Thus I modified chop! to never return an empty coefficients vector.
Thanks! ideally the empty ProductFun
and LowRankFun
should be made to work, but that requires fixing a lot of code, so I think this should be fine
Patch coverage: 19.90
% and project coverage change: -44.84
:warning:
Comparison is base (
2f401fa
) 71.22% compared to head (20867a2
) 26.38%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Test case: using ApproxFun x,y = Fun(identity, Chebyshev() Chebyshev()) ApproxFun.norm(0x) ApproxFun.norm(zero(x))
I didn't create a unit test because I couldn't find a way to reproduce with ApproxFunBase only.