bugGNU Octave - Bugs: bug #64011, median "omitnan" option...

 
 

bug #64011: median "omitnan" option produces sub2ind input size error for some inputs

Submitter:  None
Submitted:  Thu 06 Apr 2023 03:26:59 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  9.1.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 07 Apr 2023 12:13:39 AM UTC, comment #8: 

I tested the new code and it works for me.  Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Thu 06 Apr 2023 10:32:37 PM UTC, comment #7: 

tests passed. pushed fix as http://hg.savannah.gnu.org/hgweb/octave/rev/d33f168bdc92

marking as ready for test.

Nicholas Jankowski <nrjank>
Group Member
Thu 06 Apr 2023 07:54:17 PM UTC, comment #6: 

fairly simple fix cleans up the whole omitnan codepath (just force all indexing to columns at the start).  added a few BISTs and running tests now. will push fix once i see it passes

Nicholas Jankowski <nrjank>
Group Member
Thu 06 Apr 2023 06:47:44 PM UTC, comment #5: 

ok. same issue as with the odd path patch below.  anything >2D, find gets an array and outputs a col vector. anything 2D, find gets a row vector and outputs a row vector.  vector inputs have a separate simpler codepath. I'm sure when originally coding this I had 2D inputs as some of my test cases, but must have done some code streamlining, and remaining BISTs were 'too complicated' to catch these.

will work up a not too cumbersome fix and review BISTs to make sure I'm not missing any other obvious cases.

Nicholas Jankowski <nrjank>
Group Member
Thu 06 Apr 2023 06:30:13 PM UTC, comment #4: 

Ok, this is the same problem that the mentioned bugfix corrected for the k_odd code path.  find putting out a row vector for row vector input but a column for almost everything else. will try to make a not too cumbersome fix and then review BISTs to make sure i didn't miss any others.  I assume I did some code streamlining in this section and just didn't have a robust BIST set to catch these things.

Nicholas Jankowski <nrjank>
Group Member
Thu 06 Apr 2023 05:41:09 PM UTC, comment #3: 

Thanks will review.

Nicholas Jankowski <nrjank>
Group Member
Thu 06 Apr 2023 05:36:28 PM UTC, comment #2: 

Error was introduced in this changeset


changeset:   31937:162669cd13c8
user:        Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
date:        Mon Mar 27 10:38:25 2023 -0400
summary:     median.m: Correct odd k orientation in omitnan codepath.


Adding Nicholas to the CC list for this report.

Rik <rik5>
Group administrator
Thu 06 Apr 2023 05:30:02 PM UTC, comment #1: 

Confirmed with cset 37700c8fba9c from April 5th.

Rik <rik5>
Group administrator
Thu 06 Apr 2023 03:26:59 PM UTC, original submission:  

a = [1     2     3     5     1
     2     5     3     1     3
     5   NaN     4     4     3];

>> median(a,2,"omitnan")

error: sub2ind: all subscripts must be of the same size





Note: mean with "omitnan" seems to work
mean(a,2,"omitnan")
ans =

   2.4000
   2.8000
   4.0000



Anonymous

 

(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 nrjank (Posted a comment)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by rik5 (Posted a comment)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2023-04-07 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2023-04-06 nrjank StatusIn Progress Ready For Test
    2023-04-06 nrjank StatusConfirmed In Progress
        Operating SystemGNU/Linux Any
        Summarynew option &quot;omitnan&quot; for median does not seem to work median "omitnan" option produces sub2ind input size error for some inputs
    2023-04-06 rik5 Carbon-Copy- Added nrjank
    2023-04-06 rik5 StatusNone Confirmed
        Planned ReleaseNone 9.1.0

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code