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feb}

_{Mar}
(1) 
_{Apr}

_{May}

_{Jun}

_{Jul}
(5) 
_{Aug}

_{Sep}
(8) 
_{Oct}
(3) 
_{Nov}

_{Dec}

2010 
_{Jan}

_{Feb}
(1) 
_{Mar}
(2) 
_{Apr}
(1) 
_{May}

_{Jun}

_{Jul}
(8) 
_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

2011 
_{Jan}

_{Feb}
(2) 
_{Mar}
(6) 
_{Apr}
(6) 
_{May}
(1) 
_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

2013 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}
(1) 
_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

2014 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}
(1) 
_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

2015 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}

_{Jun}

_{Jul}

_{Aug}

_{Sep}
(3) 
_{Oct}

_{Nov}

_{Dec}

2016 
_{Jan}

_{Feb}

_{Mar}
(7) 
_{Apr}
(12) 
_{May}
(1) 
_{Jun}

_{Jul}

_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 






1

2

3

4

5

6

7

8

9
(1) 
10

11
(1) 
12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31







From: Pierre SCHNIZER <p.schnizer@gs...>  20080811 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.schnizer@...> 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 VierkornRudolph Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt ++ 
From: Tribulations Parallèles <paratribulations@fr...>  20080809 15:26:48

Hi everybody, First of all, thanks for pygsl. I have to perform linear interpolation in a large array (in the order of magnitude of million of points). I have tried to use scipy, but it seems that its linear interpolation has no "accelerator", that is to say the ability to remind the former searched index when the point to interpolate is next to the former, so as to avoid if possible a complete search at each interpolation. But I know that GSL has such an accelerator, that is why I have looked at pygsl. Here is a small program: ###################### import pygsl.interpolation from time import time import numpy t_initial = time() a=numpy.arange(0,10000000) b=numpy.arange(10000000,20000000) c = pygsl.interpolation.linear( len(a) ) pygsl.interpolation.linear.init( c , a , b) for i in range(0,50): print "interpolation=", c.eval(50000) t_final = time() print "passed_time=", t_finalt_initial ##################### The execution of this program takes about 15 seconds on my machine. I do not understand why it is so long. I have checked that the accelerator is used by GSL (by hacking the C code). So where is the time consumed? I do not think that the time could be passed in the only code executed in GSL: x_lo = x_array[index]; x_hi = x_array[index + 1]; y_lo = y_array[index]; y_hi = y_array[index + 1]; dx = x_hi  x_lo; if (dx > 0.0) { *y = y_lo + (x  x_lo) / dx * (y_hi  y_lo); return GSL_SUCCESS; } because index is known from the first interpolation: afterwards, the accelerator is used. So where is the time passed? I have tried to profile the program: $ /usr/lib/python2.5/profile.py test_pygsl.py It is a bit difficult to analyse the output of profile for me, I obtain the following line: 50 13.109 0.262 13.109 0.262 gslwrap.py:1833(gsl_interp_eval) #### COMPARISON with native C/GSL I have tried the same test, but written directly in C and GSL: (to be compiled with: gcc g Wall lgsl lgslcblas test.c o test ####################### #include <stdlib.h> #include <stdio.h> #include <math.h> #include <gsl/gsl_errno.h> #include <gsl/gsl_interp.h> int main (void) { int i; int size = 10000000; double xi = 50000, yi; double * x; double * y; x = malloc( sizeof * x * size ); y = malloc( sizeof * y * size ); if ( ! x  ! y ) { exit(1); } for ( i = 0; i < size; i++ ) { x[i] = i; y[i] = i + size; } gsl_interp_accel *acc = gsl_interp_accel_alloc (); gsl_interp * linear = gsl_interp_alloc ( gsl_interp_linear, size ); gsl_interp_init( linear, x, y, size ); for ( i = 0; i < 50; i++ ) { yi = gsl_interp_eval (linear, x, y, xi, acc); printf ("interpolation=%.1f\n", yi); } gsl_interp_free( linear ); gsl_interp_accel_free( acc ); return 0; } ################## The execution is instantaneous. So where is the time passed in the Python version? Thanks a lot Julien 