You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using SparseArrays
functiontest(m =3, n =2)
p = .2
A =sprandn(m, n, p)
display("text/plain", A)
x =randn(m)
B = A .* x
display("text/plain", B)
C = B ./ x
display("text/plain", C)
nothingend
Note that the multiplication with x is done correctly, but the division adds zero entries everywhere. I would expect that C has the same sparsity structure as A.
The text was updated successfully, but these errors were encountered:
Code says more than thousand words 😄
This produces
Note that the multiplication with
x
is done correctly, but the division adds zero entries everywhere. I would expect thatC
has the same sparsity structure asA
.The text was updated successfully, but these errors were encountered: