[Top][All Lists]

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

[Octave-bug-tracker] [bug #53897] poly of conjugate complex pairs should

From: Rik
Subject: [Octave-bug-tracker] [bug #53897] poly of conjugate complex pairs should return a real polynomial
Date: Wed, 6 Mar 2019 13:48:47 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Update of bug #53897 (project octave):

                  Status:          Patch Reviewed => Fixed                  
             Open/Closed:                    Open => Closed                 


Follow-up Comment #17:

I checked in the patch here

I made a few small modifications.  In place of tmp1, tmp2, and tmp I used what
I hope are more meaningful variable names pos_imag, neg_imag, and is_equal.

In place of using all() and size() together I just used the C++ function

-    if (all (size (tmp1) == size (tmp2)))
+    if (size_equal (pos_imag, neg_imag))

For the BIST test, I used commas to clearly delineate where each number stops
which can sometimes be ambiguous.  Is "-9 - 3i" a single complex number or is
it two numbers, "-9+0i AND 0-3i".

-%! assert (y, [1 +  0i   -9 -  3i   25 + 24i  -17 - 57i  -12 + 36i])
+%! assert (y, [1 + 0i, -9 - 3i, 25 + 24i, -17 - 57i, -12 + 36i]);

Thanks Marco for coming up with a high-performance patch (no isequal call).

This will be a part of the bug fix release 5.2.0 in a few months.


Reply to this item at:


  Message sent via Savannah

reply via email to

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