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

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

[Octave-bug-tracker] [bug #35841] error assigning value to multi-dim str


From: Lachlan Andrew
Subject: [Octave-bug-tracker] [bug #35841] error assigning value to multi-dim struct with trailing singleton dimensions
Date: Thu, 24 Sep 2015 13:02:43 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36

Follow-up Comment #2, bug #35841 (project octave):

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

octave> a(1,1,1).b = 1;
octave> a(1,1,:).b = 1
error: invalid assignment to cs-list outside multiple assignment
error: assignment failed, or no method for 'scalar struct = scalar'

In this case, it is sufficient to ignore the fact that the map index is empty.

(file #34973)
    _______________________________________________________

Additional Item Attachment:

File name: bug35841.patch                 Size:1 KB


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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