bugGNU Octave - Bugs: bug #57533, Incorrect error message when...

 
 

bug #57533: Incorrect error message when assigning to a subset of a 3+ dimensional array

Submitter:  Clint <terikin>
Submitted:  Fri 03 Jan 2020 08:25:37 PM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Clint Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 14 Mar 2021 01:20:32 AM UTC, comment #3: 

This has been fixed on the development branch in changeset 2cfdcae08e84 (3/9/21).  Marking as fixed and closing report.

Rik <rik5>
Group administrator
  Spam posted by _174830
Sat 04 Jan 2020 12:11:37 AM UTC, comment #1: 

Confirmed.  Matlab, as well as Octave in the 2-D case, get it right.

This is probably something about reporting the dimensions of the original base matrix, rather than the dimensions of the object after indexing.  As an example of that,


octave:21> a = zeros (3,4,5);
octave:22> b = ones (2,2);
octave:23> a(1,:,2) = b
error: =: nonconformant arguments (op1 is 3x4x5, op2 is 2x2)



Rik <rik5>
Group administrator
Fri 03 Jan 2020 08:25:37 PM UTC, original submission:  

When making an assignment to a subset of a higher-dimensional array, the error message can list incorrect dimensionality for op1.  The error message is correct when the matrix receiving the assignment has only two dimensions.

Example of code giving incorrect error:

a = zeros(2, 2, 1);
b = ones(2, 2);
a(1, :, 1) = b;
>> error: =: nonconformant arguments (op1 is 2x2x1, op2 is 2x2)

But it is readily apparent that op1 is actually 1x2x1.

In contrast, when a is 2x2:

a = zeros(2, 2);
b = ones(2, 2);
a(1, :) = b;
>> error: =: nonconformant arguments (op1 is 1x2, op2 is 2x2)

Here, the error message correctly reports the dimensionality of the subset of a that is being assigned to.


I've seen the same behavior in version 5.1.0 on Windows 10 and in version 4.2.2 on Ubuntu Linux.

Clint <terikin>

 

(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 terikin (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-03-14 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2020-01-08 mtmiller Carbon-CopyRemoved 174830 -
    2020-01-04 rik5 Severity3 - Normal 2 - Minor
        Item GroupNone Other
        StatusNone Confirmed
        Release5.1.0 dev

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code