setdiff(sparse([1 3 0 2]), sparse([3 7])) is wrong
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
With Scilab 5.5.2 and up to Scilab 6.0.1,
........................................
--> d = setdiff(sparse([1 3 0 2]), sparse([3 7]))
d =
( 1, 2) sparse matrix
( 1, 1) 2.
( 1, 2) 1.
--> full(d)
ans =
2. 1.
a) d is not sorted in the right order
b) 0 is missing
With Scilab 6.0.2
.................
--> d = setdiff(sparse([1 3 0 2]), sparse([3 7]))
at line 95 of function setdiff ( SCI\modules\elementary_functions\macros\setdiff.sci line 108 )
Invalid index.
With Scilab 6.1.0:
.................
--> d = setdiff(sparse([1 3 0 2]), sparse([3 7]))
d =
( 1, 3) sparse matrix
( 1, 1) 1.
( 1, 2) 2.
( 1, 3) 3.
a) 0 still missing
b) unexpected value 3
c) right order
ERROR LOG:
----------
"Invalid index" or Wrong answer.
HOW TO REPRODUCE THE BUG:
-------------------------
d = setdiff(sparse([1 3 0 2]), sparse([3 7]))
OTHER INFORMATION:
------------------
See also the bug 15868 , bug 16340 , bug 16451