Specialize more functions on f parameter for trim compatibility #2856
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.
Summary
Similar to #2854, this PR adds type specialization for the
fparameter in several functions across OrdinaryDiffEq.jl to improve compatibility with--trimand reduce dynamic dispatch.Functions specialized
jacobianscalar fallback inderivative_wrappers.jl:139sparsity_colorvecinderivative_wrappers.jl:396WOperatorconstructor inderivative_utils.jl:327islinearfunctioninderivative_utils.jl:443_compute_rhsinnewton.jl:333DAEResidualJacobianWrapperconstructor inutils.jl:74generic_dense.jl:_evaluate_interpolant(line 480)evaluate_composite_cache(lines 488, 500)evaluate_default_cache(line 508)evaluate_interpolant(line 531)verify_f2functions insymplectic_perform_step.jl(lines 80, 85, 91, 95)Rationale
These functions all either:
fdirectly as a functionffto other functionsfAdding
where Ftype parameters enables better compiler optimizations and reduces dynamic dispatch, similar to what was done in PR #2854.Testing
The package compiles and loads successfully with these changes.