[Cython] aritmetic with arrays in Cython

Stefan Behnel stefan_ml at behnel.de
Fri Oct 24 10:36:56 CEST 2014


Ian Henriksen schrieb am 09.08.2014 um 00:15:
> On Fri, Aug 8, 2014 at 3:09 PM, Ian Henriksen wrote:
>> On Fri, Aug 8, 2014 at 12:02 PM, Julian Taylor wrote:
>> Stefan, thanks for the direction. I think I know how to proceed now. It'll
>> probably take me some time to learn how to do all this, but I'll start
>> reading/working on it now.
>>
>> Julian, from a dependency standpoint I'd really prefer to use numpy. As
>> near as I can tell, the people most likely to use this feature already use
>> numpy. That would also remove the C++ dependency for this. I think the main
>> reason for using eigen is that it will be easy to interface with and will
>> eliminate temporaries automatically. In the long term, it could be good to
>> offer multiple backends for these sorts of operations. Numpy would be a
>> primary candidate for something like that. I'll spend some time working
>> with numpy's ufunc api to see if I can figure out a good way to use that
>> instead.
> 
> Maybe I should clarify a little about why eigen is a good place to start.
> According to http://eigen.tuxfamily.org/dox/TopicLazyEvaluation.html it
> already takes care of things like the elimination of temporary variables
> and common subexpression reduction at compile time. This should make it
> possible to compile array expressions in Cython without having to
> re-implement those sorts of optimizations. Ideally we would just have to
> map memory view operations to corresponding equivalents from eigen. It's
> not yet clear to me how to do things with arbitrary-dimensional arrays or
> broadcasting, but, given some more time, a solution may present itself.

Did anything come out of this yet?

Stefan



More information about the cython-devel mailing list