octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #43650] reshape says "internal error: dimensio


From: Rik
Subject: [Octave-bug-tracker] [bug #43650] reshape says "internal error: dimension mismatch across fields in struct"
Date: Thu, 20 Nov 2014 23:11:49 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0

Update of bug #43650 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up 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




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43650>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]