From 20867a22495fa1cdc686b96f3d66a30bbe52a159 Mon Sep 17 00:00:00 2001 From: Dan Stahlke Date: Sun, 11 Jun 2023 21:24:49 -0700 Subject: [PATCH] chop! no longer produces empty coefficients Test case: using ApproxFun x,y = Fun(identity, Chebyshev() * Chebyshev()) ApproxFun.norm(0*x) ApproxFun.norm(zero(x)) --- src/Fun.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Fun.jl b/src/Fun.jl index abb676ce..a729e864 100644 --- a/src/Fun.jl +++ b/src/Fun.jl @@ -486,6 +486,7 @@ pad(f::Fun,n::Integer) = Fun(f.space,pad(f.coefficients,n)) function chop!(sp::UnivariateSpace,cfs,tol::Real) n=standardchoplength(cfs,tol) + n=max(1,n) # empty coeffs vector causes all sorts of problems resize!(cfs,n) cfs end