Deleting rows with [] insertion in a sparse squares the matrix with padding zeros (6.0.0 regression)
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
Deleting rows with [] insertion in a sparse squares the matrix with padding zeros.
This behavior appeared in 6.0.0 and is still in 6.1.0:
--> m = int(sprand(10,3,0.5)*10);
--> full(m)
ans =
3. 7. 0.
5. 1. 0.
0. 0. 4.
5. 1. 4.
0. 0. 4.
0. 1. 0.
7. 0. 0.
0. 0. 0.
0. 2. 0.
0. 6. 1.
--> m([2 5],:) = []
m =
( 8, 8) sparse matrix
^^^ <<<<<<<<<<<<<<<<<<<<
...
--> full(m)
ans =
3. 7. 0. 0. 0. 0. 0. 0.
0. 0. 4. 0. 0. 0. 0. 0.
5. 1. 4. 0. 0. 0. 0. 0.
0. 1. 0. 0. 0. 0. 0. 0.
7. 0. 0. 0. 0. 0. 0. 0.
0. 0. 0. 0. 0. 0. 0. 0.
0. 2. 0. 0. 0. 0. 0. 0.
0. 6. 1. 0. 0. 0. 0. 0.
^^^^^^^^^^^^^^^^^^^^^^
ERROR LOG:
----------
None. Wrong answer
HOW TO REPRODUCE THE BUG:
-------------------------
m = int(sprand(10,3,0.5)*10);
m([2 5],:) = [];
and(size(m) == [8 3])