On Oct 14, 2007, at 1:40 AM, Joshua Kantor wrote: > > Good to see that you got things sped up. > > The factor of 30 or so slowdown is consistent with my experience > comparing to matlab. > I believe the issue is that due to the way the interface to gsl works > > explanation: > The gsl ode solver is a c function that requires a C function pointer > to be passed to it. > So we have to convert the users python function into a C function, > this is done by > defining a cdef pyrex function that takes the users function as an > argument and calls it. So in the end every function evaluation calls a > C function which calls your python function. > Python function calls are expensive so this adds overhead. > > > It is possible to directly define the system as a pyrex object which > makes the wrapping unnecessary and means all function calls are in C, > this is much faster and I found it to be comparable to matlab, > however, this is hard for a general user to do.
Perhaps this could be written to use the new rdef function code, to make it easier for the user to provide a cdef function to the solver. - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---