[SciPy-User] polylogarithm?

Johann Cohen-Tanugi johann.cohen-tanugi@lupm.univ-montp2...
Mon Sep 19 09:15:06 CDT 2011

thanks a lot Pauli, a quesiton offlist : what do you mean by "PyObject 
On 09/19/2011 03:55 PM, Pauli Virtanen wrote:
> Mon, 19 Sep 2011 15:42:52 +0200, Johann Cohen-Tanugi wrote:
> [clip]
>> where the first one is the mpmath code without the mpmath ctx objects
>> invoked, the second is the cython version, and the third is the mpmath
>> native version (0.17). Before I dive into cython management of arrays in
>> order for polylog to accept input arrays, I would appreciate feedback on
>> where to look for potential further improvements using cython, if any,
>> on a simplistic script as this one.
> In short:
> - Check the annotated HTML output from "cython -a".
>    The name of the game is to make things less yellow.
> - Add cdef type for all variables (removes PyObject boxing).
>    This will be the main source of speed gains.
> - Sprinkle in @cython.cdivision(True)
> - Use "from libc.math cimport abs"
> - Take a look at lambertw.pyx in scipy.special.
>    It shows you how to make the function an ufunc.

More information about the SciPy-User mailing list