-- Bug description --
sparse() got a wrong result, when a series test input like this:
ij =[
18. 4.
18. 4.
20. 21.
25. 24.
25. 24.
26. 24.
29. 7.
32. 34.
41. 11.
45. 15.
46. 14.
51. 10.
49. 13.
43. 11.
56. 40.
57. 39.
55. 9.
];
val=[1:15,%i,17];
sparse(ij,val,[57,57])
the scilab give the ans as
ans =
( 57, 57) sparse matrix
( 18, 4) 3. + 1.i
( 20, 21) 3. + 1.i
( 25, 24) 9. + 1.i
( 26, 24) 6. + 1.i
( 29, 7) 7. + 1.i
( 32, 34) 8. + 1.i
( 41, 11) 9. + 1.i
( 43, 11) 14. + 1.i
( 45, 15) 10. + 1.i
( 46, 14) 11. + 1.i
( 49, 13) 13. + 1.i
( 51, 10) 12. + 1.i
( 55, 9) 17. + 1.i
( 56, 40) 15. + 1.i
( 57, 39) 1.i
all elements that has value added a %i, it is wrong.
-- Scilab error message --
none
-- How to reproduce the bug --
ij =[
18. 4.
18. 4.
20. 21.
25. 24.
25. 24.
26. 24.
29. 7.
32. 34.
41. 11.
45. 15.
46. 14.
51. 10.
49. 13.
43. 11.
56. 40.
57. 39.
55. 9.
];
val=[1:15,%i,17];
sparse(ij,val,[57,57])