[SciPy-User] [cython-users] scipy and cython

Robert Bradshaw robertwb at gmail.com
Thu Oct 31 23:15:39 EDT 2013


On Fri, Oct 25, 2013 at 6:13 PM, Menchyshyn Oleh
<oleh.menchyshyn at gmail.com> wrote:
> I am trying to use SciPy and Cython combination but with a little success. I
> know about huge optimization gain when using vectorized versions of
> algorithms based on NumPy, but I guess my problem depends on NumPy
> implicitly only, through 3D integration routine. My bottleneck is Python's
> function overhead passing many times to scipy.integrate.tplquad in the cycle
> of the scipy.optimize.fmin when searching for the roots of a set of
> non-linear equations.
>
> My question is: Is it possible to pass to SciPy's routines non-PyObjects? I
> read on the Stackoverflow that there were some thoughts about implementing
> those issues.
>
> I tried other non-Python libraries for integrating and roots finding of
> non-lineaer sets of equations. But combining interfaces of different libs in
> C++ is error-prone and tedious sometime. I miss simplicity and readability
> of Python much. Please help me, maybe I just don't get something right with
> Cython+SciPy way

If SciPy doesn't expose a C API, then you have to call it via the
Python API, which could very well be a bottleneck. If it does, then
you can call it like any other C library.

- Robert



More information about the SciPy-User mailing list