bugGNU Octave - Bugs: bug #35841, error assigning value to multi-dim...

 
 

bug #35841: error assigning value to multi-dim struct with trailing singleton dimensions

Submitted by:  None
Submitted on:  Wed 14 Mar 2012 05:35:11 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Ray ZimmermanOriginator Email: -unavailable-
Open/Closed: ClosedRelease: dev
Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 13 Oct 2015 04:58:36 PM UTC, comment #3:

I modified the patch slightly. Octave core uses spaces, rather than tabs, for indenting. I also the failing code from this bug report as a test in test/struct.tst so that we don't re-introduce this behavior at a later date. I checked in the patch under Lachlan's name on the development branch (http://hg.savannah.gnu.org/hgweb/octave/rev/96163bdd2ea1).

Rik <rik5>
Project Administrator
Thu 24 Sep 2015 01:02:42 PM UTC, comment #2:

The attached patch makes the original poster's code work, although I'm not sure if it is the right approach.

The problem seems to be that
map.contents (pkey).index (idx.front (), true)
has 0 elements in this case. It may be that the appropriate fix is to make sure that returns something with 1 element in this case. However, a work-around is to set tmpc = Cell(1,1) when it is empty.

The attach also fixes a problem with
In this case, it is sufficient to ignore the fact that the map index is empty.

(file #34973)

Lachlan Andrew <lachlan>
Project Member
Wed 14 Mar 2012 06:58:27 PM UTC, comment #1:

Confirmed on a recent development tip.

This bug is most likely related to singleton dimensions.

The following works which uses only two dimensions

And the reporter has already shown that if the final index is not a singleton then the code works correctly.

Rik <rik5>
Project Administrator
Wed 14 Mar 2012 05:35:11 PM UTC, original submission:

I'm guessing this is a bug. The latest version I have to test this on is 3.4.0, so I'm not sure if it's still an issue in the current release. Starting with a and b undefined ...

The above produces no error in Matlab.

I think it's related to the singleton dimensions ...

... works just fine.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #34973:  bug35841.patch added by lachlan (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by lachlan (Updated the item)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 13 Oct 2015 04:58:36 PM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Thu 24 Sep 2015 08:09:20 PM UTCmtmillerStatusConfirmed=>Patch Submitted
    Thu 24 Sep 2015 01:02:42 PM UTClachlanAttached File-=>Added bug35841.patch, #34973
    Sat 31 Jan 2015 10:32:47 PM UTCmtmillerRelease3.4.0=>dev
      Operating SystemMac OS=>Any
      Summaryerror assigning value to multi-dim struct=>error assigning value to multi-dim struct with trailing singleton dimensions
    Wed 14 Mar 2012 06:58:27 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1