changeset 4200:1f04df06e1a6

[project @ 2002-11-22 16:25:49 by jwe]
author jwe
date Fri, 22 Nov 2002 16:25:49 +0000
parents 35ec3b95a3ca
children 6acaf43c1725
files src/ChangeLog src/oct-map.h src/ov-struct.h
diffstat 3 files changed, 23 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Nov 21 20:47:49 2002 +0000
+++ b/src/ChangeLog	Fri Nov 22 16:25:49 2002 +0000
@@ -1,3 +1,9 @@
+2002-11-22  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* 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  <jwe@bevo.che.wisc.edu>
 
 	* oct-conf.h.in (OCTAVE_CONF_MKOCTFILE_SH_LDFLAGS): New macro.
--- a/src/oct-map.h	Thu Nov 21 20:47:49 2002 +0000
+++ b/src/oct-map.h	Fri Nov 22 16:25:49 2002 +0000
@@ -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);
 
--- a/src/ov-struct.h	Thu Nov 21 20:47:49 2002 +0000
+++ b/src/ov-struct.h	Fri Nov 22 16:25:49 2002 +0000
@@ -79,6 +79,18 @@
 			 const SLList<octave_value_list>& 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; }