Another sparse indexing "bug"

John W. Eaton jwe at bevo.che.wisc.edu
Mon Dec 17 13:54:58 CST 2007


In Matlab, given

  x = sparse (42);

the indexing operation

  x(ones(2,2,2))

produces a 2x4 sparse matrix object with all elements set to 42 and
Octave produces an error.  I'm not sure whether we should make Octave
compatible in this case since the behavior is inconsistent with what
happens for full arrays.  I guess the logic is that since sparse
arrays can only have 2 dimensions, dimensions 2-N of the index are
collapsed to dimension 2.

Should we start collecting these differences and document them so that
when (not if, I'm sure) people report these "bugs" we can just point
to the documented differences that we have no plans to fix?

jwe


More information about the Bug-octave mailing list