bugGNU Octave - Bugs: bug #54599, issorted yields an error for the...

 
 

bug #54599: issorted yields an error for the empty vector

Submitter:  gdudziuk <gdudziuk>
Submitted:  Thu 30 Aug 2018 04:31:51 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 02 Sep 2018 02:56:06 PM UTC, comment #9: 

For some other issorted reports look at bugs #54142, #54143, and #54144.

Rik <rik5>
Group administrator
Sat 01 Sep 2018 08:42:37 PM UTC, comment #8: 

I made the following change to fix this bug on the default branch

https://hg.savannah.gnu.org/hgweb/octave/rev/153495e05477

This will be part of the Octave 5 release.

Just by looking at the public docs for Matlab's issorted function, there are plenty of other compatibility differences that can be addressed, if someone wants to look at this more closely.

Mike Miller <mtmiller>
Group Member
Sat 01 Sep 2018 07:49:54 PM UTC, comment #7: 


>> version
ans = '9.4.0.813654 (R2018a)'

>> issorted([])
ans = logical 1

>> issorted({})
ans = logical 1


A.R. Burgers <arb>
Sat 01 Sep 2018 07:47:58 PM UTC, comment #6: 


>> version
ans = '9.4.0.813654 (R2018a)'

>> issorted([])
ans = logical  1

>> issorted({})
ans =  logical 1
-verbatim

A.R. Burgers <arb>
Fri 31 Aug 2018 06:55:27 PM UTC, comment #5: 

Does issorted({}) also return true in Matlab (empty cell array)?

Mike Miller <mtmiller>
Group Member
Fri 31 Aug 2018 09:01:50 AM UTC, comment #4: 

About issorted's flags:
Would it be possible if issorted() would accept at minimum "a", "d", or "e" rather than the full "ascend", "descend" or "either"? These characters are sufficiently distinct IMO.

Philip Nienhuis <philipnienhuis>
Group Member
Fri 31 Aug 2018 08:56:25 AM UTC, comment #3: 

(never mind the underscores - turns out Savannah ignores "*" and "_" markup when enclosed in quotes - good to know)

Philip Nienhuis <philipnienhuis>
Group Member
Fri 31 Aug 2018 08:54:37 AM UTC, comment #2: 

Confirmed on Windows with Octave development version.

Matlab r2018b returns true ("logical 1"); I'm unsure whether it is a bug or a case of Matlab incompatibility.

In addition, issorted()'s help text mentions the flags "ascend_ing_" and 'descend_ing_' where the function only accepts "ascend" and "descend".

Philip Nienhuis <philipnienhuis>
Group Member
Thu 30 Aug 2018 04:36:20 PM UTC, comment #1: 

Please excuse me, there was a typo in the markup in the original submission that messed up the post. Here I submit again:

Input:

issorted([])


Output:

error: issorted: needs a vector


It appears to me as "an error message for valid input", so I figure it is a bug. I would expect the result to be TRUE, as in Matlab. Even if Octave had reasons to depart from the latter convention, I would expect issorted to accept the empty vector.

gdudziuk <gdudziuk>
Thu 30 Aug 2018 04:31:51 PM UTC, original submission:  

Input:

issorted([])

Output:

error: issorted: needs a vector
-varbatim-

It appears to me as "an error message for valid input", so I figure it is a bug. I would expect the result to be TRUE, as in Matlab. Even if Octave had reasons to depart from the latter convention, I would expect issorted to accept the empty vector.

gdudziuk <gdudziuk>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by arb (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by gdudziuk (Submitted the item)
  • -email is unavailable- added by gdudziuk
  •  

    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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-09-01 mtmiller StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2018-08-31 philipnienhuis Release4.2.2 dev
        Operating SystemGNU/Linux Any
    2018-08-31 philipnienhuis StatusNone Confirmed
    2018-08-30 gdudziuk Carbon-Copy- Added gdudziuk

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code