# HG changeset patch # User John W. Eaton # Date 1296850950 18000 # Node ID dab1a16d9875d4f32593799c9154ccbae01d4b37 # Parent af2b18354a8e9493c192c57ef9c64ced04fa1320 PermMatrix.cc (operator*): fix mixed row/column case diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,7 @@ +2011-02-04 John W. Eaton + + * PermMatrix.cc (operator*): Fix mixed row/column permutation case. + 2011-02-03 John W. Eaton * cmd-hist.cc (gnu_history::do_process_histcontrol): diff --git a/liboctave/PermMatrix.cc b/liboctave/PermMatrix.cc --- a/liboctave/PermMatrix.cc +++ b/liboctave/PermMatrix.cc @@ -206,9 +206,9 @@ { Array ra (dim_vector (n, 1)); if (a._colp) + ra.assign (idx_vector (ia), ib); + else ra.assign (idx_vector (ib), ia); - else - ra.assign (idx_vector (ia), ib); r = PermMatrix (ra, a._colp, false); } diff --git a/scripts/general/circshift.m b/scripts/general/circshift.m --- a/scripts/general/circshift.m +++ b/scripts/general/circshift.m @@ -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])