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

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

[Octave-bug-tracker] [bug #52919] comparison of complex values


From: Michael Leitner
Subject: [Octave-bug-tracker] [bug #52919] comparison of complex values
Date: Thu, 18 Jan 2018 08:15:13 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

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

Re comment #6:
I showed how the present behaviour of sort can be obtained when only
comparisons of real values are used, and I admitted that this is less
efficient than having the comparison function do it directly. And I doubted
that this decreased efficiency would constitute a problem, which probably is
also valid for your use case: most likely you sort the points that you plot
afterwards, and even sorting two times will take much less time per point than
plotting them. 

Actually: in my system a sort of 1e7 real numbers takes 1.26 seconds, and a
sort of 1e7 complex numbers takes 7.3 seconds. So it seems that the option to
sort complex numbers is an afterthought that (nearly) nobody is using anyway,
otherwise somebody would probably have come up with the idea to write a
wrapper around sort for complex values to regain this factor of three by my
trivial algorithm, which I now suggest. By the way, I think that for unique
this is much more relevant.

For testing use the attached script. So it seems to me that my caveat of
efficiency actually goes the other way. And it would not be any problem at all
to implement Matlab's extended syntax for sort in this way.


(file #42955)
    _______________________________________________________

Additional Item Attachment:

File name: sort_complex_test.m            Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52919>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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