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

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

[Octave-bug-tracker] [bug #59850] Add missing function "uniquetol"


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #59850] Add missing function "uniquetol"
Date: Fri, 19 Nov 2021 00:36:00 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0

Follow-up Comment #38, bug #59850 (project octave):

ok, i think this takes care of all of the issues identified in comment #35 and
comment #36.  

3 - Sorting has been added to 'byrows' by doing a sortrows() at the beginning,
retaining the sort index and its inverse, and using those to map ia and ic.

2 - empties are now handled by moving the isempty check after the input
validation, then doing a few manual size checks output the correct sizes for
c, ia, ic. (this seems to come up in a lot of functions. I think Matlab
preallocates many outputs based on size(input) then changes the size of
certain dims according to expected function operation, and it results in odd
empty sizes. Absent rewriting to try to mimic that, easier just to arbitrarily
set to the outcomes.)

1&4 - added a separate if (all(isnan)) codepath that adjusts the count for
adding NaNs to the end, ensured the row/col orientation stays set when there's
only 1 element in c, the adjusted how it appended nan locations to ia so it
didn't add redundant data.

5 - adjusted help text

added BISTs for everything addressed here, and went back checking all BISTs
against matlab 2021a.  had to rewrite a few after adding the byrows sorting,
and it seemed a lot of tests expected ia to be a row vector.  fixed that in
the tests and the code to make sure it was always a column.

patch attached that makes all those changes.  as far as i can tell other than
performance issues, this seems complete. 

(i'm convinced since the sort is handled upfront outside he loop, the loop
could probably be vectorized. since it's restricted to 2D, could probably
project the tol check in dim3. might look at later.)


(file #52294)
    _______________________________________________________

Additional Item Attachment:

File name: bug59859_uniquetol_nrjfixes.diff Size:8 KB
   
<https://file.savannah.gnu.org/file/bug59859_uniquetol_nrjfixes.diff?file_id=52294>



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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