[Scilab-Dev] empty sparse: sparse([]) vs sparse([],[],[0 0])

Samuel Gougeon sgougeon at free.fr
Tue Jan 22 17:06:00 CET 2019


Le 22/01/2019 à 16:34, Stéphane Mottelet a écrit :
> Le 22/01/2019 à 16:25, Samuel Gougeon a écrit :
>> Hello Stéphane,
>>
>> Le 17/01/2019 à 08:37, Stéphane Mottelet a écrit :
>>> Hello Samuel,
>>>
>>> I have initially voted for this behavior (sparse([]) == (  0, 0) 
>>> zero sparse matrix ) but your remark on numerous occurences of 
>>> "sparse([])" in scilab prevented to do so.
>>
>> Why? My remark aimed to bring the attention to existing occurrences 
>> and to prevent merging the commit without updating them, not to 
>> prevent updating them.
>> Then these occurrences changed your opinion and vote, not mine.
>>
>> Best regards
>> Samuel
>
> Please see comment #8:
>
> Anyway, *as bug #15758 is not related to sparse([]) being not sparse*, 
> and considered the numerous side effects, I will restore sparse([]) == 
> double empty matrix. *If you find necessary to have sparse([]) == 
> sparse empty matrix, please file a bug/whish on BZ.*
>

Yes, and neither you -- that voted for it -- nor me did it.
And finally we agree: keeping sparse([])==[] was your decision.
Changing this could be done later if it proves to be better.
For the time being, the situation is the following:

*Scilab 6.0.1*:
--> sparse([])
  ans  =
     []

--> sparse([],[])
  ans  =
(  0,  0) zero sparse matrix

--> sparse([],[],[0,2])
  ans  =
     []

*Scilab 6.0.2-* after https://codereview.scilab.org/20492 :
--> sparse([])      // unchanged
  ans  =
     []

--> sparse([],[])   // unchanged
  ans  =
(  0,  0) zero sparse matrix

--> sparse([],[],[0,2])  // *CHANGED*
  ans  =
(  0,  0) zero sparse matrix

while i don't think that this last change is intentional.
This is what Antoine is pointing to, in https://codereview.scilab.org/20612.

Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20190122/d20d3df6/attachment.htm>


More information about the dev mailing list