Mercurial > hg > octave-lojdl
changeset 8175:977d5204cf67
fix null assignment for structs
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 02 Oct 2008 22:50:44 +0200 |
parents | ea9b5f31bfac |
children | c9d6071b9696 |
files | src/Cell.cc src/Cell.h src/ChangeLog src/oct-map.cc |
diffstat | 4 files changed, 23 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Cell.cc +++ b/src/Cell.cc @@ -172,6 +172,19 @@ return *this; } +Cell& +Cell::delete_elements (const octave_value_list& idx_arg) + +{ + Array<idx_vector> ra_idx (idx_arg.length ()); + for (octave_idx_type i = 0; i < idx_arg.length (); i++) + ra_idx.xelem (i) = idx_arg(i).index_vector (); + + maybe_delete_elements (ra_idx, octave_value ()); + + return *this; +} + octave_idx_type Cell::nnz (void) const {
--- a/src/Cell.h +++ b/src/Cell.h @@ -89,6 +89,8 @@ const octave_value& rfv = resize_fill_value ()) const { return Cell (ArrayN<octave_value>::index (ra_idx, resize_ok, rfv)); } + Cell& delete_elements (const octave_value_list& idx); + Cell& assign (const octave_value_list& idx, const Cell& rhs, const octave_value& fill_val = octave_value ());
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2008-10-02 Jaroslav Hajek <highegg@gmail.com> + + * Cell.h (Cell::delete_elements): Declare new member function. + * Cell.h (Cell::delete_elements): Define it. + * oct-map.cc (Octave_map::maybe_delete_elements): Call delete_elements + instead of assign with empty Cell. + 2008-10-02 John W. Eaton <jwe@octave.org> * pt-arg-list.cc (tree_argument_list::convert_to_const_vector):