changeset 5058:11bea7392e69

[project @ 2004-11-01 21:06:44 by jwe]
author jwe
date Mon, 01 Nov 2004 21:06:44 +0000
parents 3bc00c1098e1
children 38dd53c8935e
files src/ChangeLog src/data.cc src/ls-mat5.cc src/variables.cc
diffstat 4 files changed, 31 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Oct 27 03:45:42 2004 +0000
+++ b/src/ChangeLog	Mon Nov 01 21:06:44 2004 +0000
@@ -1,3 +1,15 @@
+2004-11-01  John W. Eaton  <jwe@octave.org>
+
+	* data.cc (INSTANTIATE_EYE): New macro.  Use it to instantiate
+	identity matrix functions for various matrix types.
+
+	* variables.cc (do_who): Fix typo in for loop.
+
+2004-10-28  John W. Eaton  <jwe@octave.org>
+
+	* ls-mat5.cc (save_mat5_binary_element): Save structure elements
+	in correct order.
+
 2004-10-26  John W. Eaton  <jwe@octave.org>
 
 	* ov-fcn.h (octave_function::octave_va_arg): No longer const.
--- a/src/data.cc	Wed Oct 27 03:45:42 2004 +0000
+++ b/src/data.cc	Mon Nov 01 21:06:44 2004 +0000
@@ -1397,6 +1397,20 @@
   return retval;
 }
 
+#define INSTANTIATE_EYE(T) \
+  template octave_value identity_matrix<T> (int, int)
+
+INSTANTIATE_EYE (int8NDArray);
+INSTANTIATE_EYE (uint8NDArray);
+INSTANTIATE_EYE (int16NDArray);
+INSTANTIATE_EYE (uint16NDArray);
+INSTANTIATE_EYE (int32NDArray);
+INSTANTIATE_EYE (uint32NDArray);
+INSTANTIATE_EYE (int64NDArray);
+INSTANTIATE_EYE (uint64NDArray);
+INSTANTIATE_EYE (NDArray);
+INSTANTIATE_EYE (boolNDArray);
+
 static octave_value
 identity_matrix (int nr, int nc, oct_data_conv::data_type dt)
 {
--- a/src/ls-mat5.cc	Wed Oct 27 03:45:42 2004 +0000
+++ b/src/ls-mat5.cc	Mon Nov 01 21:06:44 2004 +0000
@@ -889,13 +889,14 @@
 
 	int len = m.numel ();
 
-	for (Octave_map::const_iterator i = m.begin (); i != m.end (); i++)
+	for (int j = 0; j < len; j++)
 	  {
 	    // write the data of each element
-	    Cell elts = m.contents (i);
 
-	    for (int j = 0; j < len; j++)
+	    for (Octave_map::const_iterator i = m.begin (); i != m.end (); i++)
 	      {
+		Cell elts = m.contents (i);
+
 		bool retval2 = save_mat5_binary_element (os, elts(j), "",
 							 mark_as_global,
 							 save_as_floats);
--- a/src/variables.cc	Wed Oct 27 03:45:42 2004 +0000
+++ b/src/variables.cc	Mon Nov 01 21:06:44 2004 +0000
@@ -1254,7 +1254,7 @@
 
 	  octave_value_list ovl (len, octave_value ());
 
-	  for (int j = 0; j < len; i++)
+	  for (int j = 0; j < len; j++)
 	    ovl(j) = names(j);
 
 	  retval = Octave_map ("name", ovl);