Is complex numbers support planned?

Asked by Florent J.


first of all, I would like to thank the developers of pytave which seems to work well and will be very helpful for me.

It seems that currently arrays containing complex numbers are not supported according to the information in, which is confirmed by the first experiments I made with pytave.

Do you plan to add support for complex numbers in pytave in the near future?
If not, would this be difficult to add, and where should I look?

Thank you for your answers.


Question information

English Edit question
Pytave Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :

Thank you. If I recall correctly, a complex number is stored as a C complex primitive in both PyArrayObject and Octave, i.e. the datatype "complex double" or "complex float" (complex is a reserved word, a modifier). This, believe it or not, greatly reduces the effort needed to implement complex support. What one would need to do is to correctly classify and copy the contents of the complex containers in much the same way as one does with doubles and floats today.

In, the copy_pyarrobj_to_octarray function could be used as is. The's copy_octarray_to_pyarrobj would probably need a template specializations, perhaps <complex double, ComplexNDArray>.

I won't implement complex support since it is not needed in my application.

Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :

Complex matrices are now supported in the lp:pytave trunk.

Can you help with this problem?

Provide an answer of your own, or ask Florent J. for more information if necessary.

To post a message you must log in.