[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52437] Second output of ismember is wrong for
From: |
Luis Mendo |
Subject: |
[Octave-bug-tracker] [bug #52437] Second output of ismember is wrong for complex input |
Date: |
Sat, 18 Nov 2017 11:56:02 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 |
Follow-up Comment #3, bug #52437 (project octave):
Thanks.
Note that the linked version before the reimplementation gives an error on
logical inputs. Matlab and Octave's reimplemented version work with logical
inputs.
So in addition to regression, something like this could be added at the
beginning of ismember:
if islogical(a), a = uint8(a); end
if islogical(s), s = uint8(s); end
Also, Matlab's and Octave's reimplemented ismember are happy to compare inputs
of different numeric type, as long as one of them is double in Matlab, or in
any case in Octave. Replacing the following line in ismember (version before
the reimplementation)
if (! isa (a, class (s)))
by
if (! isa (a, class (s))) && ...
! (isa (a, 'double') || isa (s, 'double'))
seems enough.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52437>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/