On Thu, Jun 11, 2009 at 4:01 PM, Dag Sverre Seljebotn < da...@student.matnat.uio.no> wrote:
> Stefan Behnel wrote: > > Stefan Behnel wrote: > >> Dag Sverre Seljebotn wrote: > >>> In every other programming language I know about with componentwise > >>> operations, the word "array" is used. "vector" is something you Coder > >>> People try to force down on us Numericals :-) > >>> > >>> (I know that the word is used like this in CS circles, but I prefer > only > >>> using the word in contexts where the meaning is crystal clear (as in > >>> "vectorized operations") myself.) > >> Ah, so all you really want is a SIMD data type, right? > > Right :-) Now linear algebra support in the compiler *would* be taking > things quite overboard (and probably only slow things down, unless N is > really small, like 4x4 3D game matrices...), I'm actually against that. > Well only if you do it directly in a hard-coded datatype. Why not having a non numeric base class as Stefan proposed. And then allowing the operator functions be handled by Eigen/Blitz. This would enable very fast numerics, including SSE and fast linear algebra. And without having it as tightly coupled in the main language. Similar in that expect to weave, but with all the advantages of cython. Component wise operations without optimization (thus collapsing d=a*b*c*d into one loop instead of 3 and not using temporary arrays) does not give you any speed-up over Numpy for vectorized code with large arrays. For vectorized Numpy code the bottleneck is not the call from Python to C, but the inefficient use of cache because of the temporary arrays. And I don't think you need a full metalanguage to map the array class to Eigen/Blitz. Though it would be still be couple somewhat to the main language otherwise I agree you would need a metalanguage or full template support. But it seems to me that there should be an optimum between full template support and doing the numerics directly in a language specific numeric array type. Sorry for being vage in this central point. I just don't know the cython details here. For the naming: why not calling it ndarray, nparray or narray? Even numpy has two array types to allow different operator syntax. Hardcoding one into the default array won't allow that in the future. Roland -- ORNL/UT Center for Molecular Biophysics cmb.ornl.gov 865-241-1537, ORNL PO BOX 2008 MS6309
_______________________________________________ Cython-dev mailing list Cython-dev@codespeak.net http://codespeak.net/mailman/listinfo/cython-dev