Mercurial > hg > octave-lyh
changeset 7774:ce52af0e4a10
all false logical indexing fix
author | David Bateman <dbateman@free.fr> |
---|---|
date | Tue, 13 May 2008 17:45:35 +0200 |
parents | f83be206eca1 |
children | c10d77387d96 |
files | liboctave/ChangeLog liboctave/idx-vector.cc |
diffstat | 2 files changed, 12 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2008-05-13 David Bateman <dbateman@free.fr> + + * idx-vector.cc (IDX_VEC_REP::idx_vector_rep (const boolNDArray&)): + If len is zero size the index vector in the same manner as if len + is not zero. + 2008-05-05 John W. Eaton <jwe@octave.org> * cmd-edit.cc (command_editor::re_read_init_file,
--- a/liboctave/idx-vector.cc +++ b/liboctave/idx-vector.cc @@ -270,11 +270,13 @@ range(0), initialized (0), frozen (0), colon_equiv_checked (0), colon_equiv (0), orig_dims () { + dim_vector dv = bnda.dims (); + + orig_dims = ((dv.length () == 2 && dv(0) == 1) + ? dim_vector (1, len) : orig_dims = dim_vector (len, 1)); + if (len == 0) - { - orig_dims = dim_vector (0, 0); - initialized = 1; - } + initialized = 1; else { data = new octave_idx_type [len]; @@ -285,11 +287,6 @@ if (bnda.elem (i)) data[k++] = i; - dim_vector dv = bnda.dims (); - - orig_dims = ((dv.length () == 2 && dv(0) == 1) - ? dim_vector (1, len) : orig_dims = dim_vector (len, 1)); - init_state (); } }