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: Mon, 14 May 2018 02:41:28 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

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

It's just that the complex numbers are not an ordered field, that is, there is
no total order that is compatible with how the natural ordering relation on
the real numbers behaves under addition and multiplication. However, as with
any set you can also assign a total order to the complex numbers. As I see it,
the most intuitive one would be the lexicographic order that is implied by
understanding the complex numbers as the Cartesian product R x R, with the two
added advantages that in this case the real numbers as R x {0} would then be
order-embedded in the complex numbers, and that the numerical effort of a
complex comparison would be only insignificantly larger than a real
comparison, compared to the present case where two abs() have to be computed
for every comparison (and sometimes even two atan2()s).

And if you error out for every complex comparison, you break unique() and thus
union(), setdiff() and so on as they are now and need to emulate their
behaviour by an explicit unique([real(a)(:) imag(a)(:),"rows") followed by
reshaping, which is significantly less efficient and more memory-consuming. So
the upshot: it is desirable to have a well-defined total order also on complex
numbers, even if you are not interested in the specific ordering.

    _______________________________________________________

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]