bugGNU Octave - Bugs: bug #45467, Assigning empty matrix to empty...

 
 

bug #45467: Assigning empty matrix to empty indexing slice gives dimension mismatch error

Submitted by:  Lachlan Andrew <lachlan>
Submitted on:  Fri 03 Jul 2015 10:35:51 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: LachlanOpen/Closed: Closed
Release: 4.0.0Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 24 Jul 2015 09:42:36 PM UTC, comment #1:

Thanks for the patch. I added comments for version control and checked in the change under your name here (http://hg.savannah.gnu.org/hgweb/octave/rev/41d19a6ef55a). This will be a part of the next major release, 4.2.

Rik <rik5>
Project Administrator
Fri 03 Jul 2015 10:35:51 AM UTC, original submission:

Assigning a zero-sized matrix to a zero-sized slice of a matrix should work, even if the non-zero dimensions do not match.

The snippet
allows the third line, but for the fourth line gives the error

A(I,J,...) = X: dimensions mismatch

In general, Matlab allows assignment of an empty slice from any empty matrix, regardless of the sizes of the non-zero dimensions.

The attached patch allows Matlab-compliant behaviour. In order not to slow down all assignments, the special case code is not on the fast path.

Lachlan Andrew <lachlan>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jordigh (Updated the item)
  • -unavailable- added by lachlan (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 24 Jul 2015 09:42:36 PM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Mon 06 Jul 2015 02:50:00 PM UTCjordighStatusNone=>Patch Submitted
    Sat 04 Jul 2015 12:16:56 PM UTCrik5Carbon-CopyRemoved 72865=>-
    Sat 04 Jul 2015 12:16:46 PM UTCrik5SummaryAssigning empty matrix to empty range gives error=>Assigning empty matrix to empty indexing slice gives dimension mismatch error
    Sat 04 Jul 2015 12:14:56 PM UTCrik5Item GroupIncorrect Result=>Matlab Compatibility
    Fri 03 Jul 2015 10:35:51 AM UTClachlanAttached File-=>Added empty_assignment_patch.txt, #34370

    Back to the top


    Powered by Savane 3.1-cleanup1