Mon 18 Jan 2016 05:03:01 PM UTC, comment #5:
@Lachlan: I checked in your fix for indexing cell expressions here (http://hg.savannah.gnu.org/hgweb/octave/rev/99d373870017). I benchmarked before/after and I couldn't detect a performance difference. One thing I did was add regression tests for this bug and bug #35841 to index.tst so that we don't accidentally re-introduce this bug if we optimize things in the future.
|
Wed 16 Dec 2015 01:18:23 AM UTC, comment #4:
It is even easier to resolve, although I'm not sure if the resolution is correct :)
For some reason, the function
Array<T>::index (const Array<idx_vector>& ia, bool resize_ok, const T& rfv) const
had two checks that the dimension of ia matches that of this. First, it correctly expands trailing singletons, but in the second check it doesn't.
My current work-around is to do the second test only if a resize occurs, but since I'm not sure why the test is needed at all, that may not be the right response.
This also avoids the problem of bug #35841 directly, and so the attached changeset backs that fix out (while keeping the changes to tests).
(file #35756)
|
Thu 26 Nov 2015 05:42:03 PM UTC, comment #3:
@Lachlan: Adding you to the CC list for this bug about cell indexing with trailing singleton dimensions. This looks awfully similar to bug #35841 which dealt with the assignment to structs with trailing singleton dimensions. You prepared the changeset for that here http://hg.savannah.gnu.org/hgweb/octave/rev/96163bdd2ea1. Could you take a look and see if it is equally easy to resolve?
|
Sun 25 Aug 2013 08:33:40 AM UTC, comment #2:
Looks like the issue is with octave failing to allow the second level of indexing in this case. In matlab:
in octave:
|
Tue 20 Aug 2013 05:08:25 AM UTC, comment #1:
Confirmed on a recent development tip (hg id bc924baa2c4e). The issue is with how trailing dimensions are treated, and it would be useful to know how Matlab behaves for the same code input if you have access to it.
The code
does not create a 1x1x1 cell array. In Octave and Matlab trailing singleton dimensions are usually removed so this becomes
This can be checked with
Your code sample works if the cell array is truly 3-dimensional.
|
Thu 15 Aug 2013 08:24:47 AM UTC, original submission:
When executing the following cell assignment
Octave gives an error:
error: a cs-list cannot be further indexed
error: assignment failed, or no method for 'cell = range'
Expected behavior is for c{1,1,1} to assume value
[1, 0; 1, 0; 1, 0; 1, 0; 1, 0]
If this bug is fixed, please add a relevant test to the test suite.
|