Mercurial > hg > octave-nkf
diff liboctave/Array.cc @ 9987:bb30843c4929
fix subscripting of vectors by N-d arrays
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 15 Dec 2009 10:05:38 +0100 |
parents | 7c8392a034e6 |
children | 84b0725f4b09 |
line wrap: on
line diff
--- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -767,11 +767,11 @@ // As you can see, the behaviour is weird, but the tests end up pretty // simple. Nah, I don't want to suggest that this is ad hoc :) - if (ndims () == 2 && n != 1) + if (ndims () == 2 && n != 1 && rd.is_vector ()) { - if (columns () == 1 && rd(0) == 1) + if (columns () == 1) rd = dim_vector (il, 1); - else if (rows () == 1 && rd(1) == 1) + else if (rows () == 1) rd = dim_vector (1, il); }