changeset 4737:108c9a93196d

[project @ 2004-02-05 18:25:00 by jwe]
author jwe
date Thu, 05 Feb 2004 18:25:00 +0000
parents 4179c59d82da
children c9e5b9fa7b17
files liboctave/Array.cc liboctave/ChangeLog
diffstat 2 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/Array.cc	Thu Feb 05 18:04:54 2004 +0000
+++ b/liboctave/Array.cc	Thu Feb 05 18:25:00 2004 +0000
@@ -2025,6 +2025,21 @@
 
   int n_dims = dimensions.length ();
 
+  // Remove trailing singletons in ra_idx, but leave at least ndims
+  // elements.
+
+  int ra_idx_len = ra_idx.length ();
+
+  while (ra_idx_len > n_dims)
+    {
+      if (ra_idx(ra_idx_len-1) == 1)
+	ra_idx_len--;
+      else
+	break;
+    }
+
+  ra_idx.resize (ra_idx_len);
+
   if (n_dims < ra_idx.length ())
     {
       (*current_liboctave_error_handler)
--- a/liboctave/ChangeLog	Thu Feb 05 18:04:54 2004 +0000
+++ b/liboctave/ChangeLog	Thu Feb 05 18:25:00 2004 +0000
@@ -2,6 +2,8 @@
 
 	* Array.cc (Array<T>::assignN): Require RHS == 0x0 matrix for
 	deleting elements.
+	(Array<T>::index): Remove trailing singletons in ra_idx, but leave
+	at least ndims elements.
 
 2004-02-05  Petter Risholm  <risholm@stud.ntnu.no>