[Scilab-Dev] Question about sparse(ij,v,mn) internals

Stéphane Mottelet stephane.mottelet at utc.fr
Tue May 12 21:41:43 CEST 2015


Hello Samuel,

I have posted the wish at bugzilla Scilab's site 
(http://bugzilla.scilab.org/show_bug.cgi?id=13875) and I am impatient to 
see your solution.

Stéphane

Le 12/05/2015 12:01, Samuel Gougeon a écrit :
> Le 12/05/2015 11:56, Samuel Gougeon a écrit :
>> Le 12/05/2015 11:09, Stéphane Mottelet a écrit :
>>> Le 12/05/2015 10:30, Samuel Gougeon a écrit :
>>>>
>>>>> OK. So, unless i misunderstand you, this syntax is used only to 
>>>>> update values at their current positions, not to set new positions 
>>>>> or modify ones.
>>> exactly !
>>
>> Stephane,
>> Could you report your wish on bugzilla? The patch to do S.nzval=v is 
>> ready. I will post it on your report, with updated help pages.
> Here is a sample:
>
> -->sp0 = sprand(5,4,0.4); v = grand(1,nnz(sp0),"uin",0,10); sp = sp0;
>
> -->sp.nzval = v;
>
> -->full(sp0), v, full(sp),sp
>  ans  =
>
>     0.3439298    0.           0.0811258    0.9293860
>     0.           0.7802274    0.3794188    0.
>     0.6256186    0.           0.           0.4584969
>     0.           0.6692851    0.           0.
>     0.8157691    0.           0.           0.7757127
>  v  =
>
>     5.    9.    6.    0.    10.    5.    4.    0.    9.    3.
>  ans  =
>
>     5.    0.     5.    0.
>     0.    0.     4.    0.
>     9.    0.     0.    9.
>     0.    10.    0.    0.
>     6.    0.     0.    3.
>  sp  =
>
> (    5,    4) sparse matrix
>
> (    1,    1)        5.
> (    1,    3)        5.
> (    2,    3)        4.
> (    3,    1)        9.
> (    3,    4)        9.
> (    4,    2)        10.
> (    5,    1)        6.
> (    5,    4)        3.
>
>
>
> _______________________________________________
> dev mailing list
> dev at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/dev

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


More information about the dev mailing list