From octave-maintainers-request at bevo dot che dot wisc dot edu Tue Jan 6 15:27:57 2004 Subject: Problem with Octave_map after N-D arrays From: "John W. Eaton" To: David Bateman Cc: octave-maintainers at bevo dot che dot wisc dot edu Date: Tue, 6 Jan 2004 15:27:48 -0600 On 1-Dec-2003, David Bateman wrote: | When I do | | std:string key = "key"; | Octave_map m; | m [key] = octave_value (); | | The value is correctly stored in the map. However the dimensions don't seem | to be changed, as rows() and columns() both return zero. This appears to be | a problem related to N-D arrays.... I've had a quick look but don't seem to | see exactly what is the cause of this... I think I've fixed this in CVS now, but it required a change in the interface for the Octave_map class. Now you will have to write m.assign (key, val); m.assign (idx, key, val); I couldn't see any other way to ensure that the dimensions are kept consistent when adding elements (the operator[] simply returned a reference, so there was no opportunity to check and resize the other elements when doing an assignment). jwe