[Numpy-discussion] missing array type
Travis Oliphant
oliphant at ee.byu.edu
Mon Feb 27 16:22:20 CST 2006
Sasha wrote:
>It looks like what you want is a zero-stride array that I proposed
>some time ago. See "zeros in strides" thread
><http://sourceforge.net/mailarchive/forum.php?thread_id=9629046&forum_id=4890>.
>
>I've posted a patch to the list, but it was met with a mild opposition
>from Travis, so I've never committed it to SVN. The final word was:
>
>"""
>I would also like to get more opinions about Sasha's proposal for
>zero-stride arrays.
>
>-Travis
>"""
>
>If you agree that zero-stride array would provide the functionality
>that you need, it may tip the ballance towards accepting that patch.
>
>
Actually, I think it does. I think 0-stride arrays are acceptable (I
think you can make them now but you have to provide your own memory,
right?)
From one perspective, all we are proposing to do is allow numpy to
create the memory *and* allow differently strided arrays, right? Now,
if it creates the memory, the strides must be C-contiguous or
fortran-contiguous. We are going to allow user-specified strides, now,
even on memory creation.
Sasha, your initial patch was pretty good but I was concerned about the
speed of array creation being changed for other cases. If you can speed
up PyArray_NewFromDescr (probably by only changing the branch that
currently raises an error), then I think your proposed changes should be
O.K.
The check on the provided strides argument needs to be thought through
so that we don't accept strides that will allow walking outside the
memory that *is* or *will be* allocated.
I have not reviewed your code for this, but I'm assuming you've thought
that through?
-Travis
More information about the Numpy-discussion
mailing list