[SciPy-user] weave doesn't recognise complex?

Peter Bienstman Peter.Bienstman@ugent...
Fri Sep 7 10:10:28 CDT 2007


Consider the following script:

------------------
from numpy import *
from scipy.weave import inline

alpha = sqrt(2) - 1j

inline("1.0 / alpha;", ['alpha'])
-------------------

This doesn't compile:
/home/pbienst/.python24_compiled/sc_f7fc5c122cc2b740c6482ea58b8bdeb10.cpp:663: 
error: ambiguous overload for 'operator/' in '1.0e+0 / alpha'

Looking in the generated code, it seems weave hasn't detected that alpha is a 
complex:

py::object alpha = convert_to_catchall(py_alpha,"alpha");

What does work is changing sqrt(2) by 1.41 or replacing 'from numpy import *' 
by 'from math import *'

Cheers,

Peter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20070907/011b576a/attachment.bin 


More information about the SciPy-user mailing list