bugGNU Octave - Bugs: bug #43650, reshape says "internal error:...

 
 

bug #43650: reshape says "internal error: dimension mismatch across fields in struct"

Submitter:  None
Submitted:  Thu 20 Nov 2014 05:54:01 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  ziser Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.8.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 05 Aug 2017 04:20:06 AM UTC, comment #3: 

This issue has been fixed in this cset http://hg.savannah.gnu.org/hgweb/octave/rev/3544f88a2bb5.  The example in this report now pass so I'm closing the report.

Rik <rik5>
Group administrator
Sat 10 Sep 2016 04:00:28 PM UTC, comment #2: 

thought it might be worth adding that this bug appears to be related to a recent bug ( bug #46385) found in doing repmat on structs. in certain cases repmat calls reshape in a way that produces the same error message.

http://savannah.gnu.org/bugs/?46385

Nicholas Jankowski <nrjank>
Group Member
Thu 20 Nov 2014 11:11:49 PM UTC, comment #1: 

This is an odd, odd thing.  The incorrect behavior is apparently confined to instances where the reshape dimensions are the same as the original, except for additional trailing singleton dimensions.

Examples:


octave:1> x.a = 1
x =

  scalar structure containing the fields:

    a =  1

octave:2> reshape (x, [1 1 0])
error: reshape: can't reshape 1x1 array to 1x1x0 array
octave:2> reshape (x, [1 1 1])
error: internal error: dimension mismatch across fields in struct
octave:2> reshape (x, [1 1 2])
error: reshape: can't reshape 1x1 array to 1x1x2 array
octave:2> reshape (x, [1 2 1])
error: reshape: can't reshape 1x1 array to 1x2x1 array


The same thing is seen for an array of structs.


octave:2> x(2).a = 2
x =

  1x2 struct array containing the fields:

    a

octave:3> reshape (x, [1 2 1])
error: internal error: dimension mismatch across fields in struct
octave:3> reshape (x, [2 1 1])
error: internal error: dimension mismatch across fields in struct
octave:3> reshape (x, [2 1])
ans =

  2x1 struct array containing the fields:

    a



Rik <rik5>
Group administrator
Thu 20 Nov 2014 05:54:01 PM UTC, original submission:  

When I call reshape() on a struct with a size vector of three elements, I get this cryptic error message.  This does not happen with a size vector of two elements.  Here is an example:


[11:27:53] octave:1> a.hi=0
a =

  scalar structure containing the fields:

    hi = 0

[11:27:56] octave:2> reshape(a,[1 1])
ans =

  scalar structure containing the fields:

    hi = 0

[11:28:08] octave:3> reshape(a,[1 1 1])
error: internal error: dimension mismatch across fields in struct


This also happens in Octave 3.6.1, so I guess it's been there a while.

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

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-05 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2017-08-05 rik5 Dependencies- bugs #51634 is dependent
    2014-11-20 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code