octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with Octave_map after N-D arrays


From: John W. Eaton
Subject: Problem with Octave_map after N-D arrays
Date: Tue, 6 Jan 2004 15:27:48 -0600

On  1-Dec-2003, David Bateman <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]