From: Travis O. <oli...@ie...> - 2006-07-02 03:20:00
|
I've been playing a bit with ctypes and realized that with a little help, it could be made much easier to interface with NumPy arrays. Thus, I added a ctypes attribute to the NumPy array. If ctypes is installed, this attribute returns a "conversion" object otherwise an AttributeError is raised. The ctypes-conversion object has attributes which return c_types aware objects so that the information can be passed directly to c-code (as an integer, the number of dimensions can already be passed using c-types). The information available and it's corresponding c_type is data - c_void_p shape, strides - c_int * nd or c_long * nd or c_longlong * nd depending on platform -Travis |