# HG changeset patch # User jwe # Date 1115030923 0 # Node ID 322ab0da00f8e637bad7c96937975953ef2e1c68 # Parent 68eae0f668c4b8e4c798d0e8d0e81c8fcfef5564 [project @ 2005-05-02 10:48:43 by jwe] diff -r 68eae0f668c4 -r 322ab0da00f8 src/ChangeLog --- a/src/ChangeLog Mon May 02 08:57:21 2005 +0000 +++ b/src/ChangeLog Mon May 02 10:48:43 2005 +0000 @@ -1,3 +1,11 @@ +2005-05-02 John W. Eaton + + * 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 * ov-re-sparse.cc, ov-cx-sparse.cc (load_binary): read save_type into diff -r 68eae0f668c4 -r 322ab0da00f8 src/oct-map.cc --- a/src/oct-map.cc Mon May 02 08:57:21 2005 +0000 +++ b/src/oct-map.cc Mon May 02 10:48:43 2005 +0000 @@ -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; diff -r 68eae0f668c4 -r 322ab0da00f8 src/oct-map.h --- a/src/oct-map.h Mon May 02 08:57:21 2005 +0000 +++ b/src/oct-map.h Mon May 02 10:48:43 2005 +0000 @@ -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