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
J is a sparse matrix with size 120120. J[:, isl] is a column with only four values, which are [11.00 -11.00 44.00 -44.00]. [ki... zeros(length(setdiff(1:nBus,ipq)))...] is a matrix 1201, of which 23 elements are 50.00 and the others equal to zero. The result of running this code is again a column with only four values, which are [0.00 0.00 0.00 0.00]. However, I expect it to be a column with 23, 24,..., or 27 values, which includes 23 values equal to 50.00.
I didn't encounter any error. I believe it should be a bug. By chance I understood that this assignment doesn't work correctly, But it could be in fact dangerous for the others.
a=spzeros(120,120)
isl=5
a[10,isl]=1
a[14,isl]=1
a[37,isl]=1
a
R=zeros(40,1)
S=50*ones(40,1)
T=zeros(40,1)
b=[R... S... T...]
a
b
a[:,isl]=b ## This is the concerned assignmentsum(b) # =1200.0sum(a[:,isl]) # =0.0
The text was updated successfully, but these errors were encountered:
I first wrongly created an issue for julia itself, but it is apparently an issue related to SparseArrays.jl. you can find the previous issue here
Hi,
I tried to run this line in one of my functions:
J is a sparse matrix with size 120120. J[:, isl] is a column with only four values, which are [11.00 -11.00 44.00 -44.00]. [ki... zeros(length(setdiff(1:nBus,ipq)))...] is a matrix 1201, of which 23 elements are 50.00 and the others equal to zero. The result of running this code is again a column with only four values, which are [0.00 0.00 0.00 0.00]. However, I expect it to be a column with 23, 24,..., or 27 values, which includes 23 values equal to 50.00.
I didn't encounter any error. I believe it should be a bug. By chance I understood that this assignment doesn't work correctly, But it could be in fact dangerous for the others.
I fixed it in this way:
Best,
Arman
Here is the reproducible example:
The text was updated successfully, but these errors were encountered: