# HG changeset patch # User jwe # Date 1037982349 0 # Node ID 1f04df06e1a6fffff2ecd5ee24a74e87fbeb1de1 # Parent 35ec3b95a3ca0fd7bbf0a3a64f3bfb08a9a53612 [project @ 2002-11-22 16:25:49 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2002-11-22 John W. Eaton + + * oct-map.h (Octave_map::rows, Octave_map::columns): New functions. + * ov-struct.h (octave_struct::rows, octave_struct::columns, + octave_struct::length): New functions. + 2002-11-21 John W. Eaton * oct-conf.h.in (OCTAVE_CONF_MKOCTFILE_SH_LDFLAGS): New macro. diff --git a/src/oct-map.h b/src/oct-map.h --- a/src/oct-map.h +++ b/src/oct-map.h @@ -86,7 +86,11 @@ string_vector keys (void) const; - int array_length () const; + int rows (void) const { return 1; } + + int columns (void) const { return array_length (); } + + int array_length (void) const; Octave_map& assign (const idx_vector& idx, const Octave_map& rhs); diff --git a/src/ov-struct.h b/src/ov-struct.h --- a/src/ov-struct.h +++ b/src/ov-struct.h @@ -79,6 +79,18 @@ const SLList& idx, const octave_value& rhs); + int rows (void) const { return map.rows (); } + + int columns (void) const { return map.columns (); } + + int length (void) const + { + int r = rows (); + int c = columns (); + + return (r == 0 || c == 0) ? 0 : ((r > c) ? r : c); + } + bool is_defined (void) const { return true; } bool is_constant (void) const { return true; }