Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Following #457, this PR adds more tests for allocation-free interpolation of
Vector{SVector}
inputs. To my knowledge, all interpolators that work with vector-valued inputs now have these tests. That list isTwo minor code changes are included to support this work.
spline_coefficients!
it is required to assert the return type offindfirst(x -> x > u, k)::Int
to avoid a dynamic dispatch to-
asfindfirst
can return anInt
orNothing
. The dynamic dispatch causes the allocation check via AllocCheck.jl to fail. It looks like bounds checks on the inputs are performed during the extrapolation step, so I think it is safe to assert this return type.smoothed_constant_interpolation_parameters
does not work on array-valued inputs asone(::AbstractArray)
is not defined. I think type stability can be maintained by replacingzero(one(eltype(u)) / 2)
withzero(first(u) / 2)
, but this is maybe not optimal ifu
has elements of mixed type. I suppose it could bezero(u[idx] / 2)
, other suggestions welcome.Also some of CubicSpline
@inferred
tests that are labeled broken are now passing for me locally (Julia 1.11) so I changed those. If they fail on CI we can troubleshoot further.