[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55659] s_idx output of ismember uses last occ
From: |
Nicholas Jankowski |
Subject: |
[Octave-bug-tracker] [bug #55659] s_idx output of ismember uses last occurrence when there are duplicates, Matlab uses first |
Date: |
Wed, 5 Jan 2022 17:12:24 -0500 (EST) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 |
Update of bug #55659 (project octave):
Status: Confirmed => Patch Submitted
Operating System: GNU/Linux => Any
_______________________________________________________
Follow-up Comment #3:
attached is a patch that implements the ismember 'legacy' option for returning
the first/last index, so as to match curret matlab behavior. Verified BISTs
and added ones for 'legacy'. For the most part getting the first result was
just a matter of reversing the array order before processing. for 'rows',
since lookup isn't used, it just meant calling unique with 'first' instead of
'last' and changing the mapping after the fact. and the complex input handling
just needed a switch from checking min to max. other than a few extra if
(optlegacy)'s, i think the only overhead is a few flipud's in the !optlegacy
paths.
a few issues popped up with processing char arrays, and I added those as 3
xtests at the end, and created bug #61765 (for issorted handling of arrays,
which i think is the main cause of all 3.)
patch updates news.8 with matlab compatibility note as well.
i also noted that this doesn't do anything related to char whitespace handling
mentioned in bug #51187, or the different handling of some classes as hinted
at in the matlab docs.
(file #52617)
_______________________________________________________
Additional Item Attachment:
File name: ismember_legacy_bug55659.diff Size:12 KB
<https://file.savannah.gnu.org/file/ismember_legacy_bug55659.diff?file_id=52617>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55659>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55659] s_idx output of ismember uses last occurrence when there are duplicates, Matlab uses first,
Nicholas Jankowski <=