changeset 4474:f62a7ed4fb06

[project @ 2003-07-30 13:48:51 by jwe]
author jwe
date Wed, 30 Jul 2003 13:50:45 +0000
parents 32ac2bea0185
children 15c739d0c13c
files liboctave/ArrayN.cc liboctave/ChangeLog
diffstat 2 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ArrayN.cc	Tue Jul 29 23:05:32 2003 +0000
+++ b/liboctave/ArrayN.cc	Wed Jul 30 13:50:45 2003 +0000
@@ -181,21 +181,22 @@
 }
 
 static inline void
-increment_index (Array<int>& ra_idx, const Array<int>& dimensions)
+increment_index (Array<int>& ra_idx, const Array<int>& dimensions,
+		 int start_dimension = 0)
 {
-  ra_idx(0)++;
+  ra_idx(start_dimension)++;
 
   int n = ra_idx.length () - 1;
 
-  for (int i = 0; i < n; i++)
+  for (int i = start_dimension; i < n; i++)
     {
       if (ra_idx(i) < dimensions(i))
-	break;
+ 	break;
       else
-	{
-	  ra_idx(i) = 0;
-	  ra_idx(i+1)++;
-	}
+ 	{
+ 	  ra_idx(i) = 0;
+ 	  ra_idx(i+1)++;
+ 	}
     }
 }
 
--- a/liboctave/ChangeLog	Tue Jul 29 23:05:32 2003 +0000
+++ b/liboctave/ChangeLog	Wed Jul 30 13:50:45 2003 +0000
@@ -1,7 +1,10 @@
+2003-07-30  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* ArrayN.cc (increment_index): New arg, start_dimension.
+
 2003-07-29  Heine Kolltveit <kolltvei@idi.ntnu.no>
 
 	* ArrayN.cc (operator <<): Improve output readability.
-	(increment_index (Array<int>&, Array<int>&, int)) New function.
 
 2003-07-29  Petter Risholm	<risholm@stud.ntnu.no>