Mercurial > hg > octave-thorsten
changeset 12351:ca1190196d26
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 | 48b49405f485 |
children | 5fb6ea1bff65 |
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 +++ b/liboctave/ChangeLog @@ -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 +++ b/liboctave/PermMatrix.cc @@ -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 +++ b/scripts/ChangeLog @@ -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 +++ 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])