From: Pierre S. <p.s...@gs...> - 2008-08-11 15:44:00
|
Dear Julien, I did not get the problem immediately but here it is: - with numx.arange(0,1) you allocate an array of integers. The interpolation code uses internally doubles, so you have to enforce that they will be made float arrays (the native C double type, typically numx.float) so use .astype(numpy.float_) or multiply them with 0.1 - you can check if pygsl had to transform the basis type of the vector with pygsl.init.vector_transform_counter(). Call it before and after the function in question and you will see. - if you share code, please be aware that numpy, numarray or Numeric could be the array package. These packages interchange quite nicely, but that could also cost time, even if not on that scale as your example does. - there are two modules: spline and interpolation. They both provide the same functionality but spline makes internal copies of the vectors x and y. This can save quite some cycles here. Given that you want to interpolate in large arrays, it can be that this is not an option. - spline provides the method eval_vector. If you have an vector you need interpolation values for, this will make a huge difference. If you need the same function for the interpolation drop me a line and I will add it (or for eval_deriv, or eval_integ ....) Sincerely yours Pierre -- +---------------------------------------------------------------------+ Pierre Schnizer <p.s...@gs...> Telephon : +49 6159 71 1557 Fax : +49 6159 71 2043 Address : Pierre Schnizer / F - MT Gesellschaft fuer Schwerionenforschung Planckstrasse 1 64291 Darmstadt Germany WWW: http://www.gsi.de Gesellschaft mit beschr<E4>nkter Haftung Sitz der Gesellschaft: Darmstadt Handelsregister: Amtsgericht Darmstadt, HRB 1528 Gesch<E4>ftsf<FC>hrer: Professor Dr. Horst St<F6>cker Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt +---------------------------------------------------------------------+ |