bugGNU Octave - Bugs: bug #65683, issorted: enable 'monotonic' and...

 
 

bug #65683: issorted: enable 'monotonic' and "strict..." sort modes.

Submitter:  Yihua Liu <yihua_liu>
Submitted:  Sat 04 May 2024 07:22:03 AM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Ready For Test Assigned to:  None
Originator Name:  Yihua Liu Open/Closed:  * Open
Release:  * 9.1.0 Operating System:  * Any
Fixed Release:  None Planned Release:  10.1.0 (current default)
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 14 Jun 2024 11:58:12 PM UTC, comment #3: 

attached is an untested starting attempt at how to implement the strict options.

the 'isunique? FIXME' part of determining retval is unimplemented.  not sure if we have an efficient function to call to evaluate that. i guess if we had an efficient/compiled version of unique to call we wouldn't use the m-file version?

this also has a pile of bists that should be met by the feature.

(file #56165)

Nicholas Jankowski <nrjank>
Group Member
Fri 14 Jun 2024 06:16:57 PM UTC, comment #2: 

patch for 'monotonic' pushed to default as
https://hg.savannah.gnu.org/hgweb/octave/rev/b2af12232f75

marking as Ready for test.

will look at strict options, but may wait to see if there's something more efficient than comment #1 option.

Nicholas Jankowski <nrjank>
Group Member
Fri 14 Jun 2024 06:04:49 PM UTC, comment #1: 

The primary request here is pretty simple. running tests now on a  patch that enables monotonic as an alias for unique.

for the other options ('strictascend', 'strictdescend', 'strictmonotonic' (and i guess 'stricteither')) their might be more efficient ways to check, but something like:


issorted(A, 'strictascend') -->  (issorted (A, 'ascend') && A != unique (A))

should do the job.

Nicholas Jankowski <nrjank>
Group Member
Sat 04 May 2024 07:22:03 AM UTC, original submission:  

Currently, the "MODE" parameter of the function `issorted` could be 'ascend', 'descend', or 'either' in libinterp/corefun/data.cc. However, MATLAB's `issorted` function uses 'ascend', 'descend', or 'monotonic' for the "MODE" parameter. Additionally, MATLAB offers 'strictascend', 'strictdescend', and 'strictmonotonic' modes. It seems that the three new modes are not difficult to extend; the only issue is to change the 'either' mode to 'monotonic' based on my understanding.

Yihua Liu <yihua_liu>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #56166:  issorted_strictmodesv3.diff added by nrjank (9KiB - application/octet-stream - this one complies. v2 had a missing @ in the docstring)
file #56165:  issorted_strictmodesv2.diff added by nrjank (9KiB - application/octet-stream - partial strict modes implementation)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by yihua_liu (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-06-15 nrjank Attached File- Added issorted_strictmodesv3.diff, #56166
    2024-06-14 nrjank Attached File- Added issorted_strictmodesv2.diff, #56165
    2024-06-14 nrjank StatusPatch Submitted Ready For Test
    2024-06-14 nrjank StatusNone Patch Submitted
        Operating SystemMicrosoft Windows Any
        Planned ReleaseNone 10.1.0 (current default)
        SummaryAllow &quot;monotonic&quot; mode for function `issorted` issorted: enable 'monotonic' and "strict..." sort modes.
    2024-05-04 jwe Severity3 - Normal 1 - Wish
        Priority5 - Normal 3 - Low
        Item GroupMatlab Compatibility Feature Request

    Back to the top

    Powered by Savane 3.13-3e34.
    Corresponding source code