diff --git a/src/_ChangeBasis.jl b/src/_ChangeBasis.jl index 26b05686b..94c2517dc 100644 --- a/src/_ChangeBasis.jl +++ b/src/_ChangeBasis.jl @@ -459,7 +459,7 @@ function _changebasis_I(P::BSplineSpace{p,T,<:AbstractKnotVector{T}}, P′::BSpl K′ = [k′[j+p′] - k′[j] for j in 1:n′+1] K = U[ifelse(k[i+p] ≠ k[i], U(1 / (k[i+p] - k[i])), zero(U)) for i in 1:n+1] Aᵖ⁻¹ = _changebasis_I(_lower_I(P), _lower_I(P′)) # (n-1) × (n′-1) matrix - n_nonzero = exactdim_I(P′)*(p+1) # This is a upper bound of the number of non-zero elements of Aᵖ (rough estimation). + n_nonzero = exactdim_I(P′)*(p+2) # This would be a upper bound of the number of non-zero elements of Aᵖ. I = Vector{Int32}(undef, n_nonzero) J = Vector{Int32}(undef, n_nonzero) V = Vector{U}(undef, n_nonzero)