1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 // Copyright (C) 2012 - 2016 - Scilab Enterprises
6 // This file is hereby licensed under the terms of the GNU GPL v2.0,
7 // pursuant to article 5.3.4 of the CeCILL v.2.1.
8 // This file was originally licensed under the terms of the CeCILL v2.1,
9 // and continues to be available under such terms.
10 // For more information, see the COPYING file which you should have received
11 // along with this program.
13 function r = %sp_y_sp(a,b)
14 // a./.b with a and b sparse
16 [ija,va,mna] = spget(a)
17 [ijb,vb,mnb] = spget(b)
18 if size(ijb,1)<>prod(mnb)|or(vb==0) then
19 msg = _("%s: Division by 0...\n")
20 error(msprintf(msg, "%sp_y_sp"))
27 ij = [((ia-ones(ia))*mnb(1)).*.ones(ib)+ones(ia).*.ib,..
28 ((ja-ones(ja))*mnb(2)).*.ones(jb)+ones(ia).*.jb]
29 r = sparse(ij,va./.vb,mna.*mnb)