Re: [Numpy-discussion] Best way to broadcast a function from C

2014-08-22 Thread James Crist
I suspected as much. This is actually part of my work on numerical evaluation in SymPy. In its current state compilation to C and autowrapping *works*, but I think it could definitely be more versatile/efficient. Since numpy seemed to have solved the broadcasting/datatype issues internally I hoped

Re: [Numpy-discussion] Best way to broadcast a function from C

2014-08-22 Thread Jaime Fernández del Río
You can always write your own gufunc with signature '(),(),()-(a, a)', and write a Python wrapper that always call it with an `out=` parameter of shape (..., 3, 3), something along the lines of: def my_wrapper(a, b, c, out=None): if out is None: out =

Re: [Numpy-discussion] Best way to broadcast a function from C

2014-08-22 Thread Nathaniel Smith
On Sat, Aug 23, 2014 at 12:40 AM, James Crist crist...@umn.edu wrote: I suspected as much. This is actually part of my work on numerical evaluation in SymPy. In its current state compilation to C and autowrapping *works*, but I think it could definitely be more versatile/efficient. Since numpy

Re: [Numpy-discussion] Best way to broadcast a function from C

2014-08-21 Thread Nathaniel Smith
On Thu, Aug 21, 2014 at 2:34 AM, James Crist crist...@umn.edu wrote: All, I have a C function func that takes in scalar arguments, and an array of fixed dimension that is modified in place to provide the output. The prototype is something like: `void func(double a, double b, double c,

[Numpy-discussion] Best way to broadcast a function from C

2014-08-20 Thread James Crist
All, I have a C function func that takes in scalar arguments, and an array of fixed dimension that is modified in place to provide the output. The prototype is something like: `void func(double a, double b, double c, double *arr);` I've wrapped this in Cython and called it from python with no