-
Notifications
You must be signed in to change notification settings - Fork 47
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
Issue with Interp #28
Comments
After unsuccessful fiddling around with older Versions of GSL and rb-gsl, I accidentally tried the following way of allocating the Interp object: i=GSL::Interp.alloc("linear",x,y) Now, the Baby example above works. Maybe this helps also others and might help to fix a bug in the library? |
I think we should restrict allocation to one method only. I'll have a look soon. |
Also the second way of allocating the Interp object, leads occasionally to the same error, though not so often as the first one. A fix would be highly appreciated! Thanks a lot! |
Would help us in addressing SciRuby#28.
I am also facing this problem...
@v0dro What you mean with |
Hi,
I have this small test (test_interp.rb) of the Interp function:
require "gsl"
x=[0,1,2,3,4].to_gv
y=[0,1,2,3,4].to_gv
x_new = [3.5].to_gv
puts "x: #{x.inspect}"
puts "y: #{y.inspect}"
puts "x_new: #{x_new.inspect}"
i=GSL::Interp.alloc("linear",x.length)
y_new = i.eval(x,y,x_new)
puts "y_new: #{y_new.inspect}"
With ruby 1.9.3p125, rb-gsl 1.14.7 and GSL 1.14 this always works fine.
With ruby 2.2.0, rb-gsl 1.16.0.6 and GSL 1.16 this gives the error:
test_interp.rb:9:in `eval': Ruby/GSL error code 1, interpolation error (file interp.c, line 150), input domain error (GSL::ERROR::EDOM)
The bad thing is: this error is not reproducable, sometimes the example works, but most of the time it does not. Is there a known issue which explains the behaviour?
Thanks and best regards
Daniel
The text was updated successfully, but these errors were encountered: