Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GriddedInterpolation for non-uniform grids #56

Merged
merged 4 commits into from
Aug 7, 2015
Merged

Conversation

timholy
Copy link
Member

@timholy timholy commented Aug 7, 2015

I was looking into doing a benchmark against other packages, and the lack of this feature made the comparisons pretty unfair. So I decided to add it. This was one of those days where one marvels at the efficiency of Julia.

I haven't done extensive testing or benchmarking, hence the WIP.

@timholy timholy changed the title WIP: add GriddedInterpolation for non-uniform grids Add GriddedInterpolation for non-uniform grids Aug 7, 2015
@timholy
Copy link
Member Author

timholy commented Aug 7, 2015

OK, I think this is ready to go. Testing could probably be better, but this is a good start.

interpolate!{IT<:DimSpec{BSpline},GT<:DimSpec{GridType}}(A::AbstractArray{Rational{Int}}, ::Type{IT}, ::Type{GT}) = interpolate!(Rational{Int}, A, IT, GT)
function interpolate!{IT<:DimSpec{BSpline},GT<:DimSpec{GridType}}(A::AbstractArray, ::Type{IT}, ::Type{GT})
interpolate!(tweight(A), A, IT, GT)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice refactoring! 👍

@tomasaschan
Copy link
Contributor

This is really nice!

Re: testing, what is the expected behavior when the knots are actually linspace(1, size(A,d), size(A,d))? Could we make testing better by comparing a regular b-spline interpolation bitp = interpolate(A, BSpline{Linear}, OnGrid) with a gridded gitp = interpolate(A, Gridded{Linear}) and make sure that their results are within some small epsilon of eachother?

Also, we should start some feature-matrix somewhere, that indicates what features (interpolation degrees, gradient evaluation etc) that are implemented in the different interpolation schemes.

@timholy
Copy link
Member Author

timholy commented Aug 7, 2015

Could we make testing better by comparing a regular b-spline interpolation

Good suggestion. This caught what could have been an embarrassing bug.

timholy added a commit that referenced this pull request Aug 7, 2015
Add GriddedInterpolation for non-uniform grids
@timholy timholy merged commit 3d35f12 into master Aug 7, 2015
@timholy timholy deleted the teh/irregular branch August 7, 2015 14:42
@tomasaschan tomasaschan mentioned this pull request Sep 29, 2015
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants