changeset 12384:59efc7da9f7b release-3-4-x

PermMatrix.cc (operator*): fix mixed row/column case
author John W. Eaton <jwe@octave.org>
date Sun, 06 Feb 2011 05:50:49 -0500
parents 5ce03b612725
children c468c5b902b3
files liboctave/ChangeLog liboctave/PermMatrix.cc scripts/ChangeLog scripts/general/circshift.m
diffstat 4 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog	Sun Feb 06 05:18:43 2011 -0500
+++ b/liboctave/ChangeLog	Sun Feb 06 05:50:49 2011 -0500
@@ -1,3 +1,8 @@
+2011-02-06  John W. Eaton  <jwe@octave.org>
+
+	* PermMatrix.cc (operator*): Fix mixed row/column permutation
+	case.  Bug #32346.
+
 2010-02-04  Rik  <octave@nomad.inbox5.com>
 
 	* Makefile.am: Undo accidental checkin
--- a/liboctave/PermMatrix.cc	Sun Feb 06 05:18:43 2011 -0500
+++ b/liboctave/PermMatrix.cc	Sun Feb 06 05:50:49 2011 -0500
@@ -206,9 +206,9 @@
     {
       Array<octave_idx_type> ra (dim_vector (n, 1));
       if (a._colp)
-        ra.assign (idx_vector (ib), ia);
+        ra.assign (idx_vector (ia), ib);
       else
-        ra.assign (idx_vector (ia), ib);
+        ra.assign (idx_vector (ib), ia);
       r = PermMatrix (ra, a._colp, false);
     }
 
--- a/scripts/ChangeLog	Sun Feb 06 05:18:43 2011 -0500
+++ b/scripts/ChangeLog	Sun Feb 06 05:50:49 2011 -0500
@@ -1,3 +1,7 @@
+2011-02-06  John W. Eaton  <jwe@octave.org>
+
+	* general/circshift.m: New tests.
+
 2010-02-05  Rik  <octave@nomad.inbox5.com>
 
 	* miscellaneous/version.m, path/matlabroot.m: Correct spelling.
--- a/scripts/general/circshift.m	Sun Feb 06 05:18:43 2011 -0500
+++ b/scripts/general/circshift.m	Sun Feb 06 05:50:49 2011 -0500
@@ -94,3 +94,6 @@
 %!assert (circshift (x, -2), [7, 8, 9; 1, 2, 3; 4, 5, 6])
 %!assert (circshift (x, [0, 1]), [3, 1, 2; 6, 4, 5; 9, 7, 8]);
 %!assert (circshift ([],1), [])
+
+%!assert (full (circshift (eye (3), 1)), circshift (full (eye (3)), 1))
+%!assert (full (circshift (eye (3), 1)), [0,0,1;1,0,0;0,1,0])