# HG changeset patch # User jwe # Date 1197410809 0 # Node ID df2c3977b0bfe98b615e1d668705533fbc7b9eaa # Parent d42d8c43d3e7786ad92a3a7d76f6220526795ee4 [project @ 2007-12-11 22:06:49 by jwe] diff -r d42d8c43d3e7 -r df2c3977b0bf liboctave/ChangeLog --- a/liboctave/ChangeLog Tue Dec 11 21:49:32 2007 +0000 +++ b/liboctave/ChangeLog Tue Dec 11 22:06:49 2007 +0000 @@ -1,3 +1,9 @@ +2007-12-11 John W. Eaton + + * Sparse.cc (Sparse::index (idx_vector&, int) const): + If indexing scalar with empty matrix, return empty array with same + size as index. + 2007-12-10 John W. Eaton * NLEqn.h (NLEqn::fval): New data member. Adjust constructors diff -r d42d8c43d3e7 -r df2c3977b0bf liboctave/Sparse.cc --- a/liboctave/Sparse.cc Tue Dec 11 21:49:32 2007 +0000 +++ b/liboctave/Sparse.cc Tue Dec 11 22:06:49 2007 +0000 @@ -1517,7 +1517,7 @@ if (idx_arg.one_zero_only ()) retval = Sparse (dim_vector (0, 0)); else - retval = Sparse (dim_vector (0, 1)); + retval = Sparse (idx_orig_dims); else if (nz < 1) if (n >= idx_orig_dims.numel ()) retval = Sparse (idx_orig_dims);