This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rutsky
Recipients amaury.forgeotdarc, rutsky
Date 2013-01-11.00:45:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1357865112.38.0.0342714962435.issue16899@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, I managed to pass and operate with matrices of complex numbers to pure C and Fortran programs by using Numpy and their ctype adapters (only for whole matrices, they don't provide c_complex type; in general see http://www.scipy.org/Cookbook/Ctypes for details).

I suppose pure python solution that suggested in provided by you link works too:

class Complex64(Structure):
    _fields_ = [("real", c_float), ("imag", c_float)]

But I'm unsure is this is expected behavior or luck, and on some platform this code will not work due to different complex numbers internal representation.

Any way this should be implemented in libffi first, and then in ctypes, so this feature request should be postponed, IMO.
History
Date User Action Args
2013-01-11 00:45:12rutskysetrecipients: + rutsky, amaury.forgeotdarc
2013-01-11 00:45:12rutskysetmessageid: <1357865112.38.0.0342714962435.issue16899@psf.upfronthosting.co.za>
2013-01-11 00:45:12rutskylinkissue16899 messages
2013-01-11 00:45:11rutskycreate