Mark Heslep wrote:
> Travis Oliphant wrote:
>   
>> Mark Heslep wrote:
>>     
>>> I don't see a clean way to create a numpy array from a ctypes pointer 
>>> object. Is the __array_interface_ in ctypes the thing thats missing 
>>> needed to make this happen?  I've followed Albert's  Scipy cookbook 
>>> on ctypes here
>>>
>>> On the C side the PyArray_SimpleNewFromData( ..dimensions, ...data 
>>> ptr) C API does the job nicely.  Is there a ctypes paradigm for 
>>> SimpleNew...?
>>>   
>>>       
>> Can you somehow call this function using ctypes?
>>
>> -Travis
>>     
> That might work, though indirectly.  As I think I understand from ctypes 
> docs:  Ctypes uses functions exposed in a  shared library, macros 
> existing only a header are not available.  If its PyArray... is a macro 
> then I a) need to compile and make a little library directly from 
> arrayobject.h or b) need to use the root function upon which the macro 
> is based, PyArrayNew?
>
>   
This is more complicated because all the C-API functions are actually 
just pointers stored in _ARRAY_API of multiarray.    So, something would 
have to be built to interpret the C-pointers in that C-Object.  I'm not 
sure that is possible.

-Travis



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to