mode returns a wrong answer for row vectors

David Bateman adb014 at gmail.com
Sun Mar 16 18:57:16 CDT 2008


Ben Abbott wrote:
> Unfortunately, I'm unfamiliar with short_freeze ... actually I'm
> unfamiliar with the c/c++ side, in general. Besides that you lost me,
> with the specific indexing example. Do you have a specific input to
> "mode" that illustrates the problem?

In mode mode only tickled this bug due to my error with the permutation
vector. So now that its fixed there is no example of mode that will
create the issue.


> Would the indexing problem still exist for 2-d arrays?

No, as the matrices are assumed to have at least two dimensions. The
issue is for NDArrays where the final index regroups several dimensions
and there is an empty matrix in one of the other indices.. The cases I
stated previously were

t = ones(3,3,3);
t([],4)
t(false(3,1),4)

Note that the three dimensional matrix is indexed with two matrices at
the value 4 is assumed by Octave to index into the 2nd and 3rd
dimensions (which is why there should be no error for an index of 4).

D.


More information about the Bug-octave mailing list