Skip to content

gsort(Sparse) yields an error if the Sparse vector includes some NaN values

Reported by Samuel GOUGEON (@sgougeon)

BUG DESCRIPTION:
----------------
gsort(Sparse) yields an error if the Sparse vector includes some NaN values:

With Scilab 5.5.2:
~~~~~~~~~~~~~~~~~
-->s = sprand(20,1,0.5);
-->gsort(s);
-->s(7) = %nan;

-->gsort(s);
 !--error 15 
Submatrix incorrectly defined.
at line     141 of function %sp_gsort called by :  
gsort(s);


With Scilab 6.1.0:
~~~~~~~~~~~~~~~~~
--> s = sprand(20,1,0.5);

--> gsort(s);

--> s(7) = %nan;

--> gsort(s);
at line   141 of function %sp_gsort ( SCI\modules\elementary_functions\macros\%sp_gsort.sci line 154 )
in builtin                gsort     

Submatrix incorrectly defined.


Same issue with a ROW vector instead of a column.


ERROR LOG:
----------
Submatrix incorrectly defined.


HOW TO REPRODUCE THE BUG:
-------------------------
s = sprand(20,1,0.5);
gsort(s);
s(7) = %nan;
gsort(s);