octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #61912] Slow performance of complex()


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #61912] Slow performance of complex()
Date: Wed, 26 Jan 2022 01:07:39 -0500 (EST)

Follow-up Comment #7, bug #61912 (project octave):

The constructors like


octave_value (const ComplexNDArray&)


will transform the value from complex to real if the imaginary part is zero
and we don't want that to happen in the complex function.  The constructor
that takes a pointer to the rep object doesn't do that.  There should be a an
explanatory comment for that because it wasn't obvious to me either at this
point.

My guess is that at the time that the complex function was added, there was no
way to create an uninitialized array.  If there is now, then yes, we should be
using it if the next step will be to redefine every element.

Using xelem or even just pointers to the data seems fine to me, but I'd rather
avoid things like using "reinterpret_cast<double*>".

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61912>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]