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.
I got it working! =)
The interface is currently a little clunky, especially in 1D, but I couldn't think of a way to define an overload of
gradient
for vector interpolations, that wouldn't be recursive. This is how it works:It works for linear and constant interpolations too, although the results are of course less useful:
The meta-programming mumbo-jumbo used to define the correct coefficients for evaluation became more complicated, and as a result (other than the code being a little more opaque), the loading time of the package is bumped up even further;
tic(); using Interpolations; toc()
now reports 31 seconds on my machine. For comparison,tic(); using Gadfly; toc()
reports 25... It might be possible to reduce the load time slightly by organizing the code into smaller modules where things likesymm
,sym
andsymp
could be defined as constants, but I guess much of this would be alleviated with staged functions, so I'm not very concerned about it at the moment.