Mercurial > hg > octave-nkf
changeset 5328:322ab0da00f8
[project @ 2005-05-02 10:48:43 by jwe]
author | jwe |
---|---|
date | Mon, 02 May 2005 10:48:43 +0000 |
parents | 68eae0f668c4 |
children | f087ea85c24b |
files | src/ChangeLog src/oct-map.cc src/oct-map.h |
diffstat | 3 files changed, 20 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2005-05-02 John W. Eaton <jwe@octave.org> + + * oct-map.h (Octave_map::seek, Octave_map::contents): New + non-const versions. + * oct-map.cc (Octave_map::assign (const octave_value_list&, + const std::string&, const Cell&)): For clarity, always resize to + new_dims. + 2005-05-02 David Bateman <dbateman@free.fr> * ov-re-sparse.cc, ov-cx-sparse.cc (load_binary): read save_type into
--- a/src/oct-map.cc +++ b/src/oct-map.cc @@ -31,6 +31,12 @@ #include "oct-map.h" #include "utils.h" +Cell& +Octave_map::contents (const std::string& k) +{ + return map[k]; +} + Cell Octave_map::contents (const std::string& k) const { @@ -271,7 +277,7 @@ else if (new_dims != curr_dims) { for (iterator p = begin (); p != end (); p++) - contents(p).resize (rhs_dims, fill_value); + contents(p).resize (new_dims, fill_value); } dimensions = new_dims;
--- a/src/oct-map.h +++ b/src/oct-map.h @@ -91,8 +91,12 @@ std::string key (const_iterator p) const { return p->first; } + Cell& contents (const std::string& k); Cell contents (const std::string& k) const; + Cell& contents (const_iterator p) + { return contents (key(p)); } + Cell contents (const_iterator p) const { return contents (key(p)); } @@ -101,6 +105,7 @@ std::string stringfield (const std::string& k, const std::string& def_val = std::string ()) const; + iterator seek (const std::string& k) { return map.find (k); } const_iterator seek (const std::string& k) const { return map.find (k); } bool contains (const std::string& k) const