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

[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:25:42 -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

Follow-up Comment #4, bug #55659 (project octave):

forgot, there's also one current test that produces an error, but matlab
produces a warning. Specifically:


%!fail ("ismember ({'1'}, {'1' '2'},'rows')")

gives an error in octave: 


>> ismember ({'1'}, {'1' '2'},'rows')

error: ismember: cells not supported with "rows" flag
error: called from
    validsetargs at line 62 column 13
    ismember at line 146 column 10


vs matlab which does:

>> ismember ({'1'}, {'1' '2'},'rows')
Warning: The 'rows' input is not supported for cell array inputs. 
> In cellismemberlegacy (line 47)
In cell/ismember (line 65) 

ans =

  logical

   1


I don't know if that is a deliberate choice.   for now this patch just adds a
comment noting such after that test. if it should issue a warning and provide
an output for compatibility, either validsetargs  would have to be adjusted,
or ismember would have to work around that case.

(also, v2 patch attached fixing input validation block.)

(file #52618)
    _______________________________________________________

Additional Item Attachment:

File name: ismember_legacy_bug55659_v2.diff Size:12 KB
   
<https://file.savannah.gnu.org/file/ismember_legacy_bug55659_v2.diff?file_id=52618>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55659>

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




reply via email to

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