[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #31287] Certain assignments of empty arrays gi
From: |
Olaf Till |
Subject: |
[Octave-bug-tracker] [bug #31287] Certain assignments of empty arrays give errors (Matlab incompatibility) |
Date: |
Wed, 22 Dec 2010 13:59:28 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.0.19) Gecko/2010102906 Iceweasel/3.0.6 (Debian-3.0.6-3) |
Follow-up Comment #9, bug #31287 (project octave):
Rules deduced for Matlab 2009b
In the following "dimensions" means dimensions as returned by size().
1. Special case "null assignment" (= [], literally)
The rule for the left hand side is given by the error message "A null
assignment can have only one non-colon index."
The following, and only the following, qualify for a "colon index" in the
sense of this rule:
- a colon ":",
- any numeric array with at least one dimension empty,
- only if the lhs is at most 2-dimensional: a logical index of arbitrary
length with all elements false.
2. The other empty assignments
Definitions for assignments:
lhs(idx) = rhs;
ilhs means lhs(idx)
Matlab seems to treat 2 cases differently
2.1. First case: lhs <= 2-dimensional AND ilhs <= 2-dimensional AND rhs <=
2-dimensional
Empty assignment succeeds if and only if (any dimension in ilhs is 0 AND any
dimension in rhs is 0).
2.2. Second case: all other empty assignments
Empty assignment succeeds if and only if all dimensions != 1 (i.e. 0 or >= 2)
are in the same order in ilhs and rhs (which implies that there is the same
number of these non-singleton dimensions in ilhs and rhs).
I.e. dimensions of 1 can be in arbitrary numbers and positions in ilhs and
rhs.
End of rules.
I can make a test script, but not before January. I would like to have these
rules reviewed and tested before (though of corse I will also test them with
the script). Should I post them to a list for a wider audience of potential
testers?
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?31287>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/