|
From: | Thorsten Meyer |
Subject: | Re: [major] struct array indexing in tip |
Date: | Sun, 25 Jan 2009 12:55:57 +0100 |
User-agent: | Mozilla-Thunderbird 2.0.0.19 (X11/20090103) |
Hi, Jaroslav Hajek wrote: Does that mean, that [b(1:2, [1,3]).name] internally still has shape? I thought thatoctave:173> [b(1:2, [1,3]).name] = deal("aaa", "ddd", "ccc", "fff"); error: A(I,J,...) = X: dimensions mismatch Is that intended behaviour?This stuff never worked correctly, so it's hard to judge by older versions, but I think that given that cs-lists aren't allowed to have shape, they should automatically reshape when assigned to lvalues like a{1:2,3:4}. This following patch should guarantee this. http://hg.savannah.gnu.org/hgweb/octave/rev/35656d6ad061 b(1:2, [1,3]).name is a cs-list without shape, that gets converted to a vector (of some kind of pointers into the b structure array) by the [] operator. regards Thorsten |
[Prev in Thread] | Current Thread | [Next in Thread] |