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

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

[Octave-bug-tracker] [bug #53880] (x<1)(1) depends on x(2):


From: Michael Leitner
Subject: [Octave-bug-tracker] [bug #53880] (x<1)(1) depends on x(2):
Date: Sat, 12 May 2018 15:30:09 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux i686; rv:47.0) Gecko/20100101 Firefox/47.0

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

I would be satisfied with a warning, on by default. As I mentioned in bug
#52919, the way I initially came upon this problem was that it resulted in
incorrect behaviour of code of mine, because I used vector comparisons, where
sometimes the vector had (a very small number of) complex entries, just as the
original reporter of the present bug describes. A warning would have made me
immediately aware of the problem. 

I can think of only one legitimate use case of comparing complex values, to
wit, the function unique. But actually, in this case the total ordering is
only necessary for the sort that goes on in the background, and any total
order would do. Would there be some way to selectively disable the warning in
a sort (or sortrows) that is called from unique? Because it is obviously
perfectly valid to request the unique values of a complex vector. All other
uses of sort, max, bare < and so on should in my eyes rather explicitly form
and compare the absolute values, angles, real parts or whatever. 

So actually there is a further argument for changing the ordering on complex
numbers to lexicographic ordering: It has significantly higher performance
(see bug #53012). So this would allow unique to run much faster on complex
vectors than is possible with the present choice without using any additional
memory.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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