Is complex numbers support planned?

Asked by Florent J.

Hello,

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 pytave.py, 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.

Florent

Question information

Language:
English Edit question
Status:
Answered
For:
Pytave Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
qwertitis (qwertitis-deactivatedaccount) said :
#1

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 python_to_octave.cc, the copy_pyarrobj_to_octarray function could be used as is. The octave_to_python.cc'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 :
#2

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.