# HG changeset patch # User jwe # Date 1099343204 0 # Node ID 11bea7392e69bcbc1beff9891cee07f62b1376e9 # Parent 3bc00c1098e11e2b3b13471079ec904a5dbbc810 [project @ 2004-11-01 21:06:44 by jwe] diff -r 3bc00c1098e1 -r 11bea7392e69 src/ChangeLog --- 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 + + * 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 + + * ls-mat5.cc (save_mat5_binary_element): Save structure elements + in correct order. + 2004-10-26 John W. Eaton * ov-fcn.h (octave_function::octave_va_arg): No longer const. diff -r 3bc00c1098e1 -r 11bea7392e69 src/data.cc --- 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 (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) { diff -r 3bc00c1098e1 -r 11bea7392e69 src/ls-mat5.cc --- 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); diff -r 3bc00c1098e1 -r 11bea7392e69 src/variables.cc --- 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);