[Numpy-discussion] "expected a single-segment buffer object"

Charles R Harris charlesr.harris@gmail....
Thu Jul 10 10:55:35 CDT 2008


On Thu, Jul 10, 2008 at 9:33 AM, Anne Archibald <peridot.faceted@gmail.com>
wrote:

> 2008/7/9 Robert Kern <robert.kern@gmail.com>:
>
> > Because that's just what a buffer= argument *is*. It is not a place
> > for presenting the starting pointer to exotically-strided memory. Use
> > __array_interface__s to describe the full range of representable
> > memory. See below.
>
> Aha! Is this stuff documented somewhere?
>
> > I was about a week ahead of you. See numpy/lib/stride_tricks.py in the
> trunk.
>
> Nice! Unfortunately it can't quite do what I want... for the linear
> algebra I need something that can broadcast all but certain axes. For
> example, take an array of matrices and an array of vectors. The
> "array" axes need broadcasting, but you can't broadcast on all axes
> without (incorrectly) turning the vector into a matrix. I've written a
> (messy) implementation, but the corner cases are giving me headaches.
> I'll let you know when I have something that works.
>

I think something like a matrix/vector dtype would be another way to go for
stacks of matrices and vectors. It would have to be a user defined type to
fit into the current type hierarchy for ufuncs, but I think the base
machinery is there with the generic inner loops.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080710/de595d25/attachment.html 


More information about the Numpy-discussion mailing list