[Numpy-discussion] Wrapping C array

Alexandre Alexandre.Fayolle at logilab.fr
Wed May 18 01:04:04 EDT 2005


On Tue, May 17, 2005 at 09:36:22PM -0300, Carlos Pita wrote:
> Hi!
> I need to wrap a pre-existent C array into
> a numarray. It shouldn't be a copy of the
> original array because this is an audio buffer
> with a fixed address and also input/output
> copying from/to the buffer would be overkilling,
> so the numarray *must* be lightly wrapping the
> buffer and not a memcpy of it. But NA_NewArray
> duplicates the passed buffer so I'm not sure
> how to achieve the goal stated above or if
> it's possible at all.
> Can you help me?

I'm not sure for Numarray, but for Numeric, you can use
PyArray_FromDimsAndData(). There should be a similar function in
numarray.  

-- 
Alexandre Fayolle                              LOGILAB, Paris (France).
http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20050518/828112f9/attachment.sig>


More information about the NumPy-Discussion mailing list