[SciPy-dev] Re: [SciPy-user] Low-level code integrationdiscussion at scipy'03?

Fernando Perez fperez at colorado.edu
Wed Sep 3 13:09:50 CDT 2003


Perry Greenfield wrote:
>>    FP> This, we agree 100% on.  In fact, if the C API offered a way
>>    FP> to index high rank arrays without manually computing stride
>>    FP> offsets on every access, that would probably satisfy a
>>    FP> significant fraction of usage cases.  I consider one-liners
>>    FP> like the above icing on the cake, but A(i,j,k) indexing is
>>    FP> really a significant change which makes development far more
>>    FP> productive.
>>
> 
> Are you just talking about C macros to do the indexing (including strides?

Well, anything which allows me to say in C/C++:

A(i,j,k,l,m,n) = some_function_of(i,j,k,l,m,n);

square brackets would also work, though

A[i][j][k][l][m][n]

starts to feel ugly real quick.

There seems to be some consensus that in most cases, simplified indexing is 
the #1 wish.  Everything else (array arithmetic, math functions over arrays, 
etc) would be nice, but not a first requirement.

I'd also add that slicing is pretty high on my list, or some mechanism to say 
'this part of this array is really a subset of that one' without data copying. 
  Blitz supports this with semantics and syntax which are eerily similar to 
those in Numeric/Numarray at the python level.

Best,

f.




More information about the Scipy-dev mailing list