SciRuby / rb-gsl

Ruby interface to the GNU Scientific Library
https://github.com/SciRuby/rb-gsl
Other
100 stars 46 forks source link

Add bindings for 2D interpolation functions #37

Open stevemadere opened 8 years ago

stevemadere commented 8 years ago

The Interp bindings are great.

There are a very similar set of functions for 2-dimensional interpolation that are not bound though.

In particular they are:

They are extremely similar to the already-bound 1D functions that are bound in ext/gsl_native/interp.c

I have a feeling that copying this file and doing some minor editing would result in a working binding for the 2D interpolation.

I propose naming the ruby class Interp2D.

I am volunteering to either do this myself or find someone else to do it for a bounty that I will fund. I am just creating this issue to document the intent and requirements.

envp commented 8 years ago

@v0dro - I'd be happy to contribute to this. I'm currently reading the GSL & Ruby/GSL source. I should be able to come up with a basic implementation to review in a PR soon.

@stevemadere - I went through your fork and saw you already have a test case down for GSL::Interp2d::BICUBIC, mind if I borrow the same as a starting point? This would leave me with only GSL::Interp2d::BILINEAR to test.

stevemadere commented 8 years ago

@vaibhav-y - Good news for you: I have already arranged with @v0dro to provide the fix and he should have a PR against my fork ready to go within the next few days. I'll merge it to my fork immediately and you can work from that until the PR is accepted here.

The acceptance test I wrote had to change a bit as we discovered the interface was not exactly the same as the 1D case. I suggest you wait until the fix is in my repository before extending it with a BILINEAR test. The implementation is likely to pass your new test immediately as @v0dro is targeting a complete ruby interface to the 2D library functions.

envp commented 8 years ago

@stevemadere Sounds good! Thanks for letting me know. I was just about to start coding it!