[Scilab-Dev] Questions about "in place" insertion in sparse matrices and umfpack

Stéphane Mottelet stephane.mottelet at utc.fr
Mon Jul 15 09:00:03 CEST 2013


Hello all,

Since the umfpack interface has been integrated in scilab (thanks to B. 
Pinçon work), I was wondering if his modified in-place insertion 
algorithm had been also implemented ?

On the same topic I have a question/request : I some applications a 
sparse matrix needs to be updated at each iteration of an optimization 
algorithm, e.g. when the elements of this matrix depend on parameters 
which have to be identified. In such a case, the sparsity pattern does 
not change, but all the elements of the matrix need to be updated as 
fast as possible : this is impossible to do this in an efficient way in 
scilab, since in place insertion of new elements needs to write an 
explicit scilab loop. For example, once a sparse matrix has been built 
like this :


M1_ijv=[1,137,v(3)
1,13,v(10)
1,19,v(12)
1,1,-(v(7)+v(9)+v(11)+v(66))
2,138,v(3)
2,14,v(10)
2,20,v(12)
[...]
151,151,-(v(43)+v(43)+v(60)+v(73))];
M1=sparse(M1_ijv(:,1:2),M1_ijv(:,3),[n1,n1]);


Once v has been modified it should be possible to do something like :

entries=[v(3)
v(10)
v(12)
-(v(7)+v(9)+v(11)+v(66))
v(3)
v(10)
v(12)
[...]
-(v(43)+v(43)+v(60)+v(73))];

spset(M1,entries);

If I am right, the internal storage of scilab sparse matrices uses a 
contiguous vector of the above nonzeros entries and two vectors of 
indices, It should be easy to implement such a "spset" function. Do you 
think it is worth writing a SEP ?

S.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20130715/67fa57fe/attachment.htm>


More information about the dev mailing list